From baf1be9cd23f897bd4c3d3b019f44b4d66ae270c Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 30 Jul 2021 11:46:27 +0200 Subject: [PATCH 01/63] Here's a template for you. --- Cargo.lock | 19 ++ Cargo.toml | 1 + runtime/westend/Cargo.toml | 3 + runtime/westend/src/lib.rs | 6 + xcm/pallet-xcm-benchmarks/Cargo.toml | 37 ++++ xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 104 +++++++++++ xcm/pallet-xcm-benchmarks/src/lib.rs | 48 +++++ xcm/pallet-xcm-benchmarks/src/mock.rs | 167 ++++++++++++++++++ xcm/xcm-builder/src/mock.rs | 3 + 9 files changed, 388 insertions(+) create mode 100644 xcm/pallet-xcm-benchmarks/Cargo.toml create mode 100644 xcm/pallet-xcm-benchmarks/src/benchmarking.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/lib.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/mock.rs diff --git a/Cargo.lock b/Cargo.lock index a0af42960a12..af8fb75a2302 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5456,6 +5456,24 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "parity-scale-codec", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.2.4" @@ -12102,6 +12120,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", diff --git a/Cargo.toml b/Cargo.toml index 668b61db7ee0..57b1fd679301 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ members = [ "xcm/xcm-builder", "xcm/xcm-executor", "xcm/pallet-xcm", + "xcm/pallet-xcm-benchmarks", "node/client", "node/collation-generation", "node/core/approval-voting", diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 090b45006af3..7eb108a849fe 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -69,6 +69,9 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false } +# TODO: ideally this should also be optional, and everything related to it in the code gated by the +# runtime benchmakrs feature, but that's a story for another day. +pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index cdc849a10429..bb3843c84b57 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1007,6 +1007,10 @@ impl pallet_xcm::Config for Runtime { type Weigher = FixedWeightBounds; } +impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = XcmConfig; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1084,6 +1088,7 @@ construct_runtime! { // Pallet for sending XCM. XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 99, + XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet} = 999, } } @@ -1493,6 +1498,7 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_vesting, Vesting); + add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } let storage_info = AllPalletsWithSystem::storage_info(); diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml new file mode 100644 index 000000000000..d5e894a72d59 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "pallet-xcm-benchmarks" +authors = ["Parity Technologies "] +edition = "2018" +version = "0.9.8" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } +frame-support = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } +frame-system = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } +sp-runtime = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } +sp-std = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate", optional = true } +xcm-executor = { path = "../xcm-executor" } + +[dev-dependencies] +pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } +sp-core = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } +sp-io = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } +xcm-builder = { path = "../xcm-builder" } +xcm = { path = ".." } + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std" +] +runtime-benchmarks = ["frame-benchmarking"] +try-runtime = ["frame-support/try-runtime"] diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs new file mode 100644 index 000000000000..2e8af16457d8 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -0,0 +1,104 @@ +// This file is part of Substrate. + +// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![cfg(feature = "runtime-benchmarks")] + +use crate::*; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_system::RawOrigin; + +benchmarks! { + withdraw_asset { + // setup + }: { + // execute + } verify { + // verify + } + reserve_asset_deposit { + // setup + }: { + // execute + } verify { + // verify + } + teleport_asset { + // setup + }: { + // execute + } verify { + // verify + } + query_response { + // setup + }: { + // execute + } verify { + // verify + } + transfer_asset { + // setup + }: { + // execute + } verify { + // verify + } + transfer_reserved_asset { + // setup + }: { + // execute + } verify { + // verify + } + transact { + // setup + }: { + // execute + } verify { + // verify + } + hrmp_channel_open_request { + // setup + }: { + // execute + } verify { + // verify + } + hrmp_channel_accepted { + // setup + }: { + // execute + } verify { + // verify + } + hrmp_channel_closing { + // setup + }: { + // execute + } verify { + // verify + } + relayed_from { + // setup + }: { + // execute + } verify { + // verify + } +} + +// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test); diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs new file mode 100644 index 000000000000..a1584b7e4b0e --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -0,0 +1,48 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Pallet that serves no other purpose than benchmarking raw messages [`Xcm`]. + +// Ensure we're `no_std` when compiling for Wasm. +#![cfg_attr(not(feature = "std"), no_std)] + +use sp_std::prelude::*; +pub use pallet::*; + +#[cfg(test)] +mod mock; + +mod benchmarking; +// pub mod weights; +// pub use weights::*; + +#[frame_support::pallet] +pub mod pallet { + #[pallet::config] + pub trait Config: frame_system::Config { + /// The XCM configurations. + /// + /// These might affect the execution of XCM messages, such as defining how the + /// `TransactAsset` is implemented. + type XcmConfig: xcm_executor::Config; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + +} diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs new file mode 100644 index 000000000000..03ce5d6d84a2 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -0,0 +1,167 @@ +// This file is part of Substrate. + +// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! A mock runtime for xcm benchmarking. +#![allow(dead_code, unused_imports)] // TODO: remove this later. + +use crate::*; +use frame_support::{ + parameter_types, +}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; +use crate as pallet_xcm_benchmarks; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// For testing the pallet, we construct a mock runtime. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); +} +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::AllowAll; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = u64; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); +} + +use xcm::opaque::v0::MultiLocation; +use xcm::opaque::v0::MultiAsset; +use xcm::opaque::v0::Xcm; +use xcm::opaque::v0::prelude::XcmResult; + +// An xcm sender akin to > /dev/null +struct DevNull; +impl xcm::opaque::v0::SendXcm for DevNull { + fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { + Ok(()) + } +} + +parameter_types! { + pub const CheckedAccount: Option = Some(42); +} + +struct TestMatcher; +impl xcm_executor::traits::MatchesFungible for TestMatcher { + fn matches_fungible(a: &MultiAsset) -> Option { + // TODO + None + } +} + +struct AccountIdConverter; +impl xcm_executor::traits::Convert for AccountIdConverter { + fn convert(ml: MultiLocation) -> Result { + Err(ml) + } + + fn reverse(acc: u64) -> Result { + Err(acc) + } +} + +// Use balances as the asset transactor. +type AssetTransactor = xcm_builder::CurrencyAdapter< + Balances, + TestMatcher, + AccountIdConverter, + u64, + CheckedAccount +>; + +struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = DevNull; + type AssetTransactor = AssetTransactor; + type OriginConverter = (); + type IsReserve = (); + type IsTeleporter = (); + type LocationInverter = (); + type Barrier = (); + type Weigher = (); + type Trader = (); + type ResponseHandler = (); +} + +impl pallet_xcm_benchmarks::Config for Test { + type XcmConfig = (); +} + +// This function basically just builds a genesis storage key/value store according to +// our desired mockup. +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = GenesisConfig { ..Default::default() } + .build_storage() + .unwrap(); + t.into() +} diff --git a/xcm/xcm-builder/src/mock.rs b/xcm/xcm-builder/src/mock.rs index 56d7d753e49e..0c0228ff54d4 100644 --- a/xcm/xcm-builder/src/mock.rs +++ b/xcm/xcm-builder/src/mock.rs @@ -54,6 +54,7 @@ pub enum TestCall { OnlySigned(Weight, Option, Option), Any(Weight, Option), } + impl Dispatchable for TestCall { type Origin = TestOrigin; type Config = (); @@ -101,9 +102,11 @@ impl GetDispatchInfo for TestCall { thread_local! { pub static SENT_XCM: RefCell> = RefCell::new(Vec::new()); } + pub fn sent_xcm() -> Vec<(MultiLocation, opaque::Xcm)> { SENT_XCM.with(|q| (*q.borrow()).clone()) } + pub struct TestSendXcm; impl SendXcm for TestSendXcm { fn send_xcm(dest: MultiLocation, msg: opaque::Xcm) -> XcmResult { From 3f357a0dd836146cde6a8cb971d8a3aa2b09d77a Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 30 Jul 2021 12:11:20 +0200 Subject: [PATCH 02/63] All tests compile --- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 3 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 1 - xcm/pallet-xcm-benchmarks/src/mock.rs | 72 ++++++++++--------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index 2e8af16457d8..aff85c1f6d7e 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -19,7 +19,6 @@ use crate::*; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_system::RawOrigin; benchmarks! { withdraw_asset { @@ -101,4 +100,4 @@ benchmarks! { } } -// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test); +impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index a1584b7e4b0e..ade45ecceca9 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -20,7 +20,6 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -use sp_std::prelude::*; pub use pallet::*; #[cfg(test)] diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 03ce5d6d84a2..b0731a839c74 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -18,17 +18,15 @@ //! A mock runtime for xcm benchmarking. #![allow(dead_code, unused_imports)] // TODO: remove this later. +use crate as pallet_xcm_benchmarks; use crate::*; -use frame_support::{ - parameter_types, -}; +use frame_support::parameter_types; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use crate as pallet_xcm_benchmarks; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -93,32 +91,43 @@ impl pallet_balances::Config for Test { type WeightInfo = (); } -use xcm::opaque::v0::MultiLocation; -use xcm::opaque::v0::MultiAsset; -use xcm::opaque::v0::Xcm; -use xcm::opaque::v0::prelude::XcmResult; +use frame_support::weights::Weight; +use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; -// An xcm sender akin to > /dev/null -struct DevNull; +// An xcm sender/receiver akin to > /dev/null +pub struct DevNull; impl xcm::opaque::v0::SendXcm for DevNull { fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { Ok(()) } } +impl xcm_executor::traits::OnResponse for DevNull { + fn expecting_response(_: &MultiLocation, _: u64) -> bool { + false + } + + fn on_response(_: MultiLocation, _: u64, _: Response) -> Weight { + 0 + } +} + parameter_types! { - pub const CheckedAccount: Option = Some(42); + pub const CheckedAccount: Option = Some(100); + pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); + pub UnitWeightCost: Weight = 10; + pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Null, 1_000_000_000_000); } -struct TestMatcher; +pub struct TestMatcher; impl xcm_executor::traits::MatchesFungible for TestMatcher { - fn matches_fungible(a: &MultiAsset) -> Option { + fn matches_fungible(_: &MultiAsset) -> Option { // TODO None } } -struct AccountIdConverter; +pub struct AccountIdConverter; impl xcm_executor::traits::Convert for AccountIdConverter { fn convert(ml: MultiLocation) -> Result { Err(ml) @@ -130,38 +139,31 @@ impl xcm_executor::traits::Convert for AccountIdConverter { } // Use balances as the asset transactor. -type AssetTransactor = xcm_builder::CurrencyAdapter< - Balances, - TestMatcher, - AccountIdConverter, - u64, - CheckedAccount ->; - -struct XcmConfig; +pub type AssetTransactor = + xcm_builder::CurrencyAdapter; + +pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; type XcmSender = DevNull; type AssetTransactor = AssetTransactor; - type OriginConverter = (); - type IsReserve = (); - type IsTeleporter = (); - type LocationInverter = (); - type Barrier = (); - type Weigher = (); - type Trader = (); - type ResponseHandler = (); + type OriginConverter = (); // TODO: + type IsReserve = (); // TODO: + type IsTeleporter = (); // no one can teleport. + type LocationInverter = xcm_builder::LocationInverter; + type Barrier = (); // No barriers -- everything is allowed. + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfConcreteFungible; + type ResponseHandler = DevNull; } impl pallet_xcm_benchmarks::Config for Test { - type XcmConfig = (); + type XcmConfig = XcmConfig; } // This function basically just builds a genesis storage key/value store according to // our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { - let t = GenesisConfig { ..Default::default() } - .build_storage() - .unwrap(); + let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); t.into() } From ac4048008bffa93855b4adbb07217f547ba1d3c7 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 30 Jul 2021 13:11:34 +0200 Subject: [PATCH 03/63] finish the skeleton --- xcm/Cargo.toml | 1 + xcm/pallet-xcm-benchmarks/Cargo.toml | 13 +- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 115 ++++++------------ xcm/pallet-xcm-benchmarks/src/lib.rs | 1 - xcm/pallet-xcm-benchmarks/src/mock.rs | 1 - xcm/src/v0/traits.rs | 4 + xcm/xcm-executor/src/lib.rs | 8 +- 7 files changed, 58 insertions(+), 85 deletions(-) diff --git a/xcm/Cargo.toml b/xcm/Cargo.toml index 66d565efde4e..8f6ef6584a43 100644 --- a/xcm/Cargo.toml +++ b/xcm/Cargo.toml @@ -14,6 +14,7 @@ log = { version = "0.4.14", default-features = false } [features] default = ["std"] wasm-api = [] +runtime-benchmarks = [] std = [ "parity-scale-codec/std", ] diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index d5e894a72d59..1e38306550dd 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -13,8 +13,11 @@ frame-support = { version = "4.0.0-dev", default-features = false, branch = "mas frame-system = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } sp-runtime = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } sp-std = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } -frame-benchmarking = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate", optional = true } -xcm-executor = { path = "../xcm-executor" } +xcm-executor = { path = "../xcm-executor", default-features = false } + +# Benchmarks dependencies. +frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, branch = "master", git = "https://github.com/paritytech/substrate" } +xcm = { path = "..", default-features = false, optional = true } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } @@ -33,5 +36,7 @@ std = [ "sp-runtime/std", "sp-std/std" ] -runtime-benchmarks = ["frame-benchmarking"] -try-runtime = ["frame-support/try-runtime"] +runtime-benchmarks = [ + "frame-benchmarking", + "xcm/runtime-benchmarks" +] diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index aff85c1f6d7e..b9bb2b0effc4 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -19,85 +19,50 @@ use crate::*; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use xcm::{ + opaque::v0::{ExecuteXcm, MultiLocation}, + v0::Order, +}; + +/// The xcm executor to use for doing stuff. +pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; +// TODO: might be better to just accept the outer call directly. +pub type OverArchingCallOf = ::Call; benchmarks! { - withdraw_asset { - // setup - }: { - // execute - } verify { - // verify - } - reserve_asset_deposit { - // setup - }: { - // execute - } verify { - // verify - } - teleport_asset { - // setup - }: { - // execute - } verify { - // verify - } - query_response { - // setup - }: { - // execute - } verify { - // verify - } - transfer_asset { - // setup - }: { - // execute - } verify { - // verify - } - transfer_reserved_asset { - // setup - }: { - // execute - } verify { - // verify + where_clause { + where T::XcmConfig: xcm_executor::Config> } - transact { - // setup + // orders. + order_null {}: {} verify {} + order_deposit_asset { + let order = Order::>::DepositAsset { + assets: vec![], + dest: MultiLocation::Null, + }; }: { - // execute - } verify { - // verify - } - hrmp_channel_open_request { - // setup - }: { - // execute - } verify { - // verify - } - hrmp_channel_accepted { - // setup - }: { - // execute - } verify { - // verify - } - hrmp_channel_closing { - // setup - }: { - // execute - } verify { - // verify - } - relayed_from { - // setup - }: { - // execute - } verify { - // verify - } + ExecutorOf::::execute_order(order) + } verify {} + + order_deposit_reserved_asset {}: {} verify {} + order_exchange_asset {}: {} verify {} + order_initiate_reserve_withdraw {}: {} verify {} + order_initiate_teleport {}: {} verify {} + order_query_holding {}: {} verify {} + order_buy_execution {}: {} verify {} + + // base XCM messages. + xcm_withdraw_asset {}: {} verify {} + xcm_reserve_asset_deposit {}: {} verify {} + xcm_teleport_asset {}: {} verify {} + xcm_query_response {}: {} verify {} + xcm_transfer_asset {}: {} verify {} + xcm_transfer_reserved_asset {}: {} verify {} + xcm_transact {}: {} verify {} + xcm_hrmp_channel_open_request {}: {} verify {} + xcm_hrmp_channel_accepted {}: {} verify {} + xcm_hrmp_channel_closing {}: {} verify {} + xcm_relayed_from {}: {} verify {} } impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index ade45ecceca9..5238c351873b 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -43,5 +43,4 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); - } diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index b0731a839c74..e9910c0b1b62 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -106,7 +106,6 @@ impl xcm_executor::traits::OnResponse for DevNull { fn expecting_response(_: &MultiLocation, _: u64) -> bool { false } - fn on_response(_: MultiLocation, _: u64, _: Response) -> Weight { 0 } diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 9a01f227e766..2cba092cc2f9 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -162,6 +162,10 @@ pub trait ExecuteXcm { weight_limit: Weight, weight_credit: Weight, ) -> Outcome; + + /// Execute just an order. This is only used in benchmarks. + #[cfg(feature = "runtime-benchmarks")] + fn execute_order(_: super::Order) {} } impl ExecuteXcm for () { diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 8f8a5c9ee617..d9715e4a44e7 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -106,10 +106,10 @@ impl XcmExecutor { log::trace!( target: "xcm::do_execute_xcm", "origin: {:?}, top_level: {:?}, message: {:?}, weight_credit: {:?}, maybe_shallow_weight: {:?}", - origin, - top_level, - message, - weight_credit, + origin, + top_level, + message, + weight_credit, maybe_shallow_weight, ); // This is the weight of everything that cannot be paid for. This basically means all computation From a43758a95b6f02e6d1d0d29708ec8153e52ff7c3 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sat, 31 Jul 2021 11:55:03 +0200 Subject: [PATCH 04/63] More baby steps --- Cargo.lock | 3 + node/core/av-store/src/lib.rs | 2 +- node/core/bitfield-signing/src/lib.rs | 2 +- node/network/collator-protocol/src/lib.rs | 2 +- parachain/test-parachains/adder/src/lib.rs | 6 +- parachain/test-parachains/halt/src/lib.rs | 5 +- primitives/src/lib.rs | 1 - xcm/pallet-xcm-benchmarks/Cargo.toml | 2 + xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 124 ++++++++++++++++-- xcm/pallet-xcm-benchmarks/src/lib.rs | 5 + xcm/pallet-xcm-benchmarks/src/mock.rs | 48 +++++-- xcm/src/v0/traits.rs | 4 - xcm/xcm-builder/Cargo.toml | 6 +- xcm/xcm-builder/src/currency_adapter.rs | 36 ++--- xcm/xcm-executor/Cargo.toml | 1 + xcm/xcm-executor/src/lib.rs | 13 ++ xcm/xcm-executor/src/traits/transact_asset.rs | 26 ++-- 17 files changed, 225 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af8fb75a2302..5f52c891f897 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5463,12 +5463,14 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-balances", "parity-scale-codec", "sp-core", "sp-io", "sp-runtime", "sp-std", + "sp-tracing", "xcm", "xcm-builder", "xcm-executor", @@ -12279,6 +12281,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain", diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index 09a3a28fed5f..754e8ce51ba6 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -16,7 +16,7 @@ //! Implements a `AvailabilityStoreSubsystem`. -#![recursion_limit="256"] +#![recursion_limit = "256"] #![warn(missing_docs)] use std::collections::{HashMap, HashSet, BTreeSet}; diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index 1edc89886a3b..c745da9e57f2 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -18,7 +18,7 @@ #![deny(unused_crate_dependencies)] #![warn(missing_docs)] -#![recursion_limit="256"] +#![recursion_limit = "256"] use futures::{channel::{mpsc, oneshot}, lock::Mutex, prelude::*, future, Future}; use sp_keystore::{Error as KeystoreError, SyncCryptoStorePtr}; diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 96af19aa1e58..029274f403d7 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -18,7 +18,7 @@ //! This subsystem implements both sides of the collator protocol. #![deny(missing_docs, unused_crate_dependencies)] -#![recursion_limit="256"] +#![recursion_limit = "256"] use std::time::Duration; diff --git a/parachain/test-parachains/adder/src/lib.rs b/parachain/test-parachains/adder/src/lib.rs index 37208efbca1b..06a705c3557b 100644 --- a/parachain/test-parachains/adder/src/lib.rs +++ b/parachain/test-parachains/adder/src/lib.rs @@ -17,8 +17,10 @@ //! Basic parachain that adds a number as part of its state. #![no_std] - -#![cfg_attr(not(feature = "std"), feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler))] +#![cfg_attr( + not(feature = "std"), + feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler) +)] use parity_scale_codec::{Encode, Decode}; use tiny_keccak::{Hasher as _, Keccak}; diff --git a/parachain/test-parachains/halt/src/lib.rs b/parachain/test-parachains/halt/src/lib.rs index 00314033a4dd..b0a44bca3415 100644 --- a/parachain/test-parachains/halt/src/lib.rs +++ b/parachain/test-parachains/halt/src/lib.rs @@ -17,7 +17,10 @@ //! Basic parachain that executes forever. #![no_std] -#![cfg_attr(not(feature = "std"), feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler))] +#![cfg_attr( + not(feature = "std"), + feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler) +)] // Make the WASM binary available. #[cfg(feature = "std")] diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 82a5e7ca2e03..1c549da94279 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -17,7 +17,6 @@ //! Polkadot types shared between the runtime and the Node-side code. #![warn(missing_docs)] - #![cfg_attr(not(feature = "std"), no_std)] pub mod v0; diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index 1e38306550dd..65cc42de3e93 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -23,8 +23,10 @@ xcm = { path = "..", default-features = false, optional = true } pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } sp-core = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } sp-io = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } +sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } xcm-builder = { path = "../xcm-builder" } xcm = { path = ".." } +log = "0.4.0" [features] default = ["std"] diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index b9bb2b0effc4..056feee2699a 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -18,32 +18,109 @@ #![cfg(feature = "runtime-benchmarks")] use crate::*; +use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_support::{assert_ok, traits::fungible::Inspect, weights::Weight}; +use sp_std::convert::TryInto; use xcm::{ - opaque::v0::{ExecuteXcm, MultiLocation}, - v0::Order, + opaque::v0::{ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, + v0::{Error as XcmError, Order, Outcome, Xcm}, }; +use xcm_executor::{traits::TransactAsset, Assets}; /// The xcm executor to use for doing stuff. pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; -// TODO: might be better to just accept the outer call directly. +/// The asset transactor of our executor +pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Config>::AssetTransactor; +/// The overarching call type. pub type OverArchingCallOf = ::Call; +/// The call type of executor's config. Should eventually resolve to the same overarching call type. +pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call; + +// TODO: def. needs to be become a config, might also want to use bounded vec. +const MAX_ASSETS: u32 = 25; +const SEED: u32 = 0; + +/// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single +/// order. +fn execute_order( + origin: MultiLocation, + mut holding: Assets, + order: Order>, +) -> Result { + ExecutorOf::::do_execute_effects(&origin, &mut holding, order) +} + +/// Execute an xcm. +fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> Outcome { + ExecutorOf::::execute_xcm(origin, xcm, 999_999) // TODO: what should be the weight be? +} + +fn account(index: u32) -> T::AccountId { + frame_benchmarking::account::("account", index, SEED) +} + +/// Build a multi-location from an account id. +fn account_id_junction(index: u32) -> Junction { + let account = account::(index); + let mut encoded = account.encode(); + encoded.resize(32, 0u8); + let mut id = [0u8; 32]; + id.copy_from_slice(&encoded); + Junction::AccountId32 { network: NetworkId::Any, id } +} benchmarks! { - where_clause { - where T::XcmConfig: xcm_executor::Config> + where_clause { where + T::XcmConfig: xcm_executor::Config>, + < + < + ::TransactAssetAdapter + as + frame_support::traits::fungible::Inspect< + ::AccountId> + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, } + + // a xcm-send operation. This is useful for effects of an order. + send_xcm {}: {} + // orders. - order_null {}: {} verify {} + order_null { + let order = Order::>::Null; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = Assets::default(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } + order_deposit_asset { + let a in 1..MAX_ASSETS; + + let amount = T::TransactAssetAdapter::minimum_balance() * 4u32.into(); + let amount128: u128 = amount.try_into().unwrap(); + + let assets = (0..a).map(|_| + MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 } + ).collect::>(); + let order = Order::>::DepositAsset { - assets: vec![], - dest: MultiLocation::Null, + assets, + dest: MultiLocation::X1(account_id_junction::(77)), }; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding: Assets = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 * a as u128 }.into(); }: { - ExecutorOf::::execute_order(order) - } verify {} - + assert_ok!(execute_order::(origin, holding, order)); + } verify { + assert_eq!( + T::TransactAssetAdapter::balance(&account::(77)), + amount * a.into() + ) + } order_deposit_reserved_asset {}: {} verify {} order_exchange_asset {}: {} verify {} order_initiate_reserve_withdraw {}: {} verify {} @@ -56,7 +133,30 @@ benchmarks! { xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_query_response {}: {} verify {} - xcm_transfer_asset {}: {} verify {} + xcm_transfer_asset { + let a in 1..MAX_ASSETS; + + let amount = T::TransactAssetAdapter::minimum_balance() * 4u32.into(); + let amount128: u128 = amount.try_into().unwrap(); + let origin: MultiLocation = (account_id_junction::(1)).into(); + + let assets = (0..a).map(|_| { + let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 }; + // give some assets to 1 in the meantime as well. + >::deposit_asset(&asset, &origin).unwrap(); + asset + }).collect::>(); + + let dest = (account_id_junction::(2)).into(); + let xcm = Xcm::TransferAsset { assets, dest }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + assert_eq!( + T::TransactAssetAdapter::balance(&account::(2)), + amount * a.into(), + ) + } xcm_transfer_reserved_asset {}: {} verify {} xcm_transact {}: {} verify {} xcm_hrmp_channel_open_request {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 5238c351873b..374b4b72b270 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -38,6 +38,11 @@ pub mod pallet { /// These might affect the execution of XCM messages, such as defining how the /// `TransactAsset` is implemented. type XcmConfig: xcm_executor::Config; + + /// Direct access to whoever is being the implementor `TransactAsset`'s adapter. + /// + /// Usually should be an instance of balances or assets/uniques pallet. + type TransactAssetAdapter: frame_support::traits::fungible::Inspect; } #[pallet::pallet] diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index e9910c0b1b62..90961b5c7921 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -76,7 +76,7 @@ impl frame_system::Config for Test { } parameter_types! { - pub const ExistentialDeposit: u64 = 1; + pub const ExistentialDeposit: u64 = 7; } impl pallet_balances::Config for Test { @@ -118,18 +118,26 @@ parameter_types! { pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Null, 1_000_000_000_000); } -pub struct TestMatcher; -impl xcm_executor::traits::MatchesFungible for TestMatcher { - fn matches_fungible(_: &MultiAsset) -> Option { - // TODO - None +// TODO: maybe just use IsConcrete +pub struct MatchAnyFungible; +impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { + fn matches_fungible(m: &MultiAsset) -> Option { + use sp_runtime::traits::SaturatedConversion; + match m { + MultiAsset::ConcreteFungible { amount, .. } => Some((*amount).saturated_into::()), + _ => None, + } } } pub struct AccountIdConverter; impl xcm_executor::traits::Convert for AccountIdConverter { fn convert(ml: MultiLocation) -> Result { - Err(ml) + match ml { + MultiLocation::X1(Junction::AccountId32 { id, .. }) => + Ok(::decode(&mut &*id.to_vec()).unwrap()), + _ => Err(ml), + } } fn reverse(acc: u64) -> Result { @@ -138,8 +146,26 @@ impl xcm_executor::traits::Convert for AccountIdConverter { } // Use balances as the asset transactor. -pub type AssetTransactor = - xcm_builder::CurrencyAdapter; +pub type AssetTransactor = xcm_builder::CurrencyAdapter< + Balances, + MatchAnyFungible, + AccountIdConverter, + u64, + CheckedAccount, +>; + +pub struct YesItShould(sp_std::marker::PhantomData); +impl xcm_executor::traits::ShouldExecute for YesItShould { + fn should_execute( + _: &MultiLocation, + _: bool, + _: &xcm::v0::Xcm, + _: Weight, + _: &mut Weight, + ) -> Result<(), ()> { + Ok(()) + } +} pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { @@ -150,7 +176,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); // TODO: type IsTeleporter = (); // no one can teleport. type LocationInverter = xcm_builder::LocationInverter; - type Barrier = (); // No barriers -- everything is allowed. + type Barrier = YesItShould; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfConcreteFungible; type ResponseHandler = DevNull; @@ -158,11 +184,13 @@ impl xcm_executor::Config for XcmConfig { impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; + type TransactAssetAdapter = Balances; } // This function basically just builds a genesis storage key/value store according to // our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); t.into() } diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 2cba092cc2f9..9a01f227e766 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -162,10 +162,6 @@ pub trait ExecuteXcm { weight_limit: Weight, weight_credit: Weight, ) -> Outcome; - - /// Execute just an order. This is only used in benchmarks. - #[cfg(feature = "runtime-benchmarks")] - fn execute_order(_: super::Order) {} } impl ExecuteXcm for () { diff --git a/xcm/xcm-builder/Cargo.toml b/xcm/xcm-builder/Cargo.toml index 7cda682d4b30..73975fab4928 100644 --- a/xcm/xcm-builder/Cargo.toml +++ b/xcm/xcm-builder/Cargo.toml @@ -17,16 +17,17 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +log = { version = "0.4.0", default-features = false } # Polkadot dependencies polkadot-parachain = { path = "../../parachain", default-features = false } [features] default = ["std"] -runtime-benchmarks = [] std = [ "parity-scale-codec/std", "xcm/std", + "log/std", "xcm-executor/std", "sp-std/std", "sp-arithmetic/std", @@ -36,3 +37,6 @@ std = [ "polkadot-parachain/std", "pallet-transaction-payment/std", ] +runtime-benchmarks = [ + "xcm-executor/runtime-benchmarks", +] diff --git a/xcm/xcm-builder/src/currency_adapter.rs b/xcm/xcm-builder/src/currency_adapter.rs index 744835f08959..329e8dca2175 100644 --- a/xcm/xcm-builder/src/currency_adapter.rs +++ b/xcm/xcm-builder/src/currency_adapter.rs @@ -85,16 +85,20 @@ pub struct CurrencyAdapter, - AccountIdConverter: Convert, - Currency: frame_support::traits::Currency, - AccountId: Clone, // can't get away without it since Currency is generic over it. - CheckedAccount: Get>, -> TransactAsset for CurrencyAdapter { + Matcher: MatchesFungible, + AccountIdConverter: Convert, + Currency: frame_support::traits::Currency, + AccountId: Clone, // can't get away without it since Currency is generic over it. + CheckedAccount: Get>, + > TransactAsset + for CurrencyAdapter +where + >::Balance: Into, +{ fn can_check_in(_origin: &MultiLocation, what: &MultiAsset) -> Result { // Check we handle this asset. - let amount: Currency::Balance = Matcher::matches_fungible(what) - .ok_or(Error::AssetNotFound)?; + let amount: Currency::Balance = + Matcher::matches_fungible(what).ok_or(Error::AssetNotFound)?; if let Some(checked_account) = CheckedAccount::get() { let new_balance = Currency::free_balance(&checked_account) .checked_sub(&amount) @@ -123,10 +127,10 @@ impl< } fn deposit_asset(what: &MultiAsset, who: &MultiLocation) -> Result { + log::trace!("xcm::currency_adapter deposit_asset {:?} {:?}", what, who); // Check we handle this asset. - let amount: u128 = Matcher::matches_fungible(&what) - .ok_or(Error::AssetNotFound)? - .saturated_into(); + let amount: u128 = + Matcher::matches_fungible(&what).ok_or(Error::AssetNotFound)?.saturated_into(); let who = AccountIdConverter::convert_ref(who) .map_err(|()| Error::AccountIdConversionFailed)?; let balance_amount = amount @@ -136,14 +140,10 @@ impl< Ok(()) } - fn withdraw_asset( - what: &MultiAsset, - who: &MultiLocation - ) -> result::Result { + fn withdraw_asset(what: &MultiAsset, who: &MultiLocation) -> result::Result { // Check we handle this asset. - let amount: u128 = Matcher::matches_fungible(what) - .ok_or(Error::AssetNotFound)? - .saturated_into(); + let amount: u128 = + Matcher::matches_fungible(what).ok_or(Error::AssetNotFound)?.saturated_into(); let who = AccountIdConverter::convert_ref(who) .map_err(|()| Error::AccountIdConversionFailed)?; let balance_amount = amount diff --git a/xcm/xcm-executor/Cargo.toml b/xcm/xcm-executor/Cargo.toml index 3ff04c530486..5bd6eabd433a 100644 --- a/xcm/xcm-executor/Cargo.toml +++ b/xcm/xcm-executor/Cargo.toml @@ -30,3 +30,4 @@ std = [ "frame-support/std", "log/std", ] +runtime-benchmarks = [] diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index d9715e4a44e7..505bccce11e1 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -300,8 +300,21 @@ impl XcmExecutor { } holding.saturating_subsume(trader.refund_weight(remaining_weight)); } + Order::Null => { + // nada + } _ => return Err(XcmError::UnhandledEffect)?, } Ok(total_surplus) } + + #[cfg(feature = "runtime-benchmarks")] + pub fn do_execute_effects( + origin: &MultiLocation, + holding: &mut Assets, + effect: Order, + ) -> Result { + let mut trader = Config::Trader::new(); + Self::execute_effects(origin, holding, effect, &mut trader) + } } diff --git a/xcm/xcm-executor/src/traits/transact_asset.rs b/xcm/xcm-executor/src/traits/transact_asset.rs index a967f1f6909a..cec6bce1c6ff 100644 --- a/xcm/xcm-executor/src/traits/transact_asset.rs +++ b/xcm/xcm-executor/src/traits/transact_asset.rs @@ -85,7 +85,11 @@ pub trait TransactAsset { /// Move an `asset` `from` one location in `to` another location. /// /// Attempts to use `transfer_asset` and if not available then falls back to using a two-part withdraw/deposit. - fn teleport_asset(asset: &MultiAsset, from: &MultiLocation, to: &MultiLocation) -> Result { + fn teleport_asset( + asset: &MultiAsset, + from: &MultiLocation, + to: &MultiLocation, + ) -> Result { match Self::transfer_asset(asset, from, to) { Err(XcmError::Unimplemented) => { let assets = Self::withdraw_asset(asset, from)?; @@ -244,29 +248,33 @@ mod tests { #[test] fn defaults_to_asset_not_found() { - type MultiTransactor = (UnimplementedTransactor, NotFoundTransactor, UnimplementedTransactor); - - assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Err(XcmError::AssetNotFound)); + type MultiTransactor = + (UnimplementedTransactor, NotFoundTransactor, UnimplementedTransactor); + assert_eq!( + MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), + Err(XcmError::AssetNotFound), + ); } #[test] fn unimplemented_and_not_found_continue_iteration() { type MultiTransactor = (UnimplementedTransactor, NotFoundTransactor, SuccessfulTransactor); - - assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Ok(())); + assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Ok(()),); } #[test] fn unexpected_error_stops_iteration() { type MultiTransactor = (OverflowTransactor, SuccessfulTransactor); - - assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Err(XcmError::Overflow)); + assert_eq!( + MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), + Err(XcmError::Overflow), + ); } #[test] fn success_stops_iteration() { type MultiTransactor = (SuccessfulTransactor, OverflowTransactor); - assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Ok(())); + assert_eq!(MultiTransactor::deposit_asset(&MultiAsset::All, &MultiLocation::Null), Ok(()),); } } From 1dc11daa0789262fada09b97f4c03ec5c1d15196 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sat, 31 Jul 2021 19:24:25 +0200 Subject: [PATCH 05/63] Build is broken --- Cargo.lock | 352 ++++++++++-------- runtime/westend/Cargo.toml | 3 +- runtime/westend/src/lib.rs | 53 ++- xcm/pallet-xcm-benchmarks/Cargo.toml | 1 + xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 141 +++++-- xcm/pallet-xcm-benchmarks/src/lib.rs | 4 +- xcm/pallet-xcm-benchmarks/src/mock.rs | 28 +- 7 files changed, 372 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f52c891f897..1f22e8826369 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1997,7 +1997,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", ] @@ -2015,7 +2015,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -2034,7 +2034,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "Inflector", "chrono", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -2071,7 +2071,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -2086,7 +2086,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "serde", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "bitflags", "frame-metadata", @@ -2123,7 +2123,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2135,7 +2135,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2147,7 +2147,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro2", "quote", @@ -2157,7 +2157,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-metadata", "frame-support", @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -2188,7 +2188,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -2205,7 +2205,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -2219,7 +2219,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-api", @@ -2228,7 +2228,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "parity-scale-codec", @@ -4699,10 +4699,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -4717,7 +4730,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -4731,7 +4744,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4754,7 +4767,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4807,7 +4820,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4885,7 +4898,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4901,7 +4914,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4916,7 +4929,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4937,7 +4950,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4954,7 +4967,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4968,7 +4981,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -4990,7 +5003,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5005,7 +5018,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5024,7 +5037,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5040,7 +5053,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5055,7 +5068,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5072,7 +5085,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5088,7 +5101,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5106,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5121,7 +5134,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5134,7 +5147,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5150,7 +5163,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5172,7 +5185,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5187,7 +5200,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "enumflags2", "frame-support", @@ -5201,7 +5214,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5216,7 +5229,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5236,7 +5249,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5252,7 +5265,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5265,7 +5278,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5289,7 +5302,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5300,7 +5313,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "sp-arithmetic", @@ -5309,7 +5322,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5322,7 +5335,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5340,7 +5353,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5355,7 +5368,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-support", "frame-system", @@ -5371,7 +5384,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5388,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5399,7 +5412,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5415,7 +5428,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-benchmarking", "frame-support", @@ -5430,7 +5443,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5464,6 +5477,7 @@ dependencies = [ "frame-support", "frame-system", "log", + "pallet-assets", "pallet-balances", "parity-scale-codec", "sp-core", @@ -7507,9 +7521,9 @@ checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" dependencies = [ "unicode-xid", ] @@ -7940,7 +7954,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "env_logger 0.8.4", "hex", @@ -8239,7 +8253,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "sp-core", @@ -8250,7 +8264,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "derive_more", @@ -8279,7 +8293,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "futures-timer 3.0.2", @@ -8302,7 +8316,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8318,7 +8332,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8338,7 +8352,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8349,7 +8363,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "chrono", "fdlimit", @@ -8387,7 +8401,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "fnv", @@ -8421,7 +8435,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "blake2-rfc", "hash-db", @@ -8439,7 +8453,6 @@ dependencies = [ "sc-state-db", "sp-arithmetic", "sp-blockchain", - "sp-consensus", "sp-core", "sp-database", "sp-runtime", @@ -8451,20 +8464,32 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", + "futures 0.3.15", + "futures-timer 3.0.2", + "libp2p", + "log", "parking_lot 0.11.1", "sc-client-api", + "serde", + "sp-api", "sp-blockchain", "sp-consensus", + "sp-core", "sp-runtime", + "sp-state-machine", + "sp-utils", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", ] [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "derive_more", @@ -8482,6 +8507,7 @@ dependencies = [ "rand 0.7.3", "retain_mut", "sc-client-api", + "sc-consensus", "sc-consensus-epochs", "sc-consensus-slots", "sc-consensus-uncles", @@ -8510,7 +8536,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "futures 0.3.15", @@ -8534,7 +8560,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8547,7 +8573,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "assert_matches", "async-trait", @@ -8560,6 +8586,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", "sc-client-api", + "sc-consensus", "sc-consensus-babe", "sc-consensus-epochs", "sc-transaction-pool", @@ -8582,7 +8609,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "futures 0.3.15", @@ -8591,6 +8618,7 @@ dependencies = [ "log", "parity-scale-codec", "sc-client-api", + "sc-consensus", "sc-telemetry", "sp-api", "sp-application-crypto", @@ -8610,7 +8638,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "sc-client-api", "sp-authorship", @@ -8621,7 +8649,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "lazy_static", @@ -8650,7 +8678,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "parity-scale-codec", @@ -8667,7 +8695,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "parity-scale-codec", @@ -8682,7 +8710,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8702,7 +8730,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "derive_more", @@ -8743,7 +8771,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "finality-grandpa", @@ -8767,7 +8795,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "futures 0.3.15", @@ -8788,7 +8816,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "ansi_term 0.12.1", "futures 0.3.15", @@ -8806,7 +8834,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "derive_more", @@ -8826,7 +8854,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "hash-db", "lazy_static", @@ -8845,7 +8873,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-std", "async-trait", @@ -8877,6 +8905,7 @@ dependencies = [ "rand 0.7.3", "sc-block-builder", "sc-client-api", + "sc-consensus", "sc-peerset", "serde", "serde_json", @@ -8898,7 +8927,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "futures-timer 3.0.2", @@ -8915,7 +8944,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "bytes 0.5.6", "fnv", @@ -8943,7 +8972,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "libp2p", @@ -8956,7 +8985,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8965,7 +8994,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "hash-db", @@ -9000,7 +9029,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "futures 0.3.15", @@ -9025,7 +9054,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -9043,7 +9072,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "directories", @@ -9065,6 +9094,7 @@ dependencies = [ "sc-chain-spec", "sc-client-api", "sc-client-db", + "sc-consensus", "sc-executor", "sc-informant", "sc-keystore", @@ -9110,7 +9140,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "parity-scale-codec", @@ -9125,7 +9155,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9145,7 +9175,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "chrono", "futures 0.3.15", @@ -9165,7 +9195,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "ansi_term 0.12.1", "atty", @@ -9202,7 +9232,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9213,7 +9243,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "futures 0.3.15", @@ -9242,7 +9272,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "derive_more", "futures 0.3.15", @@ -9684,7 +9714,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "hash-db", "log", @@ -9701,7 +9731,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9713,7 +9743,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "serde", @@ -9725,7 +9755,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "integer-sqrt", "num-traits", @@ -9739,7 +9769,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-api", @@ -9751,7 +9781,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "parity-scale-codec", @@ -9763,7 +9793,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-api", @@ -9775,7 +9805,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "log", @@ -9793,12 +9823,11 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "futures 0.3.15", "futures-timer 3.0.2", - "libp2p", "log", "parity-scale-codec", "parking_lot 0.11.1", @@ -9820,7 +9849,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "merlin", @@ -9842,7 +9871,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9852,7 +9881,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9864,7 +9893,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "base58", "blake2-rfc", @@ -9908,7 +9937,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9917,7 +9946,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro2", "quote", @@ -9927,7 +9956,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "environmental", "parity-scale-codec", @@ -9938,7 +9967,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "finality-grandpa", "log", @@ -9955,7 +9984,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9969,7 +9998,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "hash-db", @@ -9994,7 +10023,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "lazy_static", "sp-core", @@ -10005,7 +10034,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "derive_more", @@ -10022,7 +10051,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "ruzstd", "zstd", @@ -10031,7 +10060,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "serde", @@ -10044,7 +10073,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -10055,7 +10084,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "sp-api", "sp-core", @@ -10065,7 +10094,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "backtrace", ] @@ -10073,7 +10102,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "rustc-hash", "serde", @@ -10084,7 +10113,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "either", "hash256-std-hasher", @@ -10105,7 +10134,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10122,7 +10151,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -10134,7 +10163,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "serde", "serde_json", @@ -10143,7 +10172,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-api", @@ -10156,7 +10185,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -10166,7 +10195,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "hash-db", "log", @@ -10189,12 +10218,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10207,7 +10236,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "log", "sp-core", @@ -10220,7 +10249,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -10237,7 +10266,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "erased-serde", "log", @@ -10255,7 +10284,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "sp-api", "sp-runtime", @@ -10264,7 +10293,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "log", @@ -10279,7 +10308,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "hash-db", "memory-db", @@ -10293,7 +10322,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "futures-core", @@ -10305,7 +10334,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10320,7 +10349,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "parity-scale-codec", "proc-macro-crate 1.0.0", @@ -10332,7 +10361,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10517,7 +10546,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "chrono", "console_error_panic_hook", @@ -10543,7 +10572,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "platforms", ] @@ -10551,7 +10580,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.15", @@ -10574,7 +10603,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-std", "derive_more", @@ -10588,7 +10617,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "async-trait", "futures 0.1.29", @@ -10617,7 +10646,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "futures 0.3.15", "substrate-test-utils-derive", @@ -10627,7 +10656,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10637,7 +10666,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "ansi_term 0.12.1", "atty", @@ -10799,7 +10828,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-system", "futures 0.3.15", @@ -11438,7 +11467,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#97131a900b954b1f1dd0a826d3889348f1f02b66" +source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" dependencies = [ "frame-try-runtime", "log", @@ -11679,9 +11708,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi 0.3.9", @@ -12122,7 +12151,6 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", - "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 7eb108a849fe..661b712a87c9 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -71,7 +71,7 @@ pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "ma pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false } # TODO: ideally this should also be optional, and everything related to it in the code gated by the # runtime benchmakrs feature, but that's a story for another day. -pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false } +# pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -202,6 +202,7 @@ runtime-benchmarks = [ "frame-system-benchmarking", "hex-literal", "xcm-builder/runtime-benchmarks", + # "pallet-xcm-benchmarks/runtime-benchmarks", "frame-election-provider-support/runtime-benchmarks", ] try-runtime = [ diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index bb3843c84b57..7c81af13f365 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1007,10 +1007,6 @@ impl pallet_xcm::Config for Runtime { type Weigher = FixedWeightBounds; } -impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = XcmConfig; -} - construct_runtime! { pub enum Runtime where Block = Block, @@ -1088,7 +1084,6 @@ construct_runtime! { // Pallet for sending XCM. XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 99, - XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet} = 999, } } @@ -1457,6 +1452,52 @@ sp_api::impl_runtime_apis! { impl pallet_offences_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} + use frame_support::traits::fungible::Inspect as FungibleInspect; + use frame_support::traits::fungibles::Inspect as FungiblesInspect; + use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; + pub struct AsFungibles(sp_std::marker::PhantomData); + /// Trait for providing balance-inspection access to a set of named fungible assets. + + impl> FungiblesInspect for AsFungibles { + type AssetId = u32; + type Balance = Balance; + + fn total_issuance(_: Self::AssetId) -> Self::Balance { + B::total_issuance() + } + fn minimum_balance(_: Self::AssetId) -> Self::Balance { + B::minimum_balance() + } + fn balance(_: Self::AssetId, who: &AccountId) -> Self::Balance { + B::balance(who) + } + fn reducible_balance(_: Self::AssetId, who: &AccountId, keep_alive: bool) -> Self::Balance { + B::reducible_balance(who, keep_alive) + } + fn can_deposit( + _: Self::AssetId, + who: &AccountId, + amount: Self::Balance, + ) -> DepositConsequence { + B::can_deposit(who, amount) + } + + fn can_withdraw( + _: Self::AssetId, + who: &AccountId, + amount: Self::Balance, + ) -> WithdrawConsequence { + B::can_withdraw(who, amount) + } + } + + // impl pallet_xcm_benchmarks::Config for Runtime { + // type XcmConfig = XcmConfig; + // type FungibleTransactAsset = Balances; + // type FungiblesTransactAsset = AsFungibles; + // } + // type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::; + let whitelist: Vec = vec![ // Block Number hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), @@ -1498,7 +1539,7 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_vesting, Vesting); - add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); + // add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } let storage_info = AllPalletsWithSystem::storage_info(); diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index 65cc42de3e93..f294a268d37f 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -21,6 +21,7 @@ xcm = { path = "..", default-features = false, optional = true } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } +pallet-assets = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } sp-core = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } sp-io = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index 056feee2699a..bdcc9f60c28b 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -15,13 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![cfg(feature = "runtime-benchmarks")] - use crate::*; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{assert_ok, traits::fungible::Inspect, weights::Weight}; -use sp_std::convert::TryInto; +use frame_support::{assert_ok, traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, weights::Weight}; +use sp_std::{vec, convert::TryInto, prelude::*}; use xcm::{ opaque::v0::{ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, v0::{Error as XcmError, Order, Outcome, Xcm}, @@ -73,13 +71,22 @@ fn account_id_junction(index: u32) -> Junction { benchmarks! { where_clause { where T::XcmConfig: xcm_executor::Config>, + >::AssetId: From, < < - ::TransactAssetAdapter + ::FungibleTransactAsset as - frame_support::traits::fungible::Inspect< - ::AccountId> - >::Balance + FungibleInspect<::AccountId> + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + < + < + ::FungiblesTransactAsset + as + FungiblesInspect<::AccountId> + >::Balance as TryInto >::Error: sp_std::fmt::Debug, @@ -97,54 +104,110 @@ benchmarks! { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset { - let a in 1..MAX_ASSETS; - - let amount = T::TransactAssetAdapter::minimum_balance() * 4u32.into(); - let amount128: u128 = amount.try_into().unwrap(); + order_deposit_asset_fungible { + let amount_balance = T::FungibleTransactAsset::minimum_balance() * 4u32.into(); + let amount: u128 = amount_balance.try_into().unwrap(); - let assets = (0..a).map(|_| - MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 } - ).collect::>(); + let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount }; let order = Order::>::DepositAsset { - assets, + assets: vec![asset], dest: MultiLocation::X1(account_id_junction::(77)), }; let origin = MultiLocation::X1(account_id_junction::(1)); - let holding: Assets = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 * a as u128 }.into(); + let holding: Assets = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }.into(); }: { assert_ok!(execute_order::(origin, holding, order)); } verify { assert_eq!( - T::TransactAssetAdapter::balance(&account::(77)), - amount * a.into() + T::FungibleTransactAsset::balance(&account::(77)), + amount_balance ) } - order_deposit_reserved_asset {}: {} verify {} - order_exchange_asset {}: {} verify {} - order_initiate_reserve_withdraw {}: {} verify {} - order_initiate_teleport {}: {} verify {} - order_query_holding {}: {} verify {} - order_buy_execution {}: {} verify {} + order_deposit_asset_fungibles { + let a in 1..MAX_ASSETS; + + let assets = (0..a).map(|_| { + let amount_balance = T::FungiblesTransactAsset::minimum_balance(a.into()) * 4u32.into(); + let amount: u128 = amount_balance.try_into().unwrap(); + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: a as u128 }), + amount, + } + }).collect::>(); + + let order = Order::>::DepositAsset { + assets: assets.clone(), + dest: MultiLocation::X1(account_id_junction::(77)), + }; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding: Assets = assets.into(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + for asset_id in 0..a { + assert_eq!( + T::FungiblesTransactAsset::balance(asset_id.into(), &account::(77)), + T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), + ) + } + } + + order_deposit_reserved_asset_fungible {}: {} verify {} + order_deposit_reserved_asset_fungibles {}: {} verify {} + + order_exchange_asset_fungible {}: {} verify {} + order_exchange_asset_fungibles {}: {} verify {} + + order_initiate_reserve_withdraw_fungible {}: {} verify {} + order_initiate_reserve_withdraw_fungibles {}: {} verify {} + + order_initiate_teleport_fungible {}: {} verify {} + order_initiate_teleport_fungibles {}: {} verify {} + + order_query_holding_fungible {}: {} verify {} + order_query_holding_fungibles {}: {} verify {} + + order_buy_execution_fungible {}: {} verify {} + order_buy_execution_fungibles {}: {} verify {} // base XCM messages. xcm_withdraw_asset {}: {} verify {} xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_query_response {}: {} verify {} - xcm_transfer_asset { - let a in 1..MAX_ASSETS; + xcm_transfer_asset_fungible { + let amount_balance = T::FungibleTransactAsset::minimum_balance() * 4u32.into(); + let amount: u128 = amount_balance.try_into().unwrap(); - let amount = T::TransactAssetAdapter::minimum_balance() * 4u32.into(); - let amount128: u128 = amount.try_into().unwrap(); + let origin: MultiLocation = (account_id_junction::(1)).into(); + let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }; + >::deposit_asset(&asset, &origin).unwrap(); + + let dest = (account_id_junction::(2)).into(); + let assets = vec![ asset ]; + let xcm = Xcm::TransferAsset { assets, dest }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + assert_eq!( + T::FungibleTransactAsset::balance(&account::(2)), + amount_balance, + ) + } + xcm_transfer_asset_fungibles { + let a in 1..MAX_ASSETS; + // TODO: incorporate Gav's note on the fact that the type of asset in the holding will affect the worse + // case. let origin: MultiLocation = (account_id_junction::(1)).into(); let assets = (0..a).map(|_| { - let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount128 }; - // give some assets to 1 in the meantime as well. - >::deposit_asset(&asset, &origin).unwrap(); - asset + let amount_balance = T::FungiblesTransactAsset::minimum_balance(a.into()) * 4u32.into(); + let amount: u128 = amount_balance.try_into().unwrap(); + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: a as u128 }), + amount, + } }).collect::>(); let dest = (account_id_junction::(2)).into(); @@ -152,10 +215,12 @@ benchmarks! { }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { - assert_eq!( - T::TransactAssetAdapter::balance(&account::(2)), - amount * a.into(), - ) + for asset_id in 0..a { + assert_eq!( + T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)), + T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), + ) + } } xcm_transfer_reserved_asset {}: {} verify {} xcm_transact {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 374b4b72b270..6575b2fb7baf 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -17,7 +17,6 @@ //! Pallet that serves no other purpose than benchmarking raw messages [`Xcm`]. -// Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; @@ -42,7 +41,8 @@ pub mod pallet { /// Direct access to whoever is being the implementor `TransactAsset`'s adapter. /// /// Usually should be an instance of balances or assets/uniques pallet. - type TransactAssetAdapter: frame_support::traits::fungible::Inspect; + type FungibleTransactAsset: frame_support::traits::fungible::Inspect; + type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; } #[pallet::pallet] diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 90961b5c7921..9700b4f6dfc1 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -40,6 +40,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Assets: pallet_assets::{Pallet, Call, Storage, Event}, XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, } ); @@ -91,6 +92,30 @@ impl pallet_balances::Config for Test { type WeightInfo = (); } +parameter_types! { + pub const AssetDeposit: u64 = 100 * ExistentialDeposit::get(); + pub const ApprovalDeposit: u64 = 1 * ExistentialDeposit::get(); + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 10 * ExistentialDeposit::get(); + pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); +} + +impl pallet_assets::Config for Test { + type Event = Event; + type Balance = u64; + type AssetId = u32; + type Currency = Balances; + type ForceOrigin = frame_system::EnsureRoot; + type AssetDeposit = AssetDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; + type Freezer = (); + type Extra = (); + type WeightInfo = (); +} + use frame_support::weights::Weight; use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; @@ -184,7 +209,8 @@ impl xcm_executor::Config for XcmConfig { impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; - type TransactAssetAdapter = Balances; + type FungibleTransactAsset = Balances; + type FungiblesTransactAsset = Assets; } // This function basically just builds a genesis storage key/value store according to From cb91ac65d99ff7144f19b4f9523d4e3d992f8d41 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sat, 31 Jul 2021 20:29:34 +0200 Subject: [PATCH 06/63] make westend work again --- Cargo.lock | 1 + runtime/westend/Cargo.toml | 6 ++---- runtime/westend/src/lib.rs | 14 +++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ec60a4dee3c..1fde5a0474db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12152,6 +12152,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 661b712a87c9..7c590c469915 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -69,9 +69,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false } -# TODO: ideally this should also be optional, and everything related to it in the code gated by the -# runtime benchmakrs feature, but that's a story for another day. -# pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true } +pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -202,7 +200,7 @@ runtime-benchmarks = [ "frame-system-benchmarking", "hex-literal", "xcm-builder/runtime-benchmarks", - # "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", "frame-election-provider-support/runtime-benchmarks", ] try-runtime = [ diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 8f9cb5a5d9c8..46ba562af404 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1491,12 +1491,12 @@ sp_api::impl_runtime_apis! { } } - // impl pallet_xcm_benchmarks::Config for Runtime { - // type XcmConfig = XcmConfig; - // type FungibleTransactAsset = Balances; - // type FungiblesTransactAsset = AsFungibles; - // } - // type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::; + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = XcmConfig; + type FungibleTransactAsset = Balances; + type FungiblesTransactAsset = AsFungibles; + } + type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::; let whitelist: Vec = vec![ // Block Number @@ -1539,7 +1539,7 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_vesting, Vesting); - // add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); + add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } let storage_info = AllPalletsWithSystem::storage_info(); From 5b3374926ea787b124181a62427fa2cdf9dfaf78 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 31 Jul 2021 20:40:48 +0200 Subject: [PATCH 07/63] mock weight generation --- runtime/kusama/src/weights/mod.rs | 2 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 2 +- xcm/pallet-xcm-benchmarks/src/weights.rs | 167 +++++++++++++++++++++++ xcm/src/v0/mod.rs | 118 +++++++++------- xcm/src/v0/order.rs | 52 ++++--- xcm/xcm-builder/src/weight.rs | 122 ++++++++++------- xcm/xcm-executor/src/traits/weight.rs | 15 +- 7 files changed, 352 insertions(+), 126 deletions(-) create mode 100644 xcm/pallet-xcm-benchmarks/src/weights.rs diff --git a/runtime/kusama/src/weights/mod.rs b/runtime/kusama/src/weights/mod.rs index a83b57bfcdf8..ebe810d62907 100644 --- a/runtime/kusama/src/weights/mod.rs +++ b/runtime/kusama/src/weights/mod.rs @@ -20,8 +20,8 @@ pub mod pallet_balances; pub mod pallet_bounties; pub mod pallet_collective; pub mod pallet_democracy; -pub mod pallet_elections_phragmen; pub mod pallet_election_provider_multi_phase; +pub mod pallet_elections_phragmen; pub mod pallet_gilt; pub mod pallet_identity; pub mod pallet_im_online; diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 374b4b72b270..9450f83b9ceb 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -26,7 +26,7 @@ pub use pallet::*; mod mock; mod benchmarking; -// pub mod weights; +pub mod weights; // pub use weights::*; #[frame_support::pallet] diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs new file mode 100644 index 000000000000..ab3c160d05ce --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/weights.rs @@ -0,0 +1,167 @@ +// This file is part of Substrate. + +// Copyright (C) 21019-21021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.10 + +// Licensed under the Apache License, Version 2.10 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.10 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use frame_support::pallet_prelude::*; +use sp_runtime::traits::Saturating; +use xcm::v0::{Order, Xcm}; +use xcm_executor::traits::WeightBounds; + +pub trait WeightInfo { + fn send_xcm() -> Weight; + fn order_null() -> Weight; + fn order_deposit_asset() -> Weight; + fn order_deposit_reserved_asset() -> Weight; + fn order_exchange_asset() -> Weight; + fn order_initiate_reserve_withdraw() -> Weight; + fn order_initiate_teleport() -> Weight; + fn order_query_holding() -> Weight; + fn order_buy_execution() -> Weight; + fn xcm_withdraw_asset() -> Weight; + fn xcm_reserve_asset_deposit() -> Weight; + fn xcm_teleport_asset() -> Weight; + fn xcm_query_response() -> Weight; + fn xcm_transfer_asset() -> Weight; + fn xcm_transfer_reserved_asset() -> Weight; + fn xcm_transact() -> Weight; + fn xcm_hrmp_channel_open_request() -> Weight; + fn xcm_hrmp_channel_accepted() -> Weight; + fn xcm_hrmp_channel_closing() -> Weight; + fn xcm_relayed_from() -> Weight; +} + +pub struct XcmWeight(PhantomData); +impl WeightInfo for XcmWeight { + fn send_xcm() -> Weight { + 10 + } + fn order_null() -> Weight { + 10 + } + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw() -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset() -> Weight { + 10 + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } + fn xcm_transact() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + 10 + } + fn xcm_hrmp_channel_accepted() -> Weight { + 10 + } + fn xcm_hrmp_channel_closing() -> Weight { + 10 + } + fn xcm_relayed_from() -> Weight { + 10 + } +} + +struct FinalXcmWeight(PhantomData<(W, Call)>); +impl WeightBounds for FinalXcmWeight { + const MAX_WEIGHT: Weight = 1_000_000; + + fn shallow(message: &mut Xcm) -> Result { + let mut weight = 0; + let xcm_weight = Self::xcm_weight(message)?; + weight.saturating_accrue(xcm_weight); + let effects = message.effects(); + let effects_weight = Self::effects_weight(effects)?; + weight.saturating_accrue(effects_weight); + Ok(weight) + } + + fn deep(_message: &mut Xcm) -> Result { + Err(()) // implement this + } +} + +impl FinalXcmWeight { + fn xcm_weight(message: &mut Xcm) -> Result { + let weight = match message { + Xcm::WithdrawAsset { .. } => W::xcm_withdraw_asset(), + Xcm::ReserveAssetDeposit { .. } => W::xcm_reserve_asset_deposit(), + Xcm::TeleportAsset { .. } => W::xcm_teleport_asset(), + Xcm::QueryResponse { .. } => W::xcm_query_response(), + Xcm::TransferAsset { .. } => W::xcm_transfer_asset(), + Xcm::TransferReserveAsset { .. } => W::xcm_transfer_reserved_asset(), + Xcm::Transact { .. } => W::xcm_transact(), + Xcm::HrmpNewChannelOpenRequest { .. } => W::xcm_hrmp_channel_open_request(), + Xcm::HrmpChannelAccepted { .. } => W::xcm_hrmp_channel_accepted(), + Xcm::HrmpChannelClosing { .. } => W::xcm_hrmp_channel_closing(), + Xcm::RelayedFrom { .. } => W::xcm_relayed_from(), + }; + Ok(weight) + } + fn effects_weight(effects: &[Order]) -> Result { + let mut weight = 0; + for order in effects { + if weight >= Self::MAX_WEIGHT { + return Err(()) + } + let new_weight = match order { + Order::Null => W::order_null(), + Order::DepositAsset { .. } => W::order_deposit_asset(), + Order::DepositReserveAsset { .. } => W::order_deposit_reserved_asset(), + Order::ExchangeAsset { .. } => W::order_exchange_asset(), + Order::InitiateReserveWithdraw { .. } => W::order_initiate_reserve_withdraw(), + Order::InitiateTeleport { .. } => W::order_initiate_teleport(), + Order::QueryHolding { .. } => W::order_query_holding(), + Order::BuyExecution { .. } => W::order_buy_execution(), + }; + // TODO loop effects + weight.saturating_accrue(new_weight); + } + Ok(weight) + } +} diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index 05aad9581b05..1a292c67751c 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -16,31 +16,37 @@ //! Version 0 of the Cross-Consensus Message format data structures. -use core::{result, convert::TryFrom, fmt::Debug}; -use derivative::Derivative; +use crate::{DoubleEncoded, VersionedMultiAsset, VersionedXcm}; use alloc::vec::Vec; -use parity_scale_codec::{self, Encode, Decode}; -use crate::{VersionedMultiAsset, DoubleEncoded, VersionedXcm}; +use core::{convert::TryFrom, fmt::Debug, result}; +use derivative::Derivative; +use parity_scale_codec::{self, Decode, Encode}; mod junction; mod multi_asset; mod multi_location; mod order; mod traits; -pub use junction::{Junction, NetworkId, BodyId, BodyPart}; -pub use multi_asset::{MultiAsset, AssetInstance}; +pub use junction::{BodyId, BodyPart, Junction, NetworkId}; +pub use multi_asset::{AssetInstance, MultiAsset}; pub use multi_location::MultiLocation; pub use order::Order; -pub use traits::{Error, Result, SendXcm, ExecuteXcm, Outcome}; +pub use traits::{Error, ExecuteXcm, Outcome, Result, SendXcm}; /// A prelude for importing all types typically used when interacting with XCM messages. pub mod prelude { - pub use super::junction::{Junction::*, NetworkId, BodyId, BodyPart}; - pub use super::multi_asset::{MultiAsset::{self, *}, AssetInstance::{self, *}}; - pub use super::multi_location::MultiLocation::{self, *}; - pub use super::order::Order::{self, *}; - pub use super::traits::{Error as XcmError, Result as XcmResult, SendXcm, ExecuteXcm, Outcome}; - pub use super::{Xcm::{self, *}, OriginKind}; + pub use super::{ + junction::{BodyId, BodyPart, Junction::*, NetworkId}, + multi_asset::{ + AssetInstance::{self, *}, + MultiAsset::{self, *}, + }, + multi_location::MultiLocation::{self, *}, + order::Order::{self, *}, + traits::{Error as XcmError, ExecuteXcm, Outcome, Result as XcmResult, SendXcm}, + OriginKind, + Xcm::{self, *}, + }; } // TODO: #2841 #XCMENCODE Efficient encodings for Vec, Vec, using initial byte values 128+ to encode @@ -147,7 +153,11 @@ pub enum Xcm { /// /// Errors: #[codec(index = 3)] - QueryResponse { #[codec(compact)] query_id: u64, response: Response }, + QueryResponse { + #[codec(compact)] + query_id: u64, + response: Response, + }, /// Withdraw asset(s) (`assets`) from the ownership of `origin` and place equivalent assets under the /// ownership of `dest` within this consensus system. @@ -209,9 +219,12 @@ pub enum Xcm { /// Kind: *System Notification* #[codec(index = 7)] HrmpNewChannelOpenRequest { - #[codec(compact)] sender: u32, - #[codec(compact)] max_message_size: u32, - #[codec(compact)] max_capacity: u32, + #[codec(compact)] + sender: u32, + #[codec(compact)] + max_message_size: u32, + #[codec(compact)] + max_capacity: u32, }, /// A message to notify about that a previously sent open channel request has been accepted by @@ -225,7 +238,8 @@ pub enum Xcm { /// Errors: #[codec(index = 8)] HrmpChannelAccepted { - #[codec(compact)] recipient: u32, + #[codec(compact)] + recipient: u32, }, /// A message to notify that the other party in an open channel decided to close it. In particular, @@ -240,9 +254,12 @@ pub enum Xcm { /// Errors: #[codec(index = 9)] HrmpChannelClosing { - #[codec(compact)] initiator: u32, - #[codec(compact)] sender: u32, - #[codec(compact)] recipient: u32, + #[codec(compact)] + initiator: u32, + #[codec(compact)] + sender: u32, + #[codec(compact)] + recipient: u32, }, /// A message to indicate that the embedded XCM is actually arriving on behalf of some consensus @@ -255,10 +272,7 @@ pub enum Xcm { /// /// Errors: #[codec(index = 10)] - RelayedFrom { - who: MultiLocation, - message: alloc::boxed::Box>, - }, + RelayedFrom { who: MultiLocation, message: alloc::boxed::Box> }, } impl From> for VersionedXcm { @@ -277,32 +291,40 @@ impl TryFrom> for Xcm { } impl Xcm { - pub fn into(self) -> Xcm { Xcm::from(self) } + pub fn into(self) -> Xcm { + Xcm::from(self) + } pub fn from(xcm: Xcm) -> Self { use Xcm::*; match xcm { - WithdrawAsset { assets, effects } - => WithdrawAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, - ReserveAssetDeposit { assets, effects } - => ReserveAssetDeposit { assets, effects: effects.into_iter().map(Order::into).collect() }, - TeleportAsset { assets, effects } - => TeleportAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, - QueryResponse { query_id: u64, response } - => QueryResponse { query_id: u64, response }, - TransferAsset { assets, dest } - => TransferAsset { assets, dest }, - TransferReserveAsset { assets, dest, effects } - => TransferReserveAsset { assets, dest, effects }, - HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity} - => HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity}, - HrmpChannelAccepted { recipient} - => HrmpChannelAccepted { recipient}, - HrmpChannelClosing { initiator, sender, recipient} - => HrmpChannelClosing { initiator, sender, recipient}, - Transact { origin_type, require_weight_at_most, call} - => Transact { origin_type, require_weight_at_most, call: call.into() }, - RelayedFrom { who, message } - => RelayedFrom { who, message: alloc::boxed::Box::new((*message).into()) }, + WithdrawAsset { assets, effects } => + WithdrawAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, + ReserveAssetDeposit { assets, effects } => ReserveAssetDeposit { + assets, + effects: effects.into_iter().map(Order::into).collect(), + }, + TeleportAsset { assets, effects } => + TeleportAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, + QueryResponse { query_id: u64, response } => QueryResponse { query_id: u64, response }, + TransferAsset { assets, dest } => TransferAsset { assets, dest }, + TransferReserveAsset { assets, dest, effects } => + TransferReserveAsset { assets, dest, effects }, + HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity }, + HrmpChannelAccepted { recipient } => HrmpChannelAccepted { recipient }, + HrmpChannelClosing { initiator, sender, recipient } => + HrmpChannelClosing { initiator, sender, recipient }, + Transact { origin_type, require_weight_at_most, call } => + Transact { origin_type, require_weight_at_most, call: call.into() }, + RelayedFrom { who, message } => + RelayedFrom { who, message: alloc::boxed::Box::new((*message).into()) }, + } + } + pub fn effects(&self) -> &[Order] { + use Xcm::*; + match self { + WithdrawAsset { effects, .. } => effects, + _ => &[], } } } diff --git a/xcm/src/v0/order.rs b/xcm/src/v0/order.rs index 776ac3691c74..c63df711758f 100644 --- a/xcm/src/v0/order.rs +++ b/xcm/src/v0/order.rs @@ -16,14 +16,14 @@ //! Version 0 of the Cross-Consensus Message format data structures. +use super::{MultiAsset, MultiLocation, Xcm}; use alloc::vec::Vec; use derivative::Derivative; -use parity_scale_codec::{self, Encode, Decode}; -use super::{MultiAsset, MultiLocation, Xcm}; +use parity_scale_codec::{self, Decode, Encode}; /// An instruction to be executed on some or all of the assets in holding, used by asset-related XCM messages. #[derive(Derivative, Encode, Decode)] -#[derivative(Clone(bound=""), Eq(bound=""), PartialEq(bound=""), Debug(bound=""))] +#[derivative(Clone(bound = ""), Eq(bound = ""), PartialEq(bound = ""), Debug(bound = ""))] #[codec(encode_bound())] #[codec(decode_bound())] pub enum Order { @@ -77,7 +77,11 @@ pub enum Order { /// /// Errors: #[codec(index = 4)] - InitiateReserveWithdraw { assets: Vec, reserve: MultiLocation, effects: Vec> }, + InitiateReserveWithdraw { + assets: Vec, + reserve: MultiLocation, + effects: Vec>, + }, /// Remove the asset(s) (`assets`) from holding and send a `TeleportAsset` XCM message to a destination location. /// @@ -99,14 +103,25 @@ pub enum Order { /// /// Errors: #[codec(index = 6)] - QueryHolding { #[codec(compact)] query_id: u64, dest: MultiLocation, assets: Vec }, + QueryHolding { + #[codec(compact)] + query_id: u64, + dest: MultiLocation, + assets: Vec, + }, /// Pay for the execution of some XCM with up to `weight` picoseconds of execution time, paying for this with /// up to `fees` from the holding account. /// /// Errors: #[codec(index = 7)] - BuyExecution { fees: MultiAsset, weight: u64, debt: u64, halt_on_error: bool, xcm: Vec> }, + BuyExecution { + fees: MultiAsset, + weight: u64, + debt: u64, + halt_on_error: bool, + xcm: Vec>, + }, } pub mod opaque { @@ -114,23 +129,22 @@ pub mod opaque { } impl Order { - pub fn into(self) -> Order { Order::from(self) } + pub fn into(self) -> Order { + Order::from(self) + } pub fn from(order: Order) -> Self { use Order::*; match order { Null => Null, - DepositAsset { assets, dest } - => DepositAsset { assets, dest }, - DepositReserveAsset { assets, dest, effects } - => DepositReserveAsset { assets, dest, effects }, - ExchangeAsset { give, receive } - => ExchangeAsset { give, receive }, - InitiateReserveWithdraw { assets, reserve, effects } - => InitiateReserveWithdraw { assets, reserve, effects }, - InitiateTeleport { assets, dest, effects } - => InitiateTeleport { assets, dest, effects }, - QueryHolding { query_id, dest, assets } - => QueryHolding { query_id, dest, assets }, + DepositAsset { assets, dest } => DepositAsset { assets, dest }, + DepositReserveAsset { assets, dest, effects } => + DepositReserveAsset { assets, dest, effects }, + ExchangeAsset { give, receive } => ExchangeAsset { give, receive }, + InitiateReserveWithdraw { assets, reserve, effects } => + InitiateReserveWithdraw { assets, reserve, effects }, + InitiateTeleport { assets, dest, effects } => + InitiateTeleport { assets, dest, effects }, + QueryHolding { query_id, dest, assets } => QueryHolding { query_id, dest, assets }, BuyExecution { fees, weight, debt, halt_on_error, xcm } => { let xcm = xcm.into_iter().map(Xcm::from).collect(); BuyExecution { fees, weight, debt, halt_on_error, xcm } diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index e2096afcaa30..e023fca3b8d1 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -14,27 +14,34 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use sp_std::{result::Result, marker::PhantomData, convert::TryInto}; +use frame_support::{ + traits::{tokens::currency::Currency as CurrencyT, Get, OnUnbalanced as OnUnbalancedT}, + weights::{GetDispatchInfo, Weight, WeightToFeePolynomial}, +}; use parity_scale_codec::Decode; -use xcm::v0::{Xcm, Order, MultiAsset, MultiLocation, Error}; -use sp_runtime::traits::{Zero, Saturating, SaturatedConversion}; -use frame_support::traits::{Get, OnUnbalanced as OnUnbalancedT, tokens::currency::Currency as CurrencyT}; -use frame_support::weights::{Weight, GetDispatchInfo, WeightToFeePolynomial}; -use xcm_executor::{Assets, traits::{WeightBounds, WeightTrader}}; +use sp_runtime::traits::{SaturatedConversion, Saturating, Zero}; +use sp_std::{convert::TryInto, marker::PhantomData, result::Result}; +use xcm::v0::{Error, MultiAsset, MultiLocation, Order, Xcm}; +use xcm_executor::{ + traits::{WeightBounds, WeightTrader}, + Assets, +}; pub struct FixedWeightBounds(PhantomData<(T, C)>); impl, C: Decode + GetDispatchInfo> WeightBounds for FixedWeightBounds { + const MAX_WEIGHT: Weight = Weight::MAX; // TODO put a real value + fn shallow(message: &mut Xcm) -> Result { Ok(match message { - Xcm::Transact { call, .. } => { - call.ensure_decoded()?.get_dispatch_info().weight.saturating_add(T::get()) - } - Xcm::RelayedFrom { ref mut message, .. } => T::get().saturating_add(Self::shallow(message.as_mut())?), - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } - => { - let inner: Weight = effects.iter_mut() + Xcm::Transact { call, .. } => + call.ensure_decoded()?.get_dispatch_info().weight.saturating_add(T::get()), + Xcm::RelayedFrom { ref mut message, .. } => + T::get().saturating_add(Self::shallow(message.as_mut())?), + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { + let inner: Weight = effects + .iter_mut() .map(|effect| match effect { Order::BuyExecution { .. } => { // On success, execution of this will result in more weight being consumed but @@ -45,28 +52,29 @@ impl, C: Decode + GetDispatchInfo> WeightBounds for FixedWeigh T::get() }, _ => T::get(), - }).sum(); + }) + .sum(); T::get().saturating_add(inner) - } + }, _ => T::get(), }) } fn deep(message: &mut Xcm) -> Result { Ok(match message { Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } - => { + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { let mut extra = 0; for effect in effects.iter_mut() { match effect { - Order::BuyExecution { xcm, .. } => { + Order::BuyExecution { xcm, .. } => for message in xcm.iter_mut() { - extra.saturating_accrue(Self::shallow(message)?.saturating_add(Self::deep(message)?)); - } - }, - _ => {} + extra.saturating_accrue( + Self::shallow(message)?.saturating_add(Self::deep(message)?), + ); + }, + _ => {}, } } extra @@ -92,12 +100,17 @@ impl TakeRevenue for () { /// /// The constant `Get` type parameter should be the concrete fungible ID and the amount of it required for /// one second of weight. -pub struct FixedRateOfConcreteFungible< - T: Get<(MultiLocation, u128)>, - R: TakeRevenue, ->(Weight, u128, PhantomData<(T, R)>); -impl, R: TakeRevenue> WeightTrader for FixedRateOfConcreteFungible { - fn new() -> Self { Self(0, 0, PhantomData) } +pub struct FixedRateOfConcreteFungible, R: TakeRevenue>( + Weight, + u128, + PhantomData<(T, R)>, +); +impl, R: TakeRevenue> WeightTrader + for FixedRateOfConcreteFungible +{ + fn new() -> Self { + Self(0, 0, PhantomData) + } fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { let (id, units_per_second) = T::get(); @@ -131,20 +144,27 @@ impl, R: TakeRevenue> Drop for FixedRateOfConcrete /// Weight trader which uses the `TransactionPayment` pallet to set the right price for weight and then /// places any weight bought into the right account. pub struct UsingComponents< - WeightToFee: WeightToFeePolynomial, + WeightToFee: WeightToFeePolynomial, AssetId: Get, AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, ->(Weight, Currency::Balance, PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>); +>( + Weight, + Currency::Balance, + PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, +); impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, -> WeightTrader for UsingComponents { - fn new() -> Self { Self(0, Zero::zero(), PhantomData) } + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > WeightTrader for UsingComponents +{ + fn new() -> Self { + Self(0, Zero::zero(), PhantomData) + } fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { let amount = WeightToFee::calc(&weight); @@ -163,21 +183,19 @@ impl< let amount = WeightToFee::calc(&weight); self.0 -= weight; self.1 = self.1.saturating_sub(amount); - let result = MultiAsset::ConcreteFungible { - amount: amount.saturated_into(), - id: AssetId::get(), - }; + let result = + MultiAsset::ConcreteFungible { amount: amount.saturated_into(), id: AssetId::get() }; result } - } impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, -> Drop for UsingComponents { + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > Drop for UsingComponents +{ fn drop(&mut self) { OnUnbalanced::on_unbalanced(Currency::issue(self.1)); } diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index dc9589803af5..dac8f1f14c8a 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -14,13 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use sp_std::result::Result; -use xcm::v0::{Xcm, MultiAsset, MultiLocation, Error}; -use frame_support::weights::Weight; use crate::Assets; +use frame_support::weights::Weight; +use sp_std::result::Result; +use xcm::v0::{Error, MultiAsset, MultiLocation, Xcm}; /// Determine the weight of an XCM message. pub trait WeightBounds { + const MAX_WEIGHT: Weight; /// Return the minimum amount of weight that an attempted execution of this message would definitely /// consume. /// @@ -71,11 +72,15 @@ pub trait WeightTrader: Sized { /// purchased using `buy_weight`. /// /// Default implementation refunds nothing. - fn refund_weight(&mut self, _weight: Weight) -> MultiAsset { MultiAsset::None } + fn refund_weight(&mut self, _weight: Weight) -> MultiAsset { + MultiAsset::None + } } impl WeightTrader for () { - fn new() -> Self { () } + fn new() -> Self { + () + } fn buy_weight(&mut self, _: Weight, _: Assets) -> Result { Err(Error::Unimplemented) } From d99d4f90ce4399c4abffd75900db65d3dfc308a4 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sat, 31 Jul 2021 21:56:40 +0200 Subject: [PATCH 08/63] just some boilerpalate --- runtime/westend/src/lib.rs | 1 + xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 6 ++++- xcm/pallet-xcm-benchmarks/src/lib.rs | 22 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 46ba562af404..6b53b8ca9a31 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1455,6 +1455,7 @@ sp_api::impl_runtime_apis! { use frame_support::traits::fungible::Inspect as FungibleInspect; use frame_support::traits::fungibles::Inspect as FungiblesInspect; use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; + pub struct AsFungibles(sp_std::marker::PhantomData); /// Trait for providing balance-inspection access to a set of named fungible assets. diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index bdcc9f60c28b..4c967146bee0 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -222,7 +222,11 @@ benchmarks! { ) } } - xcm_transfer_reserved_asset {}: {} verify {} + + xcm_transfer_reserved_asset_fungible {}: {} verify {} + xcm_transfer_reserved_asset_fungibles {}: {} verify {} + xcm_transfer_reserved_asset_fungible_non {}: {} verify {} + xcm_transact {}: {} verify {} xcm_hrmp_channel_open_request {}: {} verify {} xcm_hrmp_channel_accepted {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 6575b2fb7baf..e52a9460824e 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -20,6 +20,7 @@ #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; +use xcm::v0::MultiAsset; #[cfg(test)] mod mock; @@ -43,9 +44,30 @@ pub mod pallet { /// Usually should be an instance of balances or assets/uniques pallet. type FungibleTransactAsset: frame_support::traits::fungible::Inspect; type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; + type NonFungiblesTransactAsset: frame_support::traits::fungibles::Inspect; } + // transact asset that works with balances and asset + // + // transact asset that works with 3 assets + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); } + + +// With this, we measure all weights per asset, so NONE of the benchmarks need to have a component +// that is the number of assets, that's pretty pointless. You need to iterate the `Vec` +// down the road +enum AssetWeightType { + Fungible, // Balances + Fungibles, // assets, + NonFungible, // Uniques +} + +trait IdentifyAsset { + fn identify_asset(asset: MultiAsset) -> R { + + } +} From e9081ea0284dfd765c589671729708aae2f45f8e Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sun, 1 Aug 2021 19:45:18 +0200 Subject: [PATCH 09/63] Everythign works again in a new format --- runtime/westend/src/lib.rs | 36 --- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 159 +++++++++---- xcm/pallet-xcm-benchmarks/src/lib.rs | 91 +++++-- xcm/pallet-xcm-benchmarks/src/mock.rs | 222 ------------------ xcm/pallet-xcm-benchmarks/src/weights.rs | 27 +-- xcm/xcm-executor/src/assets.rs | 4 +- xcm/xcm-executor/src/lib.rs | 4 +- 7 files changed, 197 insertions(+), 346 deletions(-) delete mode 100644 xcm/pallet-xcm-benchmarks/src/mock.rs diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 6b53b8ca9a31..0c91684214a5 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1456,42 +1456,6 @@ sp_api::impl_runtime_apis! { use frame_support::traits::fungibles::Inspect as FungiblesInspect; use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; - pub struct AsFungibles(sp_std::marker::PhantomData); - /// Trait for providing balance-inspection access to a set of named fungible assets. - - impl> FungiblesInspect for AsFungibles { - type AssetId = u32; - type Balance = Balance; - - fn total_issuance(_: Self::AssetId) -> Self::Balance { - B::total_issuance() - } - fn minimum_balance(_: Self::AssetId) -> Self::Balance { - B::minimum_balance() - } - fn balance(_: Self::AssetId, who: &AccountId) -> Self::Balance { - B::balance(who) - } - fn reducible_balance(_: Self::AssetId, who: &AccountId, keep_alive: bool) -> Self::Balance { - B::reducible_balance(who, keep_alive) - } - fn can_deposit( - _: Self::AssetId, - who: &AccountId, - amount: Self::Balance, - ) -> DepositConsequence { - B::can_deposit(who, amount) - } - - fn can_withdraw( - _: Self::AssetId, - who: &AccountId, - amount: Self::Balance, - ) -> WithdrawConsequence { - B::can_withdraw(who, amount) - } - } - impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type FungibleTransactAsset = Balances; diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index 4c967146bee0..2c29b04126c3 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -1,27 +1,31 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . use crate::*; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{assert_ok, traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, weights::Weight}; -use sp_std::{vec, convert::TryInto, prelude::*}; +use frame_support::{ + assert_ok, + traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, + weights::Weight, +}; +use sp_runtime::traits::Zero; +use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::{ - opaque::v0::{ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, + opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, v0::{Error as XcmError, Order, Outcome, Xcm}, }; use xcm_executor::{traits::TransactAsset, Assets}; @@ -39,6 +43,36 @@ pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call const MAX_ASSETS: u32 = 25; const SEED: u32 = 0; +/// The number of fungible assets in the holding. +const HOLDING_FUNGIBLES: u32 = 99; +const HOLDING_NON_FUNGIBLES: u32 = 99; + +fn create_holding( + fungibles_count: u32, + fungibles_amount: u128, + non_fungibles_count: u32, +) -> Assets { + (0..fungibles_count) + .map(|i| { + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), + amount: fungibles_amount * i as u128, + } + .into() + }) + .chain((0..non_fungibles_count).map(|i| { + let bytes = i.encode(); + let mut instance = [0u8; 4]; + instance.copy_from_slice(&bytes); + MultiAsset::ConcreteNonFungible { + class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), + instance: AssetInstance::Array4(instance), + } + })) + .collect::>() + .into() +} + /// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single /// order. fn execute_order( @@ -104,18 +138,25 @@ benchmarks! { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset_fungible { + order_deposit_asset_fungible_per_asset { let amount_balance = T::FungibleTransactAsset::minimum_balance() * 4u32.into(); let amount: u128 = amount_balance.try_into().unwrap(); - let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount: amount }; + // This is the asset that we want to get from the holding and deposit, which should exist + // among the assets that `create_holding` is generating + let asset_multi_location = MultiLocation::Null; + let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null , amount }; let order = Order::>::DepositAsset { - assets: vec![asset], + assets: vec![asset.clone()], dest: MultiLocation::X1(account_id_junction::(77)), }; let origin = MultiLocation::X1(account_id_junction::(1)); - let holding: Assets = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }.into(); + + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset); }: { assert_ok!(execute_order::(origin, holding, order)); } verify { @@ -124,36 +165,36 @@ benchmarks! { amount_balance ) } - order_deposit_asset_fungibles { - let a in 1..MAX_ASSETS; - - let assets = (0..a).map(|_| { - let amount_balance = T::FungiblesTransactAsset::minimum_balance(a.into()) * 4u32.into(); - let amount: u128 = amount_balance.try_into().unwrap(); - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: a as u128 }), - amount, - } - }).collect::>(); + order_deposit_asset_fungibles_per_asset { + // create one asset with our desired id. + let asset_id = HOLDING_FUNGIBLES / 2; + let amount_balance = T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(); + let amount: u128 = amount_balance.try_into().unwrap(); + // assert!(!amount.is_zero(), "amount should never be zero"); + // TODO: we should try and command here the asset to be created, but that's kinda non-trivial. + let asset = MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: 0u128 }), + amount, + }; let order = Order::>::DepositAsset { - assets: assets.clone(), + assets: vec![ asset ], dest: MultiLocation::X1(account_id_junction::(77)), }; let origin = MultiLocation::X1(account_id_junction::(1)); - let holding: Assets = assets.into(); + let holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); }: { assert_ok!(execute_order::(origin, holding, order)); } verify { - for asset_id in 0..a { - assert_eq!( - T::FungiblesTransactAsset::balance(asset_id.into(), &account::(77)), - T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), - ) - } + assert_eq!( + T::FungiblesTransactAsset::balance(asset_id.into(), &account::(77)), + T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), + ) } - order_deposit_reserved_asset_fungible {}: {} verify {} + order_deposit_reserved_asset_fungible { + + }: {} verify {} order_deposit_reserved_asset_fungibles {}: {} verify {} order_exchange_asset_fungible {}: {} verify {} @@ -234,4 +275,34 @@ benchmarks! { xcm_relayed_from {}: {} verify {} } -impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); +#[cfg(test)] +mod benchmark_tests { + use super::*; + + #[test] + fn order_deposit_asset_fungible_per_asset() { + crate::mock_fungible::new_test_ext().execute_with(|| { + test_benchmark_order_deposit_asset_fungible_per_asset::(); + }) + } + + #[test] + fn order_deposit_asset_fungibles_per_asset() { + crate::mock_fungibles::new_test_ext().execute_with(|| { + test_benchmark_order_deposit_asset_fungibles_per_asset::(); + }) + } + + #[test] + fn xcm_transfer_asset_fungible() { + crate::mock_fungible::new_test_ext().execute_with(|| { + test_benchmark_xcm_transfer_asset_fungible::(); + }) + } + #[test] + fn xcm_transfer_asset_fungibles() { + crate::mock_fungibles::new_test_ext().execute_with(|| { + test_benchmark_xcm_transfer_asset_fungibles::(); + }) + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 7c1ed62e2105..564ec890897e 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -1,29 +1,33 @@ -// This file is part of Substrate. - -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . //! Pallet that serves no other purpose than benchmarking raw messages [`Xcm`]. #![cfg_attr(not(feature = "std"), no_std)] +use codec::Codec; pub use pallet::*; use xcm::v0::MultiAsset; #[cfg(test)] -mod mock; +mod mock_fungible; +#[cfg(test)] +mod mock_fungibles; +#[cfg(test)] +mod mock_shared; mod benchmarking; pub mod weights; @@ -39,12 +43,9 @@ pub mod pallet { /// `TransactAsset` is implemented. type XcmConfig: xcm_executor::Config; - /// Direct access to whoever is being the implementor `TransactAsset`'s adapter. - /// - /// Usually should be an instance of balances or assets/uniques pallet. type FungibleTransactAsset: frame_support::traits::fungible::Inspect; type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; - type NonFungiblesTransactAsset: frame_support::traits::fungibles::Inspect; + // type NonFungiblesTransactAsset: frame_support::traits::fungibles::Inspect; } // transact asset that works with balances and asset @@ -56,18 +57,56 @@ pub mod pallet { pub struct Pallet(_); } - // With this, we measure all weights per asset, so NONE of the benchmarks need to have a component // that is the number of assets, that's pretty pointless. You need to iterate the `Vec` // down the road enum AssetWeightType { - Fungible, // Balances - Fungibles, // assets, - NonFungible, // Uniques + Fungible, // Balances + Fungibles, // assets, + NonFungible, // Uniques } trait IdentifyAsset { - fn identify_asset(asset: MultiAsset) -> R { + fn identify_asset(asset: MultiAsset) -> R; +} + +use frame_support::traits::{ + fungible::Inspect as FungibleInspect, + fungibles::Inspect as FungiblesInspect, + tokens::{DepositConsequence, WithdrawConsequence}, +}; + +pub struct AsFungibles(sp_std::marker::PhantomData<(AccountId, AssetId, B)>); +impl< + AccountId: sp_runtime::traits::Member + frame_support::dispatch::Parameter, + AssetId: sp_runtime::traits::Member + frame_support::dispatch::Parameter + Copy, + B: FungibleInspect, + > FungiblesInspect for AsFungibles +{ + type AssetId = AssetId; + type Balance = B::Balance; + + fn total_issuance(_: Self::AssetId) -> Self::Balance { + B::total_issuance() + } + fn minimum_balance(_: Self::AssetId) -> Self::Balance { + B::minimum_balance() + } + fn balance(_: Self::AssetId, who: &AccountId) -> Self::Balance { + B::balance(who) + } + fn reducible_balance(_: Self::AssetId, who: &AccountId, keep_alive: bool) -> Self::Balance { + B::reducible_balance(who, keep_alive) + } + fn can_deposit(_: Self::AssetId, who: &AccountId, amount: Self::Balance) -> DepositConsequence { + B::can_deposit(who, amount) + } + fn can_withdraw( + _: Self::AssetId, + who: &AccountId, + amount: Self::Balance, + ) -> WithdrawConsequence { + B::can_withdraw(who, amount) } } diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs deleted file mode 100644 index 9700b4f6dfc1..000000000000 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ /dev/null @@ -1,222 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! A mock runtime for xcm benchmarking. -#![allow(dead_code, unused_imports)] // TODO: remove this later. - -use crate as pallet_xcm_benchmarks; -use crate::*; -use frame_support::parameter_types; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; - -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; - -// For testing the pallet, we construct a mock runtime. -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, - XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, - } -); - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1024); -} -impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::AllowAll; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Call = Call; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 7; -} - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - type Balance = u64; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); -} - -parameter_types! { - pub const AssetDeposit: u64 = 100 * ExistentialDeposit::get(); - pub const ApprovalDeposit: u64 = 1 * ExistentialDeposit::get(); - pub const StringLimit: u32 = 50; - pub const MetadataDepositBase: u64 = 10 * ExistentialDeposit::get(); - pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); -} - -impl pallet_assets::Config for Test { - type Event = Event; - type Balance = u64; - type AssetId = u32; - type Currency = Balances; - type ForceOrigin = frame_system::EnsureRoot; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = StringLimit; - type Freezer = (); - type Extra = (); - type WeightInfo = (); -} - -use frame_support::weights::Weight; -use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; - -// An xcm sender/receiver akin to > /dev/null -pub struct DevNull; -impl xcm::opaque::v0::SendXcm for DevNull { - fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { - Ok(()) - } -} - -impl xcm_executor::traits::OnResponse for DevNull { - fn expecting_response(_: &MultiLocation, _: u64) -> bool { - false - } - fn on_response(_: MultiLocation, _: u64, _: Response) -> Weight { - 0 - } -} - -parameter_types! { - pub const CheckedAccount: Option = Some(100); - pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); - pub UnitWeightCost: Weight = 10; - pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Null, 1_000_000_000_000); -} - -// TODO: maybe just use IsConcrete -pub struct MatchAnyFungible; -impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { - fn matches_fungible(m: &MultiAsset) -> Option { - use sp_runtime::traits::SaturatedConversion; - match m { - MultiAsset::ConcreteFungible { amount, .. } => Some((*amount).saturated_into::()), - _ => None, - } - } -} - -pub struct AccountIdConverter; -impl xcm_executor::traits::Convert for AccountIdConverter { - fn convert(ml: MultiLocation) -> Result { - match ml { - MultiLocation::X1(Junction::AccountId32 { id, .. }) => - Ok(::decode(&mut &*id.to_vec()).unwrap()), - _ => Err(ml), - } - } - - fn reverse(acc: u64) -> Result { - Err(acc) - } -} - -// Use balances as the asset transactor. -pub type AssetTransactor = xcm_builder::CurrencyAdapter< - Balances, - MatchAnyFungible, - AccountIdConverter, - u64, - CheckedAccount, ->; - -pub struct YesItShould(sp_std::marker::PhantomData); -impl xcm_executor::traits::ShouldExecute for YesItShould { - fn should_execute( - _: &MultiLocation, - _: bool, - _: &xcm::v0::Xcm, - _: Weight, - _: &mut Weight, - ) -> Result<(), ()> { - Ok(()) - } -} - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type Call = Call; - type XcmSender = DevNull; - type AssetTransactor = AssetTransactor; - type OriginConverter = (); // TODO: - type IsReserve = (); // TODO: - type IsTeleporter = (); // no one can teleport. - type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; - type Weigher = xcm_builder::FixedWeightBounds; - type Trader = xcm_builder::FixedRateOfConcreteFungible; - type ResponseHandler = DevNull; -} - -impl pallet_xcm_benchmarks::Config for Test { - type XcmConfig = XcmConfig; - type FungibleTransactAsset = Balances; - type FungiblesTransactAsset = Assets; -} - -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. -pub fn new_test_ext() -> sp_io::TestExternalities { - let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); - sp_tracing::try_init_simple(); - t.into() -} diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs index ab3c160d05ce..d33e01c53b7c 100644 --- a/xcm/pallet-xcm-benchmarks/src/weights.rs +++ b/xcm/pallet-xcm-benchmarks/src/weights.rs @@ -1,19 +1,18 @@ -// This file is part of Substrate. +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. -// Copyright (C) 21019-21021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.10 +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. -// Licensed under the Apache License, Version 2.10 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.10 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . use frame_support::pallet_prelude::*; use sp_runtime::traits::Saturating; diff --git a/xcm/xcm-executor/src/assets.rs b/xcm/xcm-executor/src/assets.rs index c0d35052482b..f47e1f6d7e8a 100644 --- a/xcm/xcm-executor/src/assets.rs +++ b/xcm/xcm-executor/src/assets.rs @@ -497,7 +497,7 @@ impl Assets { MultiAsset::AbstractFungible { id, amount } => (AssetId::Abstract(id), amount), _ => unreachable!(), }; - // remove the maxmimum possible up to id/amount from self, add the removed onto + // remove the maximum possible up to id/amount from self, add the removed onto // result let maybe_value = self.fungible.get(&id); if let Some(&e) = maybe_value { @@ -516,7 +516,7 @@ impl Assets { MultiAsset::AbstractNonFungible { class, instance } => (AssetId::Abstract(class), instance), _ => unreachable!(), }; - // remove the maxmimum possible up to id/amount from self, add the removed onto + // remove the maximum possible up to id/amount from self, add the removed onto // result if let Some(entry) = self.non_fungible.take(&(class, instance)) { result.non_fungible.insert(entry); diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 505bccce11e1..0e1f75c927bc 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -266,11 +266,11 @@ impl XcmExecutor { let assets = Self::reanchored(deposited, &dest); Config::XcmSender::send_xcm(dest, Xcm::ReserveAssetDeposit { assets, effects })?; }, - Order::InitiateReserveWithdraw { assets, reserve, effects} => { + Order::InitiateReserveWithdraw { assets, reserve, effects } => { let assets = Self::reanchored(holding.saturating_take(assets), &reserve); Config::XcmSender::send_xcm(reserve, Xcm::WithdrawAsset { assets, effects })?; } - Order::InitiateTeleport { assets, dest, effects} => { + Order::InitiateTeleport { assets, dest, effects } => { // We must do this first in order to resolve wildcards. let assets = holding.saturating_take(assets); for asset in assets.assets_iter() { From d9762046a9d7ff46260b29c21a472a800f1ed548 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Sun, 1 Aug 2021 19:45:33 +0200 Subject: [PATCH 10/63] add the new files --- .../src/mock_fungible.rs | 152 +++++++++++++++ .../src/mock_fungibles.rs | 184 ++++++++++++++++++ xcm/pallet-xcm-benchmarks/src/mock_shared.rs | 78 ++++++++ 3 files changed, 414 insertions(+) create mode 100644 xcm/pallet-xcm-benchmarks/src/mock_fungible.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/mock_shared.rs diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs b/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs new file mode 100644 index 000000000000..1fc47daac5cd --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs @@ -0,0 +1,152 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for xcm benchmarking. + +use crate as pallet_xcm_benchmarks; +use crate::{mock_shared::*, *}; +use frame_support::{parameter_types, traits::Contains, weights::Weight}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; +use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; +use xcm_executor::AssetId; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// For testing the pallet, we construct a mock runtime. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); +} +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::AllowAll; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 7; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = u64; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); +} + +parameter_types! { + pub const AssetDeposit: u64 = 100 * ExistentialDeposit::get(); + pub const ApprovalDeposit: u64 = 1 * ExistentialDeposit::get(); + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 10 * ExistentialDeposit::get(); + pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); +} + +pub struct MatchAnyFungible; +impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { + fn matches_fungible(m: &MultiAsset) -> Option { + use sp_runtime::traits::SaturatedConversion; + match m { + // TODO: + MultiAsset::ConcreteFungible { amount, .. } => Some((*amount).saturated_into::()), + _ => None, + } + } +} + +parameter_types! { + pub const CheckedAccount: Option = Some(100); +} + +// Use balances as the asset transactor. +pub type AssetTransactor = xcm_builder::CurrencyAdapter< + Balances, + MatchAnyFungible, + AccountIdConverter, + u64, + CheckedAccount, +>; + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = DevNull; + type AssetTransactor = AssetTransactor; + type OriginConverter = (); + type IsReserve = (); + type IsTeleporter = (); + type LocationInverter = xcm_builder::LocationInverter; + type Barrier = YesItShould; + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfConcreteFungible; + type ResponseHandler = DevNull; +} + +impl pallet_xcm_benchmarks::Config for Test { + type XcmConfig = XcmConfig; + type FungibleTransactAsset = Balances; + type FungiblesTransactAsset = crate::AsFungibles; +} + +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs b/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs new file mode 100644 index 000000000000..95424ac7937c --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs @@ -0,0 +1,184 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for xcm benchmarking. + +use crate as pallet_xcm_benchmarks; +use crate::{mock_shared::*, *}; +use frame_support::{parameter_types, traits::Contains, weights::Weight}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; +use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; +use xcm_executor::AssetId; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// For testing the pallet, we construct a mock runtime. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Assets: pallet_assets::{Pallet, Call, Storage, Event}, + XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); +} +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::AllowAll; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 7; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = u64; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); +} + +parameter_types! { + pub const AssetDeposit: u64 = 100 * ExistentialDeposit::get(); + pub const ApprovalDeposit: u64 = 1 * ExistentialDeposit::get(); + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 10 * ExistentialDeposit::get(); + pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); +} + +impl pallet_assets::Config for Test { + type Event = Event; + type Balance = u64; + type AssetId = u32; + type Currency = Balances; + type ForceOrigin = frame_system::EnsureRoot; + type AssetDeposit = AssetDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; + type Freezer = (); + type Extra = (); + type WeightInfo = (); +} + +pub struct CheckAsset; +impl Contains for CheckAsset { + fn contains(_: &u32) -> bool { + true + } +} + +pub struct MatchAnyFungibles; +impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { + fn matches_fungibles(m: &MultiAsset) -> Result<(u32, u64), xcm_executor::traits::Error> { + // ^^ TODO: this error is too out of scope. + use sp_runtime::traits::SaturatedConversion; + match m { + // TODO: + MultiAsset::ConcreteFungible { amount, .. } => Ok( + ( + 0, + (*amount).saturated_into::(), + ) + ), + _ => Err(xcm_executor::traits::Error::AssetNotFound), + } + } +} + +parameter_types! { + pub const CheckedAccount: u64 = 100; +} + +pub type AssetTransactor = xcm_builder::FungiblesAdapter< + Assets, + MatchAnyFungibles, + AccountIdConverter, + u64, + CheckAsset, + CheckedAccount, +>; + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = DevNull; + type AssetTransactor = AssetTransactor; + type OriginConverter = (); + type IsReserve = (); + type IsTeleporter = (); // no one can teleport. + type LocationInverter = xcm_builder::LocationInverter; + type Barrier = YesItShould; + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfConcreteFungible; + type ResponseHandler = DevNull; +} + +impl pallet_xcm_benchmarks::Config for Test { + type XcmConfig = XcmConfig; + type FungibleTransactAsset = Balances; + type FungiblesTransactAsset = Assets; +} + +// This function basically just builds a genesis storage key/value store according to +// our desired mockup. +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} diff --git a/xcm/pallet-xcm-benchmarks/src/mock_shared.rs b/xcm/pallet-xcm-benchmarks/src/mock_shared.rs new file mode 100644 index 000000000000..9b1607cce575 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/mock_shared.rs @@ -0,0 +1,78 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use crate as pallet_xcm_benchmarks; +use crate::*; +use frame_support::{parameter_types, traits::Contains, weights::Weight}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; +use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; +use xcm_executor::AssetId; + +pub struct YesItShould(sp_std::marker::PhantomData); +impl xcm_executor::traits::ShouldExecute for YesItShould { + fn should_execute( + _: &MultiLocation, + _: bool, + _: &xcm::v0::Xcm, + _: Weight, + _: &mut Weight, + ) -> Result<(), ()> { + Ok(()) + } +} + +// An xcm sender/receiver akin to > /dev/null +pub struct DevNull; +impl xcm::opaque::v0::SendXcm for DevNull { + fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { + Ok(()) + } +} + +impl xcm_executor::traits::OnResponse for DevNull { + fn expecting_response(_: &MultiLocation, _: u64) -> bool { + false + } + fn on_response(_: MultiLocation, _: u64, _: Response) -> Weight { + 0 + } +} + +pub struct AccountIdConverter; +impl xcm_executor::traits::Convert for AccountIdConverter { + fn convert(ml: MultiLocation) -> Result { + match ml { + MultiLocation::X1(Junction::AccountId32 { id, .. }) => + Ok(::decode(&mut &*id.to_vec()).unwrap()), + _ => Err(ml), + } + } + + fn reverse(acc: u64) -> Result { + Err(acc) + } +} + +parameter_types! { + pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); + pub UnitWeightCost: Weight = 10; + pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Null, 1_000_000_000_000); +} From 44c212d69452f52ddc23d5590a953b3307077ffc Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 2 Aug 2021 18:39:09 +0200 Subject: [PATCH 11/63] more weight info --- xcm/pallet-xcm-benchmarks/src/weights.rs | 120 +++++++++++++---------- xcm/src/v0/mod.rs | 20 +++- xcm/src/v0/order.rs | 17 +++- xcm/src/v0/traits.rs | 31 +++++- xcm/xcm-builder/src/weight.rs | 4 +- xcm/xcm-executor/src/traits/weight.rs | 1 - 6 files changed, 136 insertions(+), 57 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs index d33e01c53b7c..da8ae2d74a34 100644 --- a/xcm/pallet-xcm-benchmarks/src/weights.rs +++ b/xcm/pallet-xcm-benchmarks/src/weights.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use frame_support::pallet_prelude::*; +use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::*}; use sp_runtime::traits::Saturating; -use xcm::v0::{Order, Xcm}; +use xcm::v0::{GetWeight, Order, Xcm}; use xcm_executor::traits::WeightBounds; pub trait WeightInfo { @@ -106,61 +106,79 @@ impl WeightInfo for XcmWeight { } } -struct FinalXcmWeight(PhantomData<(W, Call)>); -impl WeightBounds for FinalXcmWeight { - const MAX_WEIGHT: Weight = 1_000_000; +struct FinalXcmWeight(PhantomData<(W, C)>); +impl WeightBounds for FinalXcmWeight +where + W: WeightInfo, + C: Decode + GetDispatchInfo, + Xcm: GetWeight, + Order: GetWeight, +{ + fn shallow(message: &mut Xcm) -> Result { + let weight = match message { + Xcm::RelayedFrom { ref mut message, .. } => { + let relay_message_weight = Self::shallow(message.as_mut())?; + message.weight().saturating_add(relay_message_weight) + }, + // These XCM + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { + let inner: Weight = effects.iter_mut().map(|effect| effect.weight()).sum(); + message.weight().saturating_add(inner) + }, + // The shallow weight of `Transact` is the full weight of the message, thus there is no + // deeper weight. + Xcm::Transact { call, .. } => { + let call_weight = call.ensure_decoded()?.get_dispatch_info().weight; + message.weight().saturating_add(call_weight) + }, + // These + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => message.weight(), + }; - fn shallow(message: &mut Xcm) -> Result { - let mut weight = 0; - let xcm_weight = Self::xcm_weight(message)?; - weight.saturating_accrue(xcm_weight); - let effects = message.effects(); - let effects_weight = Self::effects_weight(effects)?; - weight.saturating_accrue(effects_weight); Ok(weight) } - fn deep(_message: &mut Xcm) -> Result { - Err(()) // implement this - } -} - -impl FinalXcmWeight { - fn xcm_weight(message: &mut Xcm) -> Result { + fn deep(message: &mut Xcm) -> Result { let weight = match message { - Xcm::WithdrawAsset { .. } => W::xcm_withdraw_asset(), - Xcm::ReserveAssetDeposit { .. } => W::xcm_reserve_asset_deposit(), - Xcm::TeleportAsset { .. } => W::xcm_teleport_asset(), - Xcm::QueryResponse { .. } => W::xcm_query_response(), - Xcm::TransferAsset { .. } => W::xcm_transfer_asset(), - Xcm::TransferReserveAsset { .. } => W::xcm_transfer_reserved_asset(), - Xcm::Transact { .. } => W::xcm_transact(), - Xcm::HrmpNewChannelOpenRequest { .. } => W::xcm_hrmp_channel_open_request(), - Xcm::HrmpChannelAccepted { .. } => W::xcm_hrmp_channel_accepted(), - Xcm::HrmpChannelClosing { .. } => W::xcm_hrmp_channel_closing(), - Xcm::RelayedFrom { .. } => W::xcm_relayed_from(), + // `RelayFrom` needs to account for the deep weight of the internal message. + Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, + // These XCM have internal effects which are not accounted for in the `shallow` weight. + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { + let mut extra = 0; + for effect in effects.iter_mut() { + match effect { + Order::BuyExecution { xcm, .. } => + for message in xcm.iter_mut() { + extra.saturating_accrue({ + let shallow = Self::shallow(message)?; + let deep = Self::deep(message)?; + shallow.saturating_add(deep) + }); + }, + _ => {}, + } + } + extra + }, + // These XCM do not have any deeper weight. + Xcm::Transact { .. } | + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => 0, }; - Ok(weight) - } - fn effects_weight(effects: &[Order]) -> Result { - let mut weight = 0; - for order in effects { - if weight >= Self::MAX_WEIGHT { - return Err(()) - } - let new_weight = match order { - Order::Null => W::order_null(), - Order::DepositAsset { .. } => W::order_deposit_asset(), - Order::DepositReserveAsset { .. } => W::order_deposit_reserved_asset(), - Order::ExchangeAsset { .. } => W::order_exchange_asset(), - Order::InitiateReserveWithdraw { .. } => W::order_initiate_reserve_withdraw(), - Order::InitiateTeleport { .. } => W::order_initiate_teleport(), - Order::QueryHolding { .. } => W::order_query_holding(), - Order::BuyExecution { .. } => W::order_buy_execution(), - }; - // TODO loop effects - weight.saturating_accrue(new_weight); - } + Ok(weight) } } diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index 1a292c67751c..cd34812fe491 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -31,7 +31,7 @@ pub use junction::{BodyId, BodyPart, Junction, NetworkId}; pub use multi_asset::{AssetInstance, MultiAsset}; pub use multi_location::MultiLocation; pub use order::Order; -pub use traits::{Error, ExecuteXcm, Outcome, Result, SendXcm}; +pub use traits::{Error, ExecuteXcm, GetWeight, Outcome, Result, SendXcm, Weight, XcmWeightInfo}; /// A prelude for importing all types typically used when interacting with XCM messages. pub mod prelude { @@ -329,6 +329,24 @@ impl Xcm { } } +impl GetWeight for Xcm { + fn weight(&self) -> Weight { + match self { + Xcm::WithdrawAsset { .. } => W::xcm_withdraw_asset(), + Xcm::ReserveAssetDeposit { .. } => W::xcm_reserve_asset_deposit(), + Xcm::TeleportAsset { .. } => W::xcm_teleport_asset(), + Xcm::QueryResponse { .. } => W::xcm_query_response(), + Xcm::TransferAsset { .. } => W::xcm_transfer_asset(), + Xcm::TransferReserveAsset { .. } => W::xcm_transfer_reserved_asset(), + Xcm::Transact { .. } => W::xcm_transact(), + Xcm::HrmpNewChannelOpenRequest { .. } => W::xcm_hrmp_channel_open_request(), + Xcm::HrmpChannelAccepted { .. } => W::xcm_hrmp_channel_accepted(), + Xcm::HrmpChannelClosing { .. } => W::xcm_hrmp_channel_closing(), + Xcm::RelayedFrom { .. } => W::xcm_relayed_from(), + } + } +} + pub mod opaque { /// The basic concrete type of `generic::Xcm`, which doesn't make any assumptions about the format of a /// call other than it is pre-encoded. diff --git a/xcm/src/v0/order.rs b/xcm/src/v0/order.rs index c63df711758f..ec423dffe64e 100644 --- a/xcm/src/v0/order.rs +++ b/xcm/src/v0/order.rs @@ -16,7 +16,7 @@ //! Version 0 of the Cross-Consensus Message format data structures. -use super::{MultiAsset, MultiLocation, Xcm}; +use super::{GetWeight, MultiAsset, MultiLocation, Weight, Xcm, XcmWeightInfo}; use alloc::vec::Vec; use derivative::Derivative; use parity_scale_codec::{self, Decode, Encode}; @@ -152,3 +152,18 @@ impl Order { } } } + +impl GetWeight for Order { + fn weight(&self) -> Weight { + match self { + Order::Null => W::order_null(), + Order::DepositAsset { .. } => W::order_deposit_asset(), + Order::DepositReserveAsset { .. } => W::order_deposit_reserved_asset(), + Order::ExchangeAsset { .. } => W::order_exchange_asset(), + Order::InitiateReserveWithdraw { .. } => W::order_initiate_reserve_withdraw(), + Order::InitiateTeleport { .. } => W::order_initiate_teleport(), + Order::QueryHolding { .. } => W::order_query_holding(), + Order::BuyExecution { .. } => W::order_buy_execution(), + } + } +} diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 9a01f227e766..c18498b0ba8d 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -17,7 +17,7 @@ //! Cross-Consensus Message format data structures. use core::result; -use parity_scale_codec::{Encode, Decode}; +use parity_scale_codec::{Decode, Encode}; use super::{MultiLocation, Xcm}; @@ -259,3 +259,32 @@ impl SendXcm for Tuple { Err(Error::CannotReachDestination(destination, message)) } } + +// The info needed to weight an XCM. +pub trait XcmWeightInfo { + fn send_xcm() -> Weight; + fn order_null() -> Weight; + fn order_deposit_asset() -> Weight; + fn order_deposit_reserved_asset() -> Weight; + fn order_exchange_asset() -> Weight; + fn order_initiate_reserve_withdraw() -> Weight; + fn order_initiate_teleport() -> Weight; + fn order_query_holding() -> Weight; + fn order_buy_execution() -> Weight; + fn xcm_withdraw_asset() -> Weight; + fn xcm_reserve_asset_deposit() -> Weight; + fn xcm_teleport_asset() -> Weight; + fn xcm_query_response() -> Weight; + fn xcm_transfer_asset() -> Weight; + fn xcm_transfer_reserved_asset() -> Weight; + fn xcm_transact() -> Weight; + fn xcm_hrmp_channel_open_request() -> Weight; + fn xcm_hrmp_channel_accepted() -> Weight; + fn xcm_hrmp_channel_closing() -> Weight; + fn xcm_relayed_from() -> Weight; +} + +// A simple trait to get the weight of some object. +pub trait GetWeight { + fn weight(&self) -> Weight; +} diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index e023fca3b8d1..3846af2f4705 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -29,14 +29,14 @@ use xcm_executor::{ pub struct FixedWeightBounds(PhantomData<(T, C)>); impl, C: Decode + GetDispatchInfo> WeightBounds for FixedWeightBounds { - const MAX_WEIGHT: Weight = Weight::MAX; // TODO put a real value - fn shallow(message: &mut Xcm) -> Result { Ok(match message { Xcm::Transact { call, .. } => call.ensure_decoded()?.get_dispatch_info().weight.saturating_add(T::get()), + Xcm::RelayedFrom { ref mut message, .. } => T::get().saturating_add(Self::shallow(message.as_mut())?), + Xcm::WithdrawAsset { effects, .. } | Xcm::ReserveAssetDeposit { effects, .. } | Xcm::TeleportAsset { effects, .. } => { diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index dac8f1f14c8a..824383da508e 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -21,7 +21,6 @@ use xcm::v0::{Error, MultiAsset, MultiLocation, Xcm}; /// Determine the weight of an XCM message. pub trait WeightBounds { - const MAX_WEIGHT: Weight; /// Return the minimum amount of weight that an attempted execution of this message would definitely /// consume. /// From 1f70c4caf0a0b717f53233c30a2d195b6489aa65 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 2 Aug 2021 18:47:34 +0200 Subject: [PATCH 12/63] new format again --- runtime/westend/src/lib.rs | 17 +- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 300 ++++++++++++------ xcm/pallet-xcm-benchmarks/src/lib.rs | 22 +- .../src/mock_fungible.rs | 15 +- .../src/mock_fungibles.rs | 43 ++- xcm/pallet-xcm-benchmarks/src/mock_shared.rs | 12 +- xcm/xcm-builder/src/fungibles_adapter.rs | 49 ++- 7 files changed, 311 insertions(+), 147 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 0c91684214a5..93ffa5441bde 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1452,14 +1452,23 @@ sp_api::impl_runtime_apis! { impl pallet_offences_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} - use frame_support::traits::fungible::Inspect as FungibleInspect; - use frame_support::traits::fungibles::Inspect as FungiblesInspect; - use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; + use pallet_xcm_benchmarks::AsFungibles; + use xcm::v0::MultiAsset; impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type FungibleTransactAsset = Balances; - type FungiblesTransactAsset = AsFungibles; + + fn fungible_asset(amount: u32) -> Option<(MultiAsset, u128)> { + let amount: Balance = amount.into(); + let amount = ExistentialDeposit::get() * amount; + Some((MultiAsset::ConcreteFungible { id: WndLocation::get(), amount }, amount)) + } + + // We pass in this adapter for the fungibles stuff, so our weights for fungibles + // will be quite similar to fungible, understandably. We don't need these weights + // anyways, westend does not have or use fungibles.. + type FungiblesTransactAsset = AsFungibles; } type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::; diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index 2c29b04126c3..6643ccad695a 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -16,7 +16,7 @@ use crate::*; use codec::Encode; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_benchmarking::benchmarks; use frame_support::{ assert_ok, traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, @@ -61,18 +61,22 @@ fn create_holding( .into() }) .chain((0..non_fungibles_count).map(|i| { - let bytes = i.encode(); - let mut instance = [0u8; 4]; - instance.copy_from_slice(&bytes); MultiAsset::ConcreteNonFungible { class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - instance: AssetInstance::Array4(instance), + instance: asset_instance_from(i), } })) .collect::>() .into() } +fn asset_instance_from(x: u32) -> AssetInstance { + let bytes = x.encode(); + let mut instance = [0u8; 4]; + instance.copy_from_slice(&bytes); + AssetInstance::Array4(instance) +} + /// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single /// order. fn execute_order( @@ -85,7 +89,7 @@ fn execute_order( /// Execute an xcm. fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> Outcome { - ExecutorOf::::execute_xcm(origin, xcm, 999_999) // TODO: what should be the weight be? + ExecutorOf::::execute_xcm(origin, xcm, 999_999_999_999) // TODO: very large weight to ensure all benchmarks execute, sensible? } fn account(index: u32) -> T::AccountId { @@ -102,6 +106,15 @@ fn account_id_junction(index: u32) -> Junction { Junction::AccountId32 { network: NetworkId::Any, id } } +// Rationale: +// +// Benchmarks ending with _fungible typically indicate the case where there is only one asset in +// the order/xcm, and it is fungible. Typically, an order/xcm that is being weighed with such a +// benchmark will have a `asset: Vec<_>` of length one. +// +// Benchmarks ending with fungibles_per_asset imply that this benchmark is for the case of a chain +// with multiple asset types (thus the name `fungibles`). Such a benchmark will still only work +// with one asset, and it is meant to be summed benchmarks! { where_clause { where T::XcmConfig: xcm_executor::Config>, @@ -138,63 +151,64 @@ benchmarks! { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset_fungible_per_asset { - let amount_balance = T::FungibleTransactAsset::minimum_balance() * 4u32.into(); - let amount: u128 = amount_balance.try_into().unwrap(); - - // This is the asset that we want to get from the holding and deposit, which should exist - // among the assets that `create_holding` is generating - let asset_multi_location = MultiLocation::Null; - let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null , amount }; - - let order = Order::>::DepositAsset { - assets: vec![asset.clone()], - dest: MultiLocation::X1(account_id_junction::(77)), - }; + order_deposit_asset_fungible { let origin = MultiLocation::X1(account_id_junction::(1)); - - // generate the holding with a bunch of stuff.. - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); - // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset); + let (holding, order) = if let Some((asset, amount)) = T::fungible_asset(1) { + let order = Order::>::DepositAsset { + assets: vec![asset.clone()], + dest: MultiLocation::X1(account_id_junction::(77)), + }; + + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset); + assert!(T::FungibleTransactAsset::balance(&account::(77)).is_zero()); + + (holding, order) + } else { + // just put some mock values in there. + (Default::default(), Order::>::Null) + }; }: { - assert_ok!(execute_order::(origin, holding, order)); + if T::fungible_asset(1).is_some() { + assert_ok!(execute_order::(origin, holding, order)); + } } verify { - assert_eq!( - T::FungibleTransactAsset::balance(&account::(77)), - amount_balance - ) + if T::fungible_asset(1).is_some() { + assert!(!T::FungibleTransactAsset::balance(&account::(77)).is_zero()) + } } + order_deposit_asset_fungibles_per_asset { // create one asset with our desired id. - let asset_id = HOLDING_FUNGIBLES / 2; - let amount_balance = T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(); - let amount: u128 = amount_balance.try_into().unwrap(); - // assert!(!amount.is_zero(), "amount should never be zero"); - // TODO: we should try and command here the asset to be created, but that's kinda non-trivial. - - let asset = MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: 0u128 }), - amount, - }; - let order = Order::>::DepositAsset { - assets: vec![ asset ], - dest: MultiLocation::X1(account_id_junction::(77)), - }; + let asset_id = 9; let origin = MultiLocation::X1(account_id_junction::(1)); - let holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + + let (holding, order) = if let Some((asset, amount)) = T::fungibles_asset(1, asset_id) { + let order = Order::>::DepositAsset { + assets: vec![ asset.clone() ], + dest: MultiLocation::X1(account_id_junction::(2)), + }; + let mut holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + holding.saturating_subsume(asset); + assert!(T::FungibleTransactAsset::balance(&account::(2)).is_zero()); + + (holding, order) + } else { + (Default::default(), Order::>::Null) + }; }: { - assert_ok!(execute_order::(origin, holding, order)); + if T::fungibles_asset(1, asset_id).is_some() { + assert_ok!(execute_order::(origin, holding, order)); + } } verify { - assert_eq!( - T::FungiblesTransactAsset::balance(asset_id.into(), &account::(77)), - T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), - ) + if T::fungibles_asset(1, asset_id).is_some() { + assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) + } } - order_deposit_reserved_asset_fungible { - - }: {} verify {} + order_deposit_reserved_asset_fungible {}: {} verify {} order_deposit_reserved_asset_fungibles {}: {} verify {} order_exchange_asset_fungible {}: {} verify {} @@ -212,61 +226,131 @@ benchmarks! { order_buy_execution_fungible {}: {} verify {} order_buy_execution_fungibles {}: {} verify {} - // base XCM messages. - xcm_withdraw_asset {}: {} verify {} + + // Xcm::WithdrawAsset notes: There are two components to this benchmark: + // 1. based on the asset type, the complexity of withdraw could be different. + // 2. based on the length of the assets being withdraw, the complexity of insertion into the + // holding increases per operation. + // + // The worse case of the latter is if all assets are of one type (fungible, or non-fungible), + // since that will incur the maximum insertion cost. + // + // The former entirely depends on the asset type. + xcm_withdraw_asset_fungible { + let origin: MultiLocation = (account_id_junction::(1)).into(); + let xcm = if T::fungibles_asset(0, 0).is_some() { + let (asset, _) = T::fungible_asset(1).unwrap(); + >::deposit_asset(&asset, &origin).unwrap(); + // check one of the assets of origin. + assert!(!T::FungibleTransactAsset::balance(&account::(1)).is_zero()); + Xcm::WithdrawAsset::> { assets: vec![asset], effects: vec![] } + } else { + Xcm::TransferAsset { assets: Default::default(), dest: origin.clone() } + }; + }: { + if T::fungible_asset(0).is_some() { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } + } verify { + if T::fungible_asset(0).is_some() { + // check one of the assets of origin. + assert!(T::FungibleTransactAsset::balance(&account::(1)).is_zero()); + } + } + xcm_withdraw_asset_fungibles { + // number of fungible assets, regardless of `fungible` + let a in 0..MAX_ASSETS; + // number of non-fungible assets. + let b in 0..0; // TODO: make this work. + + let origin: MultiLocation = (account_id_junction::(1)).into(); + let xcm = if T::fungibles_asset(0, 0).is_some() { + let assets = (1..=a).map(|i| { + let (asset, _) = T::fungibles_asset(i, i).unwrap(); + >::deposit_asset(&asset, &origin).unwrap(); + asset + }) + .chain((0..b).map(|i| unreachable!())) + .collect::>(); + + if a > 0 { + // check one of the assets of origin. + assert!(!T::FungiblesTransactAsset::balance(1u32.into(), &account::(1)).is_zero()); + } + + Xcm::WithdrawAsset::> { assets, effects: vec![] } + } else { + Xcm::TransferAsset { assets: Default::default(), dest: origin.clone() } + }; + }: { + if T::fungibles_asset(0, 0).is_some() { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } + } verify { + if T::fungibles_asset(0, 0).is_some() { + // check one of the assets of origin. All assets must have been withdrawn. + assert!(T::FungiblesTransactAsset::balance(1u32.into(), &account::(1)).is_zero()); + } + } + xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_query_response {}: {} verify {} xcm_transfer_asset_fungible { - let amount_balance = T::FungibleTransactAsset::minimum_balance() * 4u32.into(); - let amount: u128 = amount_balance.try_into().unwrap(); - let origin: MultiLocation = (account_id_junction::(1)).into(); - let asset = MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }; - >::deposit_asset(&asset, &origin).unwrap(); - - let dest = (account_id_junction::(2)).into(); - let assets = vec![ asset ]; - let xcm = Xcm::TransferAsset { assets, dest }; + let dest = account_id_junction::(2).into(); + + let xcm = if let Some((asset, amount)) = T::fungible_asset(1) { + >::deposit_asset(&asset, &origin).unwrap(); + let assets = vec![ asset ]; + assert!(T::FungibleTransactAsset::balance(&account::(2)).is_zero()); + Xcm::TransferAsset { assets, dest } + } else { + Xcm::TransferAsset { assets: Default::default(), dest } + }; }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + if T::fungible_asset(1).is_some() { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } } verify { - assert_eq!( - T::FungibleTransactAsset::balance(&account::(2)), - amount_balance, - ) + if T::fungible_asset(1).is_some() { + assert!(!T::FungibleTransactAsset::balance(&account::(2)).is_zero()); + } } - xcm_transfer_asset_fungibles { - let a in 1..MAX_ASSETS; - // TODO: incorporate Gav's note on the fact that the type of asset in the holding will affect the worse - // case. + xcm_transfer_asset_fungibles_per_asset { let origin: MultiLocation = (account_id_junction::(1)).into(); - - let assets = (0..a).map(|_| { - let amount_balance = T::FungiblesTransactAsset::minimum_balance(a.into()) * 4u32.into(); - let amount: u128 = amount_balance.try_into().unwrap(); - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: a as u128 }), - amount, - } - }).collect::>(); - let dest = (account_id_junction::(2)).into(); - let xcm = Xcm::TransferAsset { assets, dest }; + let asset_id = 9; + + let xcm = if let Some((asset, amount)) = T::fungibles_asset(1, asset_id) { + // Note that we deposit a new asset with twice the amount into the sender to prevent it + // being dying. + >::deposit_asset( + &T::fungibles_asset(2, asset_id) + .expect("call to fungibles_asset has already returned `Some`, this must work") + .0, + &origin + ).unwrap(); + + assert!(T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(1)).is_zero()); + + Xcm::TransferAsset { assets: vec![asset], dest } + } else { + Xcm::TransferAsset { assets: Default::default(), dest } + }; }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + if T::fungibles_asset(0, 0).is_some() { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } } verify { - for asset_id in 0..a { - assert_eq!( - T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)), - T::FungiblesTransactAsset::minimum_balance(asset_id.into()) * 4u32.into(), - ) + if T::fungibles_asset(0, 0).is_some() { + assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); } } xcm_transfer_reserved_asset_fungible {}: {} verify {} xcm_transfer_reserved_asset_fungibles {}: {} verify {} - xcm_transfer_reserved_asset_fungible_non {}: {} verify {} xcm_transact {}: {} verify {} xcm_hrmp_channel_open_request {}: {} verify {} @@ -280,29 +364,53 @@ mod benchmark_tests { use super::*; #[test] - fn order_deposit_asset_fungible_per_asset() { + fn order_deposit_asset_fungible() { crate::mock_fungible::new_test_ext().execute_with(|| { - test_benchmark_order_deposit_asset_fungible_per_asset::(); + test_bench_by_name::(b"order_deposit_asset_fungible") + .unwrap(); }) } #[test] fn order_deposit_asset_fungibles_per_asset() { crate::mock_fungibles::new_test_ext().execute_with(|| { - test_benchmark_order_deposit_asset_fungibles_per_asset::(); + test_bench_by_name::( + b"order_deposit_asset_fungibles_per_asset", + ) + .unwrap(); }) } #[test] fn xcm_transfer_asset_fungible() { crate::mock_fungible::new_test_ext().execute_with(|| { - test_benchmark_xcm_transfer_asset_fungible::(); + test_bench_by_name::(b"xcm_transfer_asset_fungible") + .unwrap(); }) } #[test] - fn xcm_transfer_asset_fungibles() { + fn xcm_transfer_asset_fungibles_per_asset() { + crate::mock_fungibles::new_test_ext().execute_with(|| { + test_bench_by_name::( + b"xcm_transfer_asset_fungibles_per_asset", + ) + .unwrap(); + }) + } + + #[test] + fn xcm_withdraw_asset_fungible() { + crate::mock_fungible::new_test_ext().execute_with(|| { + test_bench_by_name::(b"xcm_withdraw_asset_fungible") + .unwrap(); + }) + } + + #[test] + fn xcm_withdraw_asset_fungibles() { crate::mock_fungibles::new_test_ext().execute_with(|| { - test_benchmark_xcm_transfer_asset_fungibles::(); + test_bench_by_name::(b"xcm_withdraw_asset_fungibles") + .unwrap(); }) } } diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 564ec890897e..9f4e97147183 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -18,7 +18,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::Codec; pub use pallet::*; use xcm::v0::MultiAsset; @@ -35,6 +34,8 @@ pub mod weights; #[frame_support::pallet] pub mod pallet { + use crate::MultiAsset; + #[pallet::config] pub trait Config: frame_system::Config { /// The XCM configurations. @@ -43,9 +44,22 @@ pub mod pallet { /// `TransactAsset` is implemented. type XcmConfig: xcm_executor::Config; + /// Give me a fungible asset that your asset transactor is going to accept. Give me none if + /// you don't really want to support this type of asset. + /// + /// A fungible asset always has an amount, return that too. + fn fungible_asset(_amount: u32) -> Option<(MultiAsset, u128)> { + None + } + /// Same as `fungible_asset`, but for an asset of multiple instances. + fn fungibles_asset(_amount: u32, _id: u32) -> Option<(MultiAsset, u128)> { + None + } + type FungibleTransactAsset: frame_support::traits::fungible::Inspect; type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; - // type NonFungiblesTransactAsset: frame_support::traits::fungibles::Inspect; + // type NonFungibleTransactAsset: traits::tokens::nonfungible::Inspect; + // type NonFungiblesTransactAsset: traits::tokens::nonfungibles::Inspect; } // transact asset that works with balances and asset @@ -60,9 +74,9 @@ pub mod pallet { // With this, we measure all weights per asset, so NONE of the benchmarks need to have a component // that is the number of assets, that's pretty pointless. You need to iterate the `Vec` // down the road -enum AssetWeightType { +enum AssetTransactorType { Fungible, // Balances - Fungibles, // assets, + Fungibles, // Assets, NonFungible, // Uniques } diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs b/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs index 1fc47daac5cd..f733d861f6b6 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs @@ -17,16 +17,15 @@ //! A mock runtime for xcm benchmarking. use crate as pallet_xcm_benchmarks; -use crate::{mock_shared::*, *}; -use frame_support::{parameter_types, traits::Contains, weights::Weight}; +use crate::mock_shared::*; +use frame_support::parameter_types; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; -use xcm_executor::AssetId; +use xcm::opaque::v0::{MultiAsset, MultiLocation}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -104,7 +103,6 @@ impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { fn matches_fungible(m: &MultiAsset) -> Option { use sp_runtime::traits::SaturatedConversion; match m { - // TODO: MultiAsset::ConcreteFungible { amount, .. } => Some((*amount).saturated_into::()), _ => None, } @@ -141,6 +139,13 @@ impl xcm_executor::Config for XcmConfig { impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; + + fn fungible_asset(amount: u32) -> Option<(MultiAsset, u128)> { + let amount = >::minimum_balance() + as u128 * amount as u128; + Some((MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }, amount)) + } + type FungibleTransactAsset = Balances; type FungiblesTransactAsset = crate::AsFungibles; } diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs b/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs index 95424ac7937c..1f072f960960 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs @@ -18,15 +18,17 @@ use crate as pallet_xcm_benchmarks; use crate::{mock_shared::*, *}; -use frame_support::{parameter_types, traits::Contains, weights::Weight}; +use frame_support::{parameter_types, traits::Contains}; use sp_core::H256; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, IdentityLookup, Zero}, BuildStorage, }; -use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; -use xcm_executor::AssetId; +use xcm::{ + opaque::v0::{MultiAsset, MultiLocation}, + v0::Junction, +}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -50,6 +52,7 @@ parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(1024); } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::AllowAll; type BlockWeights = (); @@ -129,13 +132,10 @@ impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { // ^^ TODO: this error is too out of scope. use sp_runtime::traits::SaturatedConversion; match m { - // TODO: - MultiAsset::ConcreteFungible { amount, .. } => Ok( - ( - 0, - (*amount).saturated_into::(), - ) - ), + MultiAsset::ConcreteFungible { + amount, + id: MultiLocation::X1(Junction::GeneralIndex { id }), + } => Ok(((*id).saturated_into(), (*amount).saturated_into::())), _ => Err(xcm_executor::traits::Error::AssetNotFound), } } @@ -169,8 +169,29 @@ impl xcm_executor::Config for XcmConfig { type ResponseHandler = DevNull; } +use frame_support::traits::fungibles::Inspect; impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; + + fn fungibles_asset(amount: u32, id: u32) -> Option<(MultiAsset, u128)> { + // create this asset, if it does not exists. + if >::minimum_balance(id).is_zero() { + assert!(!ExistentialDeposit::get().is_zero()); + let root = frame_system::RawOrigin::Root.into(); + assert!(Assets::force_create(root, id, 777, true, ExistentialDeposit::get(),).is_ok()); + assert!(!>::minimum_balance(id).is_zero()); + } + + let amount = >::minimum_balance(id) as u128 * amount as u128; + Some(( + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: id.into() }), + amount, + }, + amount, + )) + } + type FungibleTransactAsset = Balances; type FungiblesTransactAsset = Assets; } diff --git a/xcm/pallet-xcm-benchmarks/src/mock_shared.rs b/xcm/pallet-xcm-benchmarks/src/mock_shared.rs index 9b1607cce575..19e30a9f7a39 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock_shared.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock_shared.rs @@ -14,17 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use crate as pallet_xcm_benchmarks; use crate::*; -use frame_support::{parameter_types, traits::Contains, weights::Weight}; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; -use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiAsset, MultiLocation, Response, Xcm}; -use xcm_executor::AssetId; +use frame_support::{parameter_types, weights::Weight}; +use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiLocation, Response, Xcm}; pub struct YesItShould(sp_std::marker::PhantomData); impl xcm_executor::traits::ShouldExecute for YesItShould { diff --git a/xcm/xcm-builder/src/fungibles_adapter.rs b/xcm/xcm-builder/src/fungibles_adapter.rs index 80cd74c0124d..e591c940be33 100644 --- a/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/xcm/xcm-builder/src/fungibles_adapter.rs @@ -94,14 +94,15 @@ impl< } pub struct FungiblesTransferAdapter( - PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)> + PhantomData<(Assets, Matcher, AccountIdConverter, AccountId)>, ); impl< - Assets: fungibles::Transfer, - Matcher: MatchesFungibles, - AccountIdConverter: Convert, - AccountId: Clone, // can't get away without it since Currency is generic over it. -> TransactAsset for FungiblesTransferAdapter { + Assets: fungibles::Transfer, + Matcher: MatchesFungibles, + AccountIdConverter: Convert, + AccountId: Clone, // can't get away without it since Currency is generic over it. + > TransactAsset for FungiblesTransferAdapter +{ fn transfer_asset( what: &MultiAsset, from: &MultiLocation, @@ -119,17 +120,31 @@ impl< } } -pub struct FungiblesMutateAdapter( - PhantomData<(Assets, Matcher, AccountIdConverter, AccountId, CheckAsset, CheckingAccount)> -); +pub struct FungiblesMutateAdapter< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, +>(PhantomData<(Assets, Matcher, AccountIdConverter, AccountId, CheckAsset, CheckingAccount)>); impl< - Assets: fungibles::Mutate, - Matcher: MatchesFungibles, - AccountIdConverter: Convert, - AccountId: Clone, // can't get away without it since Currency is generic over it. - CheckAsset: Contains, - CheckingAccount: Get, -> TransactAsset for FungiblesMutateAdapter { + Assets: fungibles::Mutate, + Matcher: MatchesFungibles, + AccountIdConverter: Convert, + AccountId: Clone, // can't get away without it since Currency is generic over it. + CheckAsset: Contains, + CheckingAccount: Get, + > TransactAsset + for FungiblesMutateAdapter< + Assets, + Matcher, + AccountIdConverter, + AccountId, + CheckAsset, + CheckingAccount, + > +{ fn can_check_in(_origin: &MultiLocation, what: &MultiAsset) -> Result { // Check we handle this asset. let (asset_id, amount) = Matcher::matches_fungibles(what)?; @@ -174,7 +189,7 @@ impl< fn withdraw_asset( what: &MultiAsset, - who: &MultiLocation + who: &MultiLocation, ) -> result::Result { // Check we handle this asset. let (asset_id, amount) = Matcher::matches_fungibles(what)?; From d61c25520574272fe434115f9f315b3d71cf936a Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 2 Aug 2021 18:58:54 +0200 Subject: [PATCH 13/63] remove files --- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 5 + xcm/pallet-xcm-benchmarks/src/weights.rs | 184 ------------------ 2 files changed, 5 insertions(+), 184 deletions(-) delete mode 100644 xcm/pallet-xcm-benchmarks/src/weights.rs diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index 6643ccad695a..cf02aef7d98c 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -106,6 +106,11 @@ fn account_id_junction(index: u32) -> Junction { Junction::AccountId32 { network: NetworkId::Any, id } } +// Thoughts: +// +// All XCMs should have all of their internals as parameter, regardless of it being used or not. +// This is because some implementations might need them and depend upon them, and some might not. + // Rationale: // // Benchmarks ending with _fungible typically indicate the case where there is only one asset in diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs deleted file mode 100644 index da8ae2d74a34..000000000000 --- a/xcm/pallet-xcm-benchmarks/src/weights.rs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::*}; -use sp_runtime::traits::Saturating; -use xcm::v0::{GetWeight, Order, Xcm}; -use xcm_executor::traits::WeightBounds; - -pub trait WeightInfo { - fn send_xcm() -> Weight; - fn order_null() -> Weight; - fn order_deposit_asset() -> Weight; - fn order_deposit_reserved_asset() -> Weight; - fn order_exchange_asset() -> Weight; - fn order_initiate_reserve_withdraw() -> Weight; - fn order_initiate_teleport() -> Weight; - fn order_query_holding() -> Weight; - fn order_buy_execution() -> Weight; - fn xcm_withdraw_asset() -> Weight; - fn xcm_reserve_asset_deposit() -> Weight; - fn xcm_teleport_asset() -> Weight; - fn xcm_query_response() -> Weight; - fn xcm_transfer_asset() -> Weight; - fn xcm_transfer_reserved_asset() -> Weight; - fn xcm_transact() -> Weight; - fn xcm_hrmp_channel_open_request() -> Weight; - fn xcm_hrmp_channel_accepted() -> Weight; - fn xcm_hrmp_channel_closing() -> Weight; - fn xcm_relayed_from() -> Weight; -} - -pub struct XcmWeight(PhantomData); -impl WeightInfo for XcmWeight { - fn send_xcm() -> Weight { - 10 - } - fn order_null() -> Weight { - 10 - } - fn order_deposit_asset() -> Weight { - 10 - } - fn order_deposit_reserved_asset() -> Weight { - 10 - } - fn order_exchange_asset() -> Weight { - 10 - } - fn order_initiate_reserve_withdraw() -> Weight { - 10 - } - fn order_initiate_teleport() -> Weight { - 10 - } - fn order_query_holding() -> Weight { - 10 - } - fn order_buy_execution() -> Weight { - 10 - } - fn xcm_withdraw_asset() -> Weight { - 10 - } - fn xcm_reserve_asset_deposit() -> Weight { - 10 - } - fn xcm_teleport_asset() -> Weight { - 10 - } - fn xcm_query_response() -> Weight { - 10 - } - fn xcm_transfer_asset() -> Weight { - 10 - } - fn xcm_transfer_reserved_asset() -> Weight { - 10 - } - fn xcm_transact() -> Weight { - 10 - } - fn xcm_hrmp_channel_open_request() -> Weight { - 10 - } - fn xcm_hrmp_channel_accepted() -> Weight { - 10 - } - fn xcm_hrmp_channel_closing() -> Weight { - 10 - } - fn xcm_relayed_from() -> Weight { - 10 - } -} - -struct FinalXcmWeight(PhantomData<(W, C)>); -impl WeightBounds for FinalXcmWeight -where - W: WeightInfo, - C: Decode + GetDispatchInfo, - Xcm: GetWeight, - Order: GetWeight, -{ - fn shallow(message: &mut Xcm) -> Result { - let weight = match message { - Xcm::RelayedFrom { ref mut message, .. } => { - let relay_message_weight = Self::shallow(message.as_mut())?; - message.weight().saturating_add(relay_message_weight) - }, - // These XCM - Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposit { effects, .. } | - Xcm::TeleportAsset { effects, .. } => { - let inner: Weight = effects.iter_mut().map(|effect| effect.weight()).sum(); - message.weight().saturating_add(inner) - }, - // The shallow weight of `Transact` is the full weight of the message, thus there is no - // deeper weight. - Xcm::Transact { call, .. } => { - let call_weight = call.ensure_decoded()?.get_dispatch_info().weight; - message.weight().saturating_add(call_weight) - }, - // These - Xcm::QueryResponse { .. } | - Xcm::TransferAsset { .. } | - Xcm::TransferReserveAsset { .. } | - Xcm::HrmpNewChannelOpenRequest { .. } | - Xcm::HrmpChannelAccepted { .. } | - Xcm::HrmpChannelClosing { .. } => message.weight(), - }; - - Ok(weight) - } - - fn deep(message: &mut Xcm) -> Result { - let weight = match message { - // `RelayFrom` needs to account for the deep weight of the internal message. - Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, - // These XCM have internal effects which are not accounted for in the `shallow` weight. - Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposit { effects, .. } | - Xcm::TeleportAsset { effects, .. } => { - let mut extra = 0; - for effect in effects.iter_mut() { - match effect { - Order::BuyExecution { xcm, .. } => - for message in xcm.iter_mut() { - extra.saturating_accrue({ - let shallow = Self::shallow(message)?; - let deep = Self::deep(message)?; - shallow.saturating_add(deep) - }); - }, - _ => {}, - } - } - extra - }, - // These XCM do not have any deeper weight. - Xcm::Transact { .. } | - Xcm::QueryResponse { .. } | - Xcm::TransferAsset { .. } | - Xcm::TransferReserveAsset { .. } | - Xcm::HrmpNewChannelOpenRequest { .. } | - Xcm::HrmpChannelAccepted { .. } | - Xcm::HrmpChannelClosing { .. } => 0, - }; - - Ok(weight) - } -} From 139e1aa828ce2adbd497ec0c720a12107cf88217 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 2 Aug 2021 20:59:39 +0200 Subject: [PATCH 14/63] Update traits.rs --- xcm/src/v0/traits.rs | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index c18498b0ba8d..73f14d59ffd7 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -261,27 +261,28 @@ impl SendXcm for Tuple { } // The info needed to weight an XCM. -pub trait XcmWeightInfo { +pub trait XcmWeightInfo { fn send_xcm() -> Weight; fn order_null() -> Weight; - fn order_deposit_asset() -> Weight; - fn order_deposit_reserved_asset() -> Weight; - fn order_exchange_asset() -> Weight; - fn order_initiate_reserve_withdraw() -> Weight; - fn order_initiate_teleport() -> Weight; - fn order_query_holding() -> Weight; - fn order_buy_execution() -> Weight; - fn xcm_withdraw_asset() -> Weight; - fn xcm_reserve_asset_deposit() -> Weight; - fn xcm_teleport_asset() -> Weight; - fn xcm_query_response() -> Weight; - fn xcm_transfer_asset() -> Weight; - fn xcm_transfer_reserved_asset() -> Weight; - fn xcm_transact() -> Weight; - fn xcm_hrmp_channel_open_request() -> Weight; - fn xcm_hrmp_channel_accepted() -> Weight; - fn xcm_hrmp_channel_closing() -> Weight; - fn xcm_relayed_from() -> Weight; + fn order_deposit_asset(assets: Vec, dest: MultiLocation) -> Weight; + fn order_deposit_reserved_asset(assets: Vec, dest: MultiLocation, effects: Vec>) -> Weight; + fn order_exchange_asset(give: Vec, receive: Vec) -> Weight; + fn order_initiate_reserve_withdraw(assets: Vec, reserve: MultiLocation, effects: Vec>) -> Weight; + fn order_initiate_teleport(assets: Vec, dest: MultiLocation, effects: Vec>) -> Weight; + fn order_query_holding(query_id: u64, dest: MultiLocation, assets: Vec) -> Weight; + fn order_buy_execution(fees: MultiAsset, weight: u64, debt: u64, halt_on_error: bool, xcm: Vec>) -> Weight; + fn xcm_withdraw_asset(assets: Vec, effects: Vec>) -> Weight; + fn xcm_reserve_asset_deposit(assets: Vec, effects: Vec>) -> Weight; + fn xcm_teleport_asset(assets: Vec, effects: Vec>) -> Weight; + fn xcm_query_response(query_id: u64, response: Response) -> Weight; + fn xcm_transfer_asset(assets: Vec, dest: MultiLocation) -> Weight; + fn xcm_transfer_reserved_asset(assets: Vec, dest: MultiLocation) -> Weight; + // TODO: Maybe remove call + fn xcm_transact(origin_type: OriginKind, require_weight_at_most: u64, call: DoubleEncoded) -> Weight; + fn xcm_hrmp_channel_open_request(sender: u32, max_message_size: u32, max_capacity: u32) -> Weight; + fn xcm_hrmp_channel_accepted(recipient: u32) -> Weight; + fn xcm_hrmp_channel_closing(initiator: u32, sender: u32, recipient: u32) -> Weight; + fn xcm_relayed_from(who: MultiLocation, message: alloc::boxed::Box) -> Weight; } // A simple trait to get the weight of some object. From 145f5221fbce7808a619edb3d00e3824d43c70f4 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 2 Aug 2021 21:46:45 +0200 Subject: [PATCH 15/63] stuff --- runtime/westend/src/lib.rs | 256 +++++++++--------- runtime/westend/src/xcm_weights/mod.rs | 131 +++++++++ .../src/xcm_weights/pallet_balances.rs | 42 +++ .../westend/src/xcm_weights/xcm_generic.rs | 24 ++ xcm/output/all_xcm.rs | 29 ++ xcm/output/xcm_assets_pallet.rs | 63 +++++ xcm/output/xcm_balances_pallet.rs | 63 +++++ xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 96 +++---- xcm/pallet-xcm-benchmarks/src/lib.rs | 14 +- xcm/pallet-xcm-benchmarks/src/weights.rs | 72 +++++ xcm/src/v0/mod.rs | 29 +- xcm/src/v0/order.rs | 21 +- xcm/src/v0/traits.rs | 75 +++-- xcm/xcm-executor/src/traits/weight.rs | 81 +++++- 14 files changed, 758 insertions(+), 238 deletions(-) create mode 100644 runtime/westend/src/xcm_weights/mod.rs create mode 100644 runtime/westend/src/xcm_weights/pallet_balances.rs create mode 100644 runtime/westend/src/xcm_weights/xcm_generic.rs create mode 100644 xcm/output/all_xcm.rs create mode 100644 xcm/output/xcm_assets_pallet.rs create mode 100644 xcm/output/xcm_balances_pallet.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/weights.rs diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 93ffa5441bde..0e9d39cea9bb 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -21,90 +21,90 @@ #![recursion_limit = "256"] use pallet_transaction_payment::CurrencyAdapter; -use sp_std::prelude::*; -use sp_std::collections::btree_map::BTreeMap; -use parity_scale_codec::{Encode, Decode, MaxEncodedLen}; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use primitives::v1::{ AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt, - CoreState, GroupRotationInfo, Hash, Id as ParaId, Moment, Nonce, OccupiedCoreAssumption, - PersistedValidationData, Signature, ValidationCode, ValidationCodeHash, ValidatorId, - ValidatorIndex, InboundDownwardMessage, InboundHrmpMessage, SessionInfo, + CoreState, GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, + Moment, Nonce, OccupiedCoreAssumption, PersistedValidationData, SessionInfo, Signature, + ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, }; use runtime_common::{ - paras_sudo_wrapper, paras_registrar, xcm_sender, slots, crowdloan, auctions, - SlowAdjustingFeeUpdate, CurrencyToVote, - impls::ToAuthor, - BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, - OffchainSolutionWeightLimit, OffchainSolutionLengthLimit, + auctions, crowdloan, impls::ToAuthor, paras_registrar, paras_sudo_wrapper, slots, xcm_sender, + BlockHashCount, BlockLength, BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit, + OffchainSolutionWeightLimit, RocksDbWeight, SlowAdjustingFeeUpdate, +}; +use sp_std::{collections::btree_map::BTreeMap, prelude::*}; + +use runtime_parachains::{ + configuration as parachains_configuration, dmp as parachains_dmp, hrmp as parachains_hrmp, + inclusion as parachains_inclusion, initializer as parachains_initializer, + origin as parachains_origin, paras as parachains_paras, + paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points, + runtime_api_impl::v1 as parachains_runtime_api_impl, scheduler as parachains_scheduler, + session_info as parachains_session_info, shared as parachains_shared, ump as parachains_ump, }; -use runtime_parachains::origin as parachains_origin; -use runtime_parachains::configuration as parachains_configuration; -use runtime_parachains::shared as parachains_shared; -use runtime_parachains::inclusion as parachains_inclusion; -use runtime_parachains::paras_inherent as parachains_paras_inherent; -use runtime_parachains::initializer as parachains_initializer; -use runtime_parachains::session_info as parachains_session_info; -use runtime_parachains::paras as parachains_paras; -use runtime_parachains::dmp as parachains_dmp; -use runtime_parachains::ump as parachains_ump; -use runtime_parachains::hrmp as parachains_hrmp; -use runtime_parachains::scheduler as parachains_scheduler; -use runtime_parachains::reward_points as parachains_reward_points; -use runtime_parachains::runtime_api_impl::v1 as parachains_runtime_api_impl; - -use xcm::v0::{MultiLocation::{self, Null, X1}, NetworkId, Xcm, Junction::Parachain}; -use xcm::v0::MultiAsset::{self, AllConcreteFungible}; -use xcm_executor::XcmExecutor; +use xcm::v0::{ + Junction::Parachain, + MultiAsset::{self, AllConcreteFungible}, + MultiLocation::{self, Null, X1}, + NetworkId, Xcm, +}; use xcm_builder::{ - AccountId32Aliases, ChildParachainConvertsVia, SovereignSignedViaLocation, CurrencyAdapter as XcmCurrencyAdapter, - ChildParachainAsNative, SignedAccountId32AsNative, ChildSystemParachainAsSuperuser, LocationInverter, IsConcrete, - FixedWeightBounds, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - IsChildSystemParachain, UsingComponents, SignedToAccountId32, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, + CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete, + LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, + TakeWeightCredit, UsingComponents, }; +use xcm_executor::XcmExecutor; +use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; +use beefy_primitives::crypto::AuthorityId as BeefyId; +use frame_support::{ + construct_runtime, parameter_types, + traits::{All, Filter, InstanceFilter, KeyOwnerProofSystem, OnRuntimeUpgrade}, + weights::Weight, + PalletId, RuntimeDebug, +}; +use frame_system::EnsureRoot; +use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use pallet_mmr_primitives as mmr; +use pallet_session::historical as session_historical; +use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; +use sp_core::OpaqueMetadata; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, - ApplyExtrinsicResult, KeyTypeId, Perbill, curve::PiecewiseLinear, - transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, + create_runtime_str, + curve::PiecewiseLinear, + generic, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, - Extrinsic as ExtrinsicT, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, + OpaqueKeys, SaturatedConversion, Verify, }, + transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, KeyTypeId, Perbill, }; -use sp_version::RuntimeVersion; -use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] use sp_version::NativeVersion; -use sp_core::OpaqueMetadata; -use sp_staking::SessionIndex; -use frame_support::{ - parameter_types, construct_runtime, RuntimeDebug, PalletId, - traits::{KeyOwnerProofSystem, Filter, InstanceFilter, All, OnRuntimeUpgrade}, - weights::Weight, -}; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; -use pallet_session::historical as session_historical; -use frame_system::{EnsureRoot}; -use beefy_primitives::crypto::AuthorityId as BeefyId; -use pallet_mmr_primitives as mmr; +use sp_version::RuntimeVersion; +pub use pallet_balances::Call as BalancesCall; +pub use pallet_election_provider_multi_phase::Call as EPMCall; #[cfg(feature = "std")] pub use pallet_staking::StakerStatus; +pub use pallet_timestamp::Call as TimestampCall; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use pallet_timestamp::Call as TimestampCall; -pub use pallet_balances::Call as BalancesCall; -pub use pallet_election_provider_multi_phase::Call as EPMCall; /// Constant values used within the runtime. pub mod constants; -use constants::{time::*, currency::*, fee::*}; +use constants::{currency::*, fee::*, time::*}; // Weights used in the runtime mod weights; +mod xcm_weights; #[cfg(test)] mod tests; @@ -131,16 +131,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { pub const BABE_GENESIS_EPOCH_CONFIG: babe_primitives::BabeEpochConfiguration = babe_primitives::BabeEpochConfiguration { c: PRIMARY_PROBABILITY, - allowed_slots: babe_primitives::AllowedSlots::PrimaryAndSecondaryVRFSlots + allowed_slots: babe_primitives::AllowedSlots::PrimaryAndSecondaryVRFSlots, }; /// Native version. #[cfg(any(feature = "std", test))] pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } /// Allow everything. @@ -417,7 +414,8 @@ parameter_types! { } impl pallet_staking::Config for Runtime { - const MAX_NOMINATIONS: u32 = ::LIMIT as u32; + const MAX_NOMINATIONS: u32 = + ::LIMIT as u32; type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVote; @@ -437,7 +435,7 @@ impl pallet_staking::Config for Runtime { type ElectionProvider = ElectionProviderMultiPhase; type GenesisElectionProvider = frame_election_provider_support::onchain::OnChainSequentialPhragmen< - pallet_election_provider_multi_phase::OnChainConfig + pallet_election_provider_multi_phase::OnChainConfig, >; type WeightInfo = weights::pallet_staking::WeightInfo; } @@ -491,15 +489,19 @@ impl pallet_grandpa::Config for Runtime { GrandpaId, )>>::IdentificationTuple; - type HandleEquivocation = - pallet_grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler< + Self::KeyOwnerIdentification, + Offences, + ReportLongevity, + >; type WeightInfo = (); } /// Submits a transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl frame_system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime +where Call: From, { fn create_transaction>( @@ -510,10 +512,8 @@ impl frame_system::offchain::CreateSignedTransaction for R ) -> Option<(Call, ::SignaturePayload)> { use sp_runtime::traits::StaticLookup; // take the biggest period possible. - let period = BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; + let period = + BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; let current_block = System::block_number() .saturated_into::() @@ -525,17 +525,20 @@ impl frame_system::offchain::CreateSignedTransaction for R frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), frame_system::CheckGenesis::::new(), - frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckMortality::::from(generic::Era::mortal( + period, + current_block, + )), frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), ); - let raw_payload = SignedPayload::new(call, extra).map_err(|e| { - log::warn!("Unable to create signed payload: {:?}", e); - }).ok()?; - let signature = raw_payload.using_encoded(|payload| { - C::sign(payload, public) - })?; + let raw_payload = SignedPayload::new(call, extra) + .map_err(|e| { + log::warn!("Unable to create signed payload: {:?}", e); + }) + .ok()?; + let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let (call, extra, _) = raw_payload.deconstruct(); let address = ::Lookup::unlookup(account); Some((call, (address, signature, extra))) @@ -547,7 +550,8 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -impl frame_system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime +where Call: From, { type OverarchingCall = Call; @@ -649,7 +653,9 @@ parameter_types! { } /// The type used to represent the kinds of proxying allowed. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen)] +#[derive( + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, +)] pub enum ProxyType { Any, NonTransfer, @@ -658,12 +664,17 @@ pub enum ProxyType { IdentityJudgement, CancelProxy, } -impl Default for ProxyType { fn default() -> Self { Self::Any } } +impl Default for ProxyType { + fn default() -> Self { + Self::Any + } +} impl InstanceFilter for ProxyType { fn filter(&self, c: &Call) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => matches!(c, + ProxyType::NonTransfer => matches!( + c, Call::System(..) | Call::Babe(..) | Call::Timestamp(..) | @@ -699,26 +710,22 @@ impl InstanceFilter for ProxyType { Call::Registrar(paras_registrar::Call::reserve(..)) | Call::Crowdloan(..) | Call::Slots(..) | - Call::Auctions(..) - // Specifically omitting the entire XCM Pallet - ), - ProxyType::Staking => matches!(c, - Call::Staking(..) | - Call::Session(..) | - Call::Utility(..) + Call::Auctions(..) // Specifically omitting the entire XCM Pallet ), + ProxyType::Staking => + matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)), ProxyType::SudoBalances => match c { - Call::Sudo(pallet_sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)), + Call::Sudo(pallet_sudo::Call::sudo(ref x)) => + matches!(x.as_ref(), &Call::Balances(..)), Call::Utility(..) => true, _ => false, }, - ProxyType::IdentityJudgement => matches!(c, - Call::Identity(pallet_identity::Call::provide_judgement(..)) | - Call::Utility(..) + ProxyType::IdentityJudgement => matches!( + c, + Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..) ), - ProxyType::CancelProxy => matches!(c, - Call::Proxy(pallet_proxy::Call::reject_announcement(..)) - ) + ProxyType::CancelProxy => + matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))), } } fn is_superset(&self, o: &Self) -> bool { @@ -869,24 +876,21 @@ parameter_types! { pub CheckAccount: AccountId = XcmPallet::check_account(); } -pub type LocationConverter = ( - ChildParachainConvertsVia, - AccountId32Aliases, -); - -pub type LocalAssetTransactor = - XcmCurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // We can convert the MultiLocations with our converter above: - LocationConverter, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // It's a native asset so we keep track of the teleports to maintain total issuance. - CheckAccount, - >; +pub type LocationConverter = + (ChildParachainConvertsVia, AccountId32Aliases); + +pub type LocalAssetTransactor = XcmCurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // We can convert the MultiLocations with our converter above: + LocationConverter, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // It's a native asset so we keep track of the teleports to maintain total issuance. + CheckAccount, +>; type LocalOriginConverter = ( SovereignSignedViaLocation, @@ -910,9 +914,7 @@ parameter_types! { pub const WestendForWestmint: (MultiAsset, MultiLocation) = (AllConcreteFungible { id: Null }, X1(Parachain(1000))); } -pub type TrustedTeleporters = ( - xcm_builder::Case, -); +pub type TrustedTeleporters = (xcm_builder::Case,); /// The barriers one of which must be passed for an XCM message to be executed. pub type Barrier = ( @@ -947,11 +949,15 @@ pub type LocalOriginToLocation = ( ); pub struct OnlyWithdrawTeleportForAccounts; -impl frame_support::traits::Contains<(MultiLocation, Xcm)> for OnlyWithdrawTeleportForAccounts { +impl frame_support::traits::Contains<(MultiLocation, Xcm)> + for OnlyWithdrawTeleportForAccounts +{ fn contains((ref origin, ref msg): &(MultiLocation, Xcm)) -> bool { use xcm::v0::{ - Xcm::WithdrawAsset, Order::{BuyExecution, InitiateTeleport, DepositAsset}, - MultiAsset::{All, ConcreteFungible}, Junction::AccountId32, + Junction::AccountId32, + MultiAsset::{All, ConcreteFungible}, + Order::{BuyExecution, DepositAsset, InitiateTeleport}, + Xcm::WithdrawAsset, }; match origin { // Root is allowed to execute anything. @@ -986,7 +992,7 @@ impl frame_support::traits::Contains<(MultiLocation, Xcm)> for OnlyWithdra ) ) ) - } + }, // Nobody else is allowed to execute anything. _ => false, } @@ -1126,9 +1132,9 @@ pub struct MigratePalletVersionToStorageVersion; impl OnRuntimeUpgrade for MigratePalletVersionToStorageVersion { fn on_runtime_upgrade() -> frame_support::weights::Weight { - frame_support::migrations::migrate_from_pallet_version_to_storage_version::( - &RocksDbWeight::get() - ) + frame_support::migrations::migrate_from_pallet_version_to_storage_version::< + AllPalletsWithSystem, + >(&RocksDbWeight::get()) } } diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs new file mode 100644 index 000000000000..cde35f11b0f3 --- /dev/null +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -0,0 +1,131 @@ +mod pallet_balances; +mod xcm_generic; + +use pallet_balances::WeightInfo as PalletBalances; +use xcm_generic::WeightInfo as XcmGeneric; + +pub enum AssetTypes { + Balances, +} + +impl From for AssetTypes { + fn from(asset: MultiAsset) -> Self { + match self { + _ => Balances, + } + } +} + +pub struct WestendXcmWeight; +impl XcmWeightInfo for WestendXcmWeight { + fn send_xcm() -> Weight { + XcmGeneric::send_xcm() + } + fn order_null() -> Weight { + XcmGeneric::order_null() + } + fn order_deposit_asset(assets: Vec, dest: MultiLocation) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_deposit_asset(), + }) + } + fn order_deposit_reserved_asset( + assets: Vec, + dest: MultiLocation, + effects: Vec>, + ) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_deposit_reserved_asset(), + }) + } + fn order_exchange_asset(give: Vec, receive: Vec) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_exchange_asset(), + }) + } + fn order_initiate_reserve_withdraw( + assets: Vec, + reserve: MultiLocation, + effects: Vec>, + ) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_initiate_reserve_withdraw(), + }) + } + fn order_initiate_teleport( + assets: Vec, + dest: MultiLocation, + effects: Vec>, + ) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_initiate_teleport(), + }) + } + fn order_query_holding(query_id: u64, dest: MultiLocation, assets: Vec) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::order_query_holding(), + }) + } + fn order_buy_execution( + fees: MultiAsset, + weight: u64, + debt: u64, + halt_on_error: bool, + xcm: Vec>, + ) -> Weight { + XcmGeneric::order_buy_execution + } + fn xcm_withdraw_asset(assets: Vec, effects: Vec>) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::xcm_withdraw_asset(), + }) + } + fn xcm_reserve_asset_deposit(assets: Vec, effects: Vec>) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::xcm_reserve_asset_deposit(), + }) + } + // TODO none of these need effects + fn xcm_teleport_asset(assets: Vec, effects: Vec>) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::xcm_teleport_asset(), + }) + } + fn xcm_query_response(query_id: u64, response: Response) -> Weight { + XcmGeneric::xcm_query_response() + } + fn xcm_transfer_asset(assets: Vec, dest: MultiLocation) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::xcm_transfer_asset(), + }) + } + fn xcm_transfer_reserved_asset(assets: Vec, dest: MultiLocation) -> Weight { + assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + AssetType::Balances => PalletBalances::xcm_transfer_reserved_asset(), + }) + } + // TODO: Maybe remove call + fn xcm_transact( + origin_type: OriginKind, + require_weight_at_most: u64, + call: DoubleEncoded, + ) -> Weight { + XcmGeneric::xcm_transact() + } + fn xcm_hrmp_channel_open_request( + sender: u32, + max_message_size: u32, + max_capacity: u32, + ) -> Weight { + XcmGeneric::xcm_hrmp_channel_open_request() + } + fn xcm_hrmp_channel_accepted(recipient: u32) -> Weight { + XcmGeneric::xcm_hrmp_channel_accepted() + } + fn xcm_hrmp_channel_closing(initiator: u32, sender: u32, recipient: u32) -> Weight { + XcmGeneric::xcm_hrmp_channel_accepted() + } + fn xcm_relayed_from(who: MultiLocation, message: alloc::boxed::Box>) -> Weight { + XcmGeneric::xcm_relayed_from() + } +} diff --git a/runtime/westend/src/xcm_weights/pallet_balances.rs b/runtime/westend/src/xcm_weights/pallet_balances.rs new file mode 100644 index 000000000000..ed7bcf7577fc --- /dev/null +++ b/runtime/westend/src/xcm_weights/pallet_balances.rs @@ -0,0 +1,42 @@ +pub struct WeightInfo(PhantomData); +impl WeightInfo { + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw() -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset() -> Weight { + 10 + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } +} diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs new file mode 100644 index 000000000000..e1db3f8fd043 --- /dev/null +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -0,0 +1,24 @@ +pub struct WeightInfo(PhantomData); +impl WeightInfo { + fn send_xcm() -> Weight { + 10 + } + fn order_null() -> Weight { + 10 + } + fn xcm_transact() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + 10 + } + fn xcm_hrmp_channel_accepted() -> Weight { + 10 + } + fn xcm_hrmp_channel_closing() -> Weight { + 10 + } + fn xcm_relayed_from() -> Weight { + 10 + } +} diff --git a/xcm/output/all_xcm.rs b/xcm/output/all_xcm.rs new file mode 100644 index 000000000000..f96f27abbef8 --- /dev/null +++ b/xcm/output/all_xcm.rs @@ -0,0 +1,29 @@ +use crate::{XcmAssetsWeightInfo, XcmBalancesWeightInfo}; + +pub enum AssetTypes { + Assets, + Balances, +} + +impl GetWeightInfoSingle for AssetTypes { + fn xcm_withdraw_asset(&self) -> Weight { + 10 + } +} + +impl From for AssetTypes { + fn from(_: MultiAsset) +} + +pub struct FinalWeightWhatever; +impl XcmWeightInfo for FinalWeightWhatever { + fn xcm_withdraw_asset(assets: Vec, effects: Vec) -> Weight { + assets.into_iter().map(|a| a.into::()).map(|t| + match t { + AsstType::Assets => XcmAssetsWeightInfo::xcm_withdraw_asset(), + AssetType::Balances => XcmBalancesWeightInfo::xcm_withdraw_asset() + } + .sum() + } + +} diff --git a/xcm/output/xcm_assets_pallet.rs b/xcm/output/xcm_assets_pallet.rs new file mode 100644 index 000000000000..faef822470d9 --- /dev/null +++ b/xcm/output/xcm_assets_pallet.rs @@ -0,0 +1,63 @@ +pub struct XcmAssetsWeightInfo(PhantomData); +impl WeightInfoSingle for XcmAssetsWeightInfo { + fn send_xcm() -> Weight { + 10 + } + fn order_null() -> Weight { + 10 + } + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw(&self) -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset() -> Weight { + 10 + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } + fn xcm_transact() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + 10 + } + fn xcm_hrmp_channel_accepted() -> Weight { + 10 + } + fn xcm_hrmp_channel_closing() -> Weight { + 10 + } + fn xcm_relayed_from() -> Weight { + 10 + } +} diff --git a/xcm/output/xcm_balances_pallet.rs b/xcm/output/xcm_balances_pallet.rs new file mode 100644 index 000000000000..2d6f584da306 --- /dev/null +++ b/xcm/output/xcm_balances_pallet.rs @@ -0,0 +1,63 @@ +pub struct XcmBalanceWeightInfo(PhantomData); +impl XcmBalanceWeightInfo { + fn send_xcm() -> Weight { + 10 + } + fn order_null() -> Weight { + 10 + } + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw() -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset() -> Weight { + 10 + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } + fn xcm_transact() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + 10 + } + fn xcm_hrmp_channel_accepted() -> Weight { + 10 + } + fn xcm_hrmp_channel_closing() -> Weight { + 10 + } + fn xcm_relayed_from() -> Weight { + 10 + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs index cf02aef7d98c..5051b83174fd 100644 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs @@ -60,11 +60,9 @@ fn create_holding( } .into() }) - .chain((0..non_fungibles_count).map(|i| { - MultiAsset::ConcreteNonFungible { - class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - instance: asset_instance_from(i), - } + .chain((0..non_fungibles_count).map(|i| MultiAsset::ConcreteNonFungible { + class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), + instance: asset_instance_from(i), })) .collect::>() .into() @@ -231,73 +229,45 @@ benchmarks! { order_buy_execution_fungible {}: {} verify {} order_buy_execution_fungibles {}: {} verify {} - - // Xcm::WithdrawAsset notes: There are two components to this benchmark: - // 1. based on the asset type, the complexity of withdraw could be different. - // 2. based on the length of the assets being withdraw, the complexity of insertion into the - // holding increases per operation. - // - // The worse case of the latter is if all assets are of one type (fungible, or non-fungible), - // since that will incur the maximum insertion cost. - // - // The former entirely depends on the asset type. xcm_withdraw_asset_fungible { - let origin: MultiLocation = (account_id_junction::(1)).into(); - let xcm = if T::fungibles_asset(0, 0).is_some() { - let (asset, _) = T::fungible_asset(1).unwrap(); - >::deposit_asset(&asset, &origin).unwrap(); - // check one of the assets of origin. - assert!(!T::FungibleTransactAsset::balance(&account::(1)).is_zero()); - Xcm::WithdrawAsset::> { assets: vec![asset], effects: vec![] } - } else { - Xcm::TransferAsset { assets: Default::default(), dest: origin.clone() } + for n in 0 .. 100; + let amount = T::FungiblesTransactAsset::minimum_balance(); + for i in 0 .. n { + let user = account::(1337); + assert_ok!(T::FungibleTransactAsset::mint_into(user, amount)); + assert_eq!(T::FungiblesTransactAsset::balance_of(user), amount); + + let multi_asset = T::get_id() + } + + let xcm = Xcm::WithdrawAsset { + assets: vec![multi_asset], // this is not full complexity + effects: vec![], }; + }: { - if T::fungible_asset(0).is_some() { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); - } + let holding = T::XcmExecutor::execute_and_return_holding(xcm)?; } verify { - if T::fungible_asset(0).is_some() { - // check one of the assets of origin. - assert!(T::FungibleTransactAsset::balance(&account::(1)).is_zero()); - } + assert!(T::FungiblesTransactAsset::balance_of(user).is_zero()); + assert!(holding.contains(multi_asset, amount)); } - xcm_withdraw_asset_fungibles { - // number of fungible assets, regardless of `fungible` - let a in 0..MAX_ASSETS; - // number of non-fungible assets. - let b in 0..0; // TODO: make this work. - let origin: MultiLocation = (account_id_junction::(1)).into(); - let xcm = if T::fungibles_asset(0, 0).is_some() { - let assets = (1..=a).map(|i| { - let (asset, _) = T::fungibles_asset(i, i).unwrap(); - >::deposit_asset(&asset, &origin).unwrap(); - asset - }) - .chain((0..b).map(|i| unreachable!())) - .collect::>(); - - if a > 0 { - // check one of the assets of origin. - assert!(!T::FungiblesTransactAsset::balance(1u32.into(), &account::(1)).is_zero()); + Xcm::WithdrawAsset { assest } => { + assets.iter().map(|a| (a, Lookup::lookup(a))).for_each(|(asset, type)| { + match type { + AssetType::Fungible => } - - Xcm::WithdrawAsset::> { assets, effects: vec![] } - } else { - Xcm::TransferAsset { assets: Default::default(), dest: origin.clone() } - }; - }: { - if T::fungibles_asset(0, 0).is_some() { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); - } - } verify { - if T::fungibles_asset(0, 0).is_some() { - // check one of the assets of origin. All assets must have been withdrawn. - assert!(T::FungiblesTransactAsset::balance(1u32.into(), &account::(1)).is_zero()); - } + }) } + xcm_withdraw_asset_fungibles { + let n in 0 .. 1000; + + let user + + for n + }: {} verify {} + xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_query_response {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 9f4e97147183..9c5c07f18c41 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -48,16 +48,14 @@ pub mod pallet { /// you don't really want to support this type of asset. /// /// A fungible asset always has an amount, return that too. - fn fungible_asset(_amount: u32) -> Option<(MultiAsset, u128)> { - None - } + fn get_id() -> MultiAsset; /// Same as `fungible_asset`, but for an asset of multiple instances. - fn fungibles_asset(_amount: u32, _id: u32) -> Option<(MultiAsset, u128)> { - None - } + // fn fungibles_asset(_amount: u32, _id: u32) -> Option<(MultiAsset, u128)> { + // None + // } - type FungibleTransactAsset: frame_support::traits::fungible::Inspect; - type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; + type FungibleTransactAsset: frame_support::traits::fungible::Mutate; + // type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; // type NonFungibleTransactAsset: traits::tokens::nonfungible::Inspect; // type NonFungiblesTransactAsset: traits::tokens::nonfungibles::Inspect; } diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs new file mode 100644 index 000000000000..928079392d40 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/weights.rs @@ -0,0 +1,72 @@ + +pub struct XcmWeight(PhantomData<(T, AssetTypes)>); +impl WeightInfo for XcmWeight +where + MultiAsset: XcmWeightInfo +{ + fn send_xcm() -> Weight { + 10 + } + fn order_null() -> Weight { + 10 + } + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw() -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset(assets: Vec, effects: Vec) -> Weight { + let mut weight = 0; + for asset in assets { + weight += asset.xcm_withdraw_asset(); + // AssetType::A1 => A1WeightInfo::xcm_withdraw_asset(), + // AssetType::A2 => A2WeightInfo::xcm_withdraw_asset(), + } + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } + fn xcm_transact() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + 10 + } + fn xcm_hrmp_channel_accepted() -> Weight { + 10 + } + fn xcm_hrmp_channel_closing() -> Weight { + 10 + } + fn xcm_relayed_from() -> Weight { + 10 + } +} diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index cd34812fe491..3943840fbd6e 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -329,20 +329,25 @@ impl Xcm { } } -impl GetWeight for Xcm { +impl> GetWeight for Xcm<()> { fn weight(&self) -> Weight { match self { - Xcm::WithdrawAsset { .. } => W::xcm_withdraw_asset(), - Xcm::ReserveAssetDeposit { .. } => W::xcm_reserve_asset_deposit(), - Xcm::TeleportAsset { .. } => W::xcm_teleport_asset(), - Xcm::QueryResponse { .. } => W::xcm_query_response(), - Xcm::TransferAsset { .. } => W::xcm_transfer_asset(), - Xcm::TransferReserveAsset { .. } => W::xcm_transfer_reserved_asset(), - Xcm::Transact { .. } => W::xcm_transact(), - Xcm::HrmpNewChannelOpenRequest { .. } => W::xcm_hrmp_channel_open_request(), - Xcm::HrmpChannelAccepted { .. } => W::xcm_hrmp_channel_accepted(), - Xcm::HrmpChannelClosing { .. } => W::xcm_hrmp_channel_closing(), - Xcm::RelayedFrom { .. } => W::xcm_relayed_from(), + Xcm::WithdrawAsset { assets, effects } => W::xcm_withdraw_asset(assets, effects), + Xcm::ReserveAssetDeposit { assets, effects } => + W::xcm_reserve_asset_deposit(assets, effects), + Xcm::TeleportAsset { assets, effects } => W::xcm_teleport_asset(assets, effects), + Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), + Xcm::TransferAsset { assets, dest } => W::xcm_transfer_asset(assets, dest), + Xcm::TransferReserveAsset { assets, dest, effects } => + W::xcm_transfer_reserved_asset(&assets, dest, effects), + Xcm::Transact { origin_type, require_weight_at_most, call } => + W::xcm_transact(origin_type, require_weight_at_most, call), + Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + W::xcm_hrmp_channel_open_request(sender, max_message_size, max_capacity), + Xcm::HrmpChannelAccepted { recipient } => W::xcm_hrmp_channel_accepted(recipient), + Xcm::HrmpChannelClosing { initiator, sender, recipient } => + W::xcm_hrmp_channel_closing(initiator, sender, recipient), + Xcm::RelayedFrom { who, message } => W::xcm_relayed_from(who, message), } } } diff --git a/xcm/src/v0/order.rs b/xcm/src/v0/order.rs index ec423dffe64e..7cf058d9c99a 100644 --- a/xcm/src/v0/order.rs +++ b/xcm/src/v0/order.rs @@ -153,17 +153,22 @@ impl Order { } } -impl GetWeight for Order { +impl> GetWeight for Order<()> { fn weight(&self) -> Weight { match self { Order::Null => W::order_null(), - Order::DepositAsset { .. } => W::order_deposit_asset(), - Order::DepositReserveAsset { .. } => W::order_deposit_reserved_asset(), - Order::ExchangeAsset { .. } => W::order_exchange_asset(), - Order::InitiateReserveWithdraw { .. } => W::order_initiate_reserve_withdraw(), - Order::InitiateTeleport { .. } => W::order_initiate_teleport(), - Order::QueryHolding { .. } => W::order_query_holding(), - Order::BuyExecution { .. } => W::order_buy_execution(), + Order::DepositAsset { assets, dest } => W::order_deposit_asset(assets, dest), + Order::DepositReserveAsset { assets, dest, effects } => + W::order_deposit_reserved_asset(assets, dest, effects), + Order::ExchangeAsset { give, receive } => W::order_exchange_asset(give, receive), + Order::InitiateReserveWithdraw { assets, reserve, effects } => + W::order_initiate_reserve_withdraw(assets, reserve, effects), + Order::InitiateTeleport { assets, dest, effects } => + W::order_initiate_teleport(assets, dest, effects), + Order::QueryHolding { query_id, dest, assets } => + W::order_query_holding(query_id, dest, assets), + Order::BuyExecution { fees, weight, debt, halt_on_error, xcm } => + W::order_buy_execution(fees, weight, debt, halt_on_error, xcm), } } } diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 73f14d59ffd7..0f2d757f5232 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -16,10 +16,11 @@ //! Cross-Consensus Message format data structures. +use alloc::vec::Vec; use core::result; use parity_scale_codec::{Decode, Encode}; -use super::{MultiLocation, Xcm}; +use super::{DoubleEncoded, MultiAsset, MultiLocation, Order, OriginKind, Response, Xcm}; #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug)] pub enum Error { @@ -264,25 +265,59 @@ impl SendXcm for Tuple { pub trait XcmWeightInfo { fn send_xcm() -> Weight; fn order_null() -> Weight; - fn order_deposit_asset(assets: Vec, dest: MultiLocation) -> Weight; - fn order_deposit_reserved_asset(assets: Vec, dest: MultiLocation, effects: Vec>) -> Weight; - fn order_exchange_asset(give: Vec, receive: Vec) -> Weight; - fn order_initiate_reserve_withdraw(assets: Vec, reserve: MultiLocation, effects: Vec>) -> Weight; - fn order_initiate_teleport(assets: Vec, dest: MultiLocation, effects: Vec>) -> Weight; - fn order_query_holding(query_id: u64, dest: MultiLocation, assets: Vec) -> Weight; - fn order_buy_execution(fees: MultiAsset, weight: u64, debt: u64, halt_on_error: bool, xcm: Vec>) -> Weight; - fn xcm_withdraw_asset(assets: Vec, effects: Vec>) -> Weight; - fn xcm_reserve_asset_deposit(assets: Vec, effects: Vec>) -> Weight; - fn xcm_teleport_asset(assets: Vec, effects: Vec>) -> Weight; - fn xcm_query_response(query_id: u64, response: Response) -> Weight; - fn xcm_transfer_asset(assets: Vec, dest: MultiLocation) -> Weight; - fn xcm_transfer_reserved_asset(assets: Vec, dest: MultiLocation) -> Weight; - // TODO: Maybe remove call - fn xcm_transact(origin_type: OriginKind, require_weight_at_most: u64, call: DoubleEncoded) -> Weight; - fn xcm_hrmp_channel_open_request(sender: u32, max_message_size: u32, max_capacity: u32) -> Weight; - fn xcm_hrmp_channel_accepted(recipient: u32) -> Weight; - fn xcm_hrmp_channel_closing(initiator: u32, sender: u32, recipient: u32) -> Weight; - fn xcm_relayed_from(who: MultiLocation, message: alloc::boxed::Box) -> Weight; + fn order_deposit_asset(assets: &Vec, dest: &MultiLocation) -> Weight; + fn order_deposit_reserved_asset( + assets: &Vec, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_exchange_asset(give: &Vec, receive: &Vec) -> Weight; + fn order_initiate_reserve_withdraw( + assets: &Vec, + reserve: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_initiate_teleport( + assets: &Vec, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_query_holding( + query_id: &u64, + dest: &MultiLocation, + assets: &Vec, + ) -> Weight; + fn order_buy_execution( + fees: &MultiAsset, + weight: &u64, + debt: &u64, + halt_on_error: &bool, + xcm: &Vec>, + ) -> Weight; + fn xcm_withdraw_asset(assets: &Vec, effects: &Vec>) -> Weight; + fn xcm_reserve_asset_deposit(assets: &Vec, effects: &Vec>) -> Weight; + fn xcm_teleport_asset(assets: &Vec, effects: &Vec>) -> Weight; + fn xcm_query_response(query_id: &u64, response: &Response) -> Weight; + fn xcm_transfer_asset(assets: &Vec, dest: &MultiLocation) -> Weight; + fn xcm_transfer_reserved_asset( + assets: &Vec, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + // TODO: &Maybe remove call + fn xcm_transact( + origin_type: &OriginKind, + require_weight_at_most: &u64, + call: &DoubleEncoded, + ) -> Weight; + fn xcm_hrmp_channel_open_request( + sender: &u32, + max_message_size: &u32, + max_capacity: &u32, + ) -> Weight; + fn xcm_hrmp_channel_accepted(recipient: &u32) -> Weight; + fn xcm_hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; + fn xcm_relayed_from(who: &MultiLocation, message: &alloc::boxed::Box>) -> Weight; } // A simple trait to get the weight of some object. diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index 824383da508e..da5956cd95a4 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -14,10 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use crate::Assets; +use crate::{Assets, PhantomData}; use frame_support::weights::Weight; use sp_std::result::Result; -use xcm::v0::{Error, MultiAsset, MultiLocation, Xcm}; +use xcm::v0::{Error, MultiAsset, MultiLocation, Order, Xcm}; /// Determine the weight of an XCM message. pub trait WeightBounds { @@ -84,3 +84,80 @@ impl WeightTrader for () { Err(Error::Unimplemented) } } + +struct FinalXcmWeight(PhantomData<(W, C)>); +impl WeightBounds for FinalXcmWeight +where + W: XcmWeightInfo, + C: Decode + GetDispatchInfo, + Xcm: GetWeight, + Order: GetWeight, +{ + fn shallow(message: &mut Xcm) -> Result { + let weight = match message { + Xcm::RelayedFrom { ref mut message, .. } => { + let relay_message_weight = Self::shallow(message.as_mut())?; + message.weight().saturating_add(relay_message_weight) + }, + // These XCM + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { + let inner: Weight = effects.iter_mut().map(|effect| effect.weight()).sum(); + message.weight().saturating_add(inner) + }, + // The shallow weight of `Transact` is the full weight of the message, thus there is no + // deeper weight. + Xcm::Transact { call, .. } => { + let call_weight = call.ensure_decoded()?.get_dispatch_info().weight; + message.weight().saturating_add(call_weight) + }, + // These + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => message.weight(), + }; + + Ok(weight) + } + + fn deep(message: &mut Xcm) -> Result { + let weight = match message { + // `RelayFrom` needs to account for the deep weight of the internal message. + Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, + // These XCM have internal effects which are not accounted for in the `shallow` weight. + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { + let mut extra = 0; + for effect in effects.iter_mut() { + match effect { + Order::BuyExecution { xcm, .. } => + for message in xcm.iter_mut() { + extra.saturating_accrue({ + let shallow = Self::shallow(message)?; + let deep = Self::deep(message)?; + shallow.saturating_add(deep) + }); + }, + _ => {}, + } + } + extra + }, + // These XCM do not have any deeper weight. + Xcm::Transact { .. } | + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => 0, + }; + + Ok(weight) + } +} From feb6bac7ab2f3099442a12815fd435ee2bf002a3 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 3 Aug 2021 11:10:58 +0200 Subject: [PATCH 16/63] push for shawn --- xcm/pallet-xcm-benchmarks/src/benchmarking.rs | 391 ------------------ .../src/fungible/benchmarking.rs | 122 ++++++ .../{mock_fungible.rs => fungible/mock.rs} | 17 +- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 35 ++ .../{mock_fungibles.rs => fungibles/mock.rs} | 17 +- .../src/fungibles/mod.rs | 35 ++ xcm/pallet-xcm-benchmarks/src/lib.rs | 134 +++--- .../src/{mock_shared.rs => mock.rs} | 0 xcm/pallet-xcm-benchmarks/src/weights.rs | 72 ---- xcm/xcm-executor/src/traits/weight.rs | 10 +- 10 files changed, 287 insertions(+), 546 deletions(-) delete mode 100644 xcm/pallet-xcm-benchmarks/src/benchmarking.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs rename xcm/pallet-xcm-benchmarks/src/{mock_fungible.rs => fungible/mock.rs} (91%) create mode 100644 xcm/pallet-xcm-benchmarks/src/fungible/mod.rs rename xcm/pallet-xcm-benchmarks/src/{mock_fungibles.rs => fungibles/mock.rs} (95%) create mode 100644 xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs rename xcm/pallet-xcm-benchmarks/src/{mock_shared.rs => mock.rs} (100%) delete mode 100644 xcm/pallet-xcm-benchmarks/src/weights.rs diff --git a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/benchmarking.rs deleted file mode 100644 index 5051b83174fd..000000000000 --- a/xcm/pallet-xcm-benchmarks/src/benchmarking.rs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -use crate::*; -use codec::Encode; -use frame_benchmarking::benchmarks; -use frame_support::{ - assert_ok, - traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, - weights::Weight, -}; -use sp_runtime::traits::Zero; -use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, - v0::{Error as XcmError, Order, Outcome, Xcm}, -}; -use xcm_executor::{traits::TransactAsset, Assets}; - -/// The xcm executor to use for doing stuff. -pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; -/// The asset transactor of our executor -pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Config>::AssetTransactor; -/// The overarching call type. -pub type OverArchingCallOf = ::Call; -/// The call type of executor's config. Should eventually resolve to the same overarching call type. -pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call; - -// TODO: def. needs to be become a config, might also want to use bounded vec. -const MAX_ASSETS: u32 = 25; -const SEED: u32 = 0; - -/// The number of fungible assets in the holding. -const HOLDING_FUNGIBLES: u32 = 99; -const HOLDING_NON_FUNGIBLES: u32 = 99; - -fn create_holding( - fungibles_count: u32, - fungibles_amount: u128, - non_fungibles_count: u32, -) -> Assets { - (0..fungibles_count) - .map(|i| { - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - amount: fungibles_amount * i as u128, - } - .into() - }) - .chain((0..non_fungibles_count).map(|i| MultiAsset::ConcreteNonFungible { - class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - instance: asset_instance_from(i), - })) - .collect::>() - .into() -} - -fn asset_instance_from(x: u32) -> AssetInstance { - let bytes = x.encode(); - let mut instance = [0u8; 4]; - instance.copy_from_slice(&bytes); - AssetInstance::Array4(instance) -} - -/// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single -/// order. -fn execute_order( - origin: MultiLocation, - mut holding: Assets, - order: Order>, -) -> Result { - ExecutorOf::::do_execute_effects(&origin, &mut holding, order) -} - -/// Execute an xcm. -fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> Outcome { - ExecutorOf::::execute_xcm(origin, xcm, 999_999_999_999) // TODO: very large weight to ensure all benchmarks execute, sensible? -} - -fn account(index: u32) -> T::AccountId { - frame_benchmarking::account::("account", index, SEED) -} - -/// Build a multi-location from an account id. -fn account_id_junction(index: u32) -> Junction { - let account = account::(index); - let mut encoded = account.encode(); - encoded.resize(32, 0u8); - let mut id = [0u8; 32]; - id.copy_from_slice(&encoded); - Junction::AccountId32 { network: NetworkId::Any, id } -} - -// Thoughts: -// -// All XCMs should have all of their internals as parameter, regardless of it being used or not. -// This is because some implementations might need them and depend upon them, and some might not. - -// Rationale: -// -// Benchmarks ending with _fungible typically indicate the case where there is only one asset in -// the order/xcm, and it is fungible. Typically, an order/xcm that is being weighed with such a -// benchmark will have a `asset: Vec<_>` of length one. -// -// Benchmarks ending with fungibles_per_asset imply that this benchmark is for the case of a chain -// with multiple asset types (thus the name `fungibles`). Such a benchmark will still only work -// with one asset, and it is meant to be summed -benchmarks! { - where_clause { where - T::XcmConfig: xcm_executor::Config>, - >::AssetId: From, - < - < - ::FungibleTransactAsset - as - FungibleInspect<::AccountId> - >::Balance - as - TryInto - >::Error: sp_std::fmt::Debug, - < - < - ::FungiblesTransactAsset - as - FungiblesInspect<::AccountId> - >::Balance - as - TryInto - >::Error: sp_std::fmt::Debug, - } - - // a xcm-send operation. This is useful for effects of an order. - send_xcm {}: {} - - // orders. - order_null { - let order = Order::>::Null; - let origin = MultiLocation::X1(account_id_junction::(1)); - let holding = Assets::default(); - }: { - assert_ok!(execute_order::(origin, holding, order)); - } - - order_deposit_asset_fungible { - let origin = MultiLocation::X1(account_id_junction::(1)); - let (holding, order) = if let Some((asset, amount)) = T::fungible_asset(1) { - let order = Order::>::DepositAsset { - assets: vec![asset.clone()], - dest: MultiLocation::X1(account_id_junction::(77)), - }; - - // generate the holding with a bunch of stuff.. - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); - // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset); - assert!(T::FungibleTransactAsset::balance(&account::(77)).is_zero()); - - (holding, order) - } else { - // just put some mock values in there. - (Default::default(), Order::>::Null) - }; - }: { - if T::fungible_asset(1).is_some() { - assert_ok!(execute_order::(origin, holding, order)); - } - } verify { - if T::fungible_asset(1).is_some() { - assert!(!T::FungibleTransactAsset::balance(&account::(77)).is_zero()) - } - } - - order_deposit_asset_fungibles_per_asset { - // create one asset with our desired id. - let asset_id = 9; - let origin = MultiLocation::X1(account_id_junction::(1)); - - let (holding, order) = if let Some((asset, amount)) = T::fungibles_asset(1, asset_id) { - let order = Order::>::DepositAsset { - assets: vec![ asset.clone() ], - dest: MultiLocation::X1(account_id_junction::(2)), - }; - let mut holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); - holding.saturating_subsume(asset); - assert!(T::FungibleTransactAsset::balance(&account::(2)).is_zero()); - - (holding, order) - } else { - (Default::default(), Order::>::Null) - }; - }: { - if T::fungibles_asset(1, asset_id).is_some() { - assert_ok!(execute_order::(origin, holding, order)); - } - } verify { - if T::fungibles_asset(1, asset_id).is_some() { - assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) - } - } - - order_deposit_reserved_asset_fungible {}: {} verify {} - order_deposit_reserved_asset_fungibles {}: {} verify {} - - order_exchange_asset_fungible {}: {} verify {} - order_exchange_asset_fungibles {}: {} verify {} - - order_initiate_reserve_withdraw_fungible {}: {} verify {} - order_initiate_reserve_withdraw_fungibles {}: {} verify {} - - order_initiate_teleport_fungible {}: {} verify {} - order_initiate_teleport_fungibles {}: {} verify {} - - order_query_holding_fungible {}: {} verify {} - order_query_holding_fungibles {}: {} verify {} - - order_buy_execution_fungible {}: {} verify {} - order_buy_execution_fungibles {}: {} verify {} - - xcm_withdraw_asset_fungible { - for n in 0 .. 100; - let amount = T::FungiblesTransactAsset::minimum_balance(); - for i in 0 .. n { - let user = account::(1337); - assert_ok!(T::FungibleTransactAsset::mint_into(user, amount)); - assert_eq!(T::FungiblesTransactAsset::balance_of(user), amount); - - let multi_asset = T::get_id() - } - - let xcm = Xcm::WithdrawAsset { - assets: vec![multi_asset], // this is not full complexity - effects: vec![], - }; - - }: { - let holding = T::XcmExecutor::execute_and_return_holding(xcm)?; - } verify { - assert!(T::FungiblesTransactAsset::balance_of(user).is_zero()); - assert!(holding.contains(multi_asset, amount)); - } - - Xcm::WithdrawAsset { assest } => { - assets.iter().map(|a| (a, Lookup::lookup(a))).for_each(|(asset, type)| { - match type { - AssetType::Fungible => - } - }) - } - - xcm_withdraw_asset_fungibles { - let n in 0 .. 1000; - - let user - - for n - }: {} verify {} - - xcm_reserve_asset_deposit {}: {} verify {} - xcm_teleport_asset {}: {} verify {} - xcm_query_response {}: {} verify {} - xcm_transfer_asset_fungible { - let origin: MultiLocation = (account_id_junction::(1)).into(); - let dest = account_id_junction::(2).into(); - - let xcm = if let Some((asset, amount)) = T::fungible_asset(1) { - >::deposit_asset(&asset, &origin).unwrap(); - let assets = vec![ asset ]; - assert!(T::FungibleTransactAsset::balance(&account::(2)).is_zero()); - Xcm::TransferAsset { assets, dest } - } else { - Xcm::TransferAsset { assets: Default::default(), dest } - }; - }: { - if T::fungible_asset(1).is_some() { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); - } - } verify { - if T::fungible_asset(1).is_some() { - assert!(!T::FungibleTransactAsset::balance(&account::(2)).is_zero()); - } - } - xcm_transfer_asset_fungibles_per_asset { - let origin: MultiLocation = (account_id_junction::(1)).into(); - let dest = (account_id_junction::(2)).into(); - let asset_id = 9; - - let xcm = if let Some((asset, amount)) = T::fungibles_asset(1, asset_id) { - // Note that we deposit a new asset with twice the amount into the sender to prevent it - // being dying. - >::deposit_asset( - &T::fungibles_asset(2, asset_id) - .expect("call to fungibles_asset has already returned `Some`, this must work") - .0, - &origin - ).unwrap(); - - assert!(T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); - assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(1)).is_zero()); - - Xcm::TransferAsset { assets: vec![asset], dest } - } else { - Xcm::TransferAsset { assets: Default::default(), dest } - }; - }: { - if T::fungibles_asset(0, 0).is_some() { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); - } - } verify { - if T::fungibles_asset(0, 0).is_some() { - assert!(!T::FungiblesTransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); - } - } - - xcm_transfer_reserved_asset_fungible {}: {} verify {} - xcm_transfer_reserved_asset_fungibles {}: {} verify {} - - xcm_transact {}: {} verify {} - xcm_hrmp_channel_open_request {}: {} verify {} - xcm_hrmp_channel_accepted {}: {} verify {} - xcm_hrmp_channel_closing {}: {} verify {} - xcm_relayed_from {}: {} verify {} -} - -#[cfg(test)] -mod benchmark_tests { - use super::*; - - #[test] - fn order_deposit_asset_fungible() { - crate::mock_fungible::new_test_ext().execute_with(|| { - test_bench_by_name::(b"order_deposit_asset_fungible") - .unwrap(); - }) - } - - #[test] - fn order_deposit_asset_fungibles_per_asset() { - crate::mock_fungibles::new_test_ext().execute_with(|| { - test_bench_by_name::( - b"order_deposit_asset_fungibles_per_asset", - ) - .unwrap(); - }) - } - - #[test] - fn xcm_transfer_asset_fungible() { - crate::mock_fungible::new_test_ext().execute_with(|| { - test_bench_by_name::(b"xcm_transfer_asset_fungible") - .unwrap(); - }) - } - #[test] - fn xcm_transfer_asset_fungibles_per_asset() { - crate::mock_fungibles::new_test_ext().execute_with(|| { - test_bench_by_name::( - b"xcm_transfer_asset_fungibles_per_asset", - ) - .unwrap(); - }) - } - - #[test] - fn xcm_withdraw_asset_fungible() { - crate::mock_fungible::new_test_ext().execute_with(|| { - test_bench_by_name::(b"xcm_withdraw_asset_fungible") - .unwrap(); - }) - } - - #[test] - fn xcm_withdraw_asset_fungibles() { - crate::mock_fungibles::new_test_ext().execute_with(|| { - test_bench_by_name::(b"xcm_withdraw_asset_fungibles") - .unwrap(); - }) - } -} diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs new file mode 100644 index 000000000000..6671b8c73794 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -0,0 +1,122 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use crate::*; +use codec::Encode; +use frame_benchmarking::benchmarks; +use frame_support::{ + assert_ok, + traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, + weights::Weight, +}; +use sp_runtime::traits::Zero; +use sp_std::{convert::TryInto, prelude::*, vec}; +use xcm::{ + opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, + v0::{Error as XcmError, Order, Outcome, Xcm}, +}; +use xcm_executor::{traits::TransactAsset, Assets}; + +// TODO: def. needs to be become a config, might also want to use bounded vec. +const MAX_ASSETS: u32 = 25; + +/// The number of fungible assets in the holding. +const HOLDING_FUNGIBLES: u32 = 99; +const HOLDING_NON_FUNGIBLES: u32 = 99; + +// Thoughts: +// +// All XCMs should have all of their internals as parameter, regardless of it being used or not. +// This is because some implementations might need them and depend upon them, and some might not. + +// Rationale: +// +// Benchmarks ending with _fungible typically indicate the case where there is only one asset in +// the order/xcm, and it is fungible. Typically, an order/xcm that is being weighed with such a +// benchmark will have a `asset: Vec<_>` of length one. +// +// Benchmarks ending with fungibles_per_asset imply that this benchmark is for the case of a chain +// with multiple asset types (thus the name `fungibles`). Such a benchmark will still only work +// with one asset, and it is meant to be summed +benchmarks! { + where_clause { where + T::XcmConfig: xcm_executor::Config>, + >::AssetId: From, + < + < + ::FungibleTransactAsset + as + FungibleInspect<::AccountId> + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + < + < + ::FungiblesTransactAsset + as + FungiblesInspect<::AccountId> + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + } + + // a xcm-send operation. This is useful for effects of an order. + send_xcm {}: {} + + // orders. + order_null { + let order = Order::>::Null; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = Assets::default(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } + + order_deposit_asset {}: {} verify {} + order_deposit_reserved_asset {}: {} verify {} + order_exchange_asset {}: {} verify {} + order_initiate_reserve_withdraw {}: {} verify {} + order_initiate_teleport {}: {} verify {} + order_query_holding {}: {} verify {} + order_buy_execution {}: {} verify {} + + xcm_withdraw_asset {}: {} verify {} + xcm_reserve_asset_deposit {}: {} verify {} + xcm_teleport_asset {}: {} verify {} + xcm_query_response {}: {} verify {} + xcm_transfer_asset {}: {} verify {} + xcm_transfer_reserved_asset {}: {} verify {} + xcm_transact {}: {} verify {} + xcm_hrmp_channel_open_request {}: {} verify {} + xcm_hrmp_channel_accepted {}: {} verify {} + xcm_hrmp_channel_closing {}: {} verify {} + xcm_relayed_from {}: {} verify {} +} + +#[cfg(test)] +mod benchmark_tests { + use super::*; + + #[test] + fn order_deposit_asset_fungible() { + crate::mock_fungible::new_test_ext().execute_with(|| { + test_bench_by_name::(b"") + .unwrap(); + }) + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs similarity index 91% rename from xcm/pallet-xcm-benchmarks/src/mock_fungible.rs rename to xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index f733d861f6b6..ec2b91578f5f 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock_fungible.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -16,8 +16,8 @@ //! A mock runtime for xcm benchmarking. -use crate as pallet_xcm_benchmarks; -use crate::mock_shared::*; +use crate::mock::*; +use crate::fungible as xcm_balances_benchmark; use frame_support::parameter_types; use sp_core::H256; use sp_runtime::{ @@ -39,7 +39,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, + XcmBalancesBenchmark: xcm_balances_benchmark::{Pallet}, } ); @@ -137,17 +137,14 @@ impl xcm_executor::Config for XcmConfig { type ResponseHandler = DevNull; } -impl pallet_xcm_benchmarks::Config for Test { +impl xcm_balances_benchmark::Config for Test { type XcmConfig = XcmConfig; - - fn fungible_asset(amount: u32) -> Option<(MultiAsset, u128)> { + type TransactAsset = Balances; + fn fungible_asset(amount: u32) -> MultiAsset { let amount = >::minimum_balance() as u128 * amount as u128; - Some((MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount }, amount)) + MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount } } - - type FungibleTransactAsset = Balances; - type FungiblesTransactAsset = crate::AsFungibles; } pub fn new_test_ext() -> sp_io::TestExternalities { diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs new file mode 100644 index 000000000000..8826577749ce --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -0,0 +1,35 @@ +pub use pallet::*; + +#[cfg(test)] +mod mock; +pub mod benchmarking; + +#[frame_support::pallet] +pub mod pallet { + use xcm::v0::MultiAsset; + + #[pallet::config] + pub trait Config: frame_system::Config { + /// The XCM configurations. + /// + /// These might affect the execution of XCM messages, such as defining how the + /// `TransactAsset` is implemented. + type XcmConfig: xcm_executor::Config; + + /// The type of `fungible` that is being used under the hood. + /// + /// This is useful for testing and checking. + type TransactAsset: frame_support::traits::fungible::Mutate; + + /// Give me a fungible asset that your asset transactor is going to accept. + fn get_multi_asset() -> MultiAsset; + } + + // transact asset that works with balances and asset + // + // transact asset that works with 3 assets + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); +} diff --git a/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs similarity index 95% rename from xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs rename to xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 1f072f960960..2beee6aafc95 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock_fungibles.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -172,8 +172,9 @@ impl xcm_executor::Config for XcmConfig { use frame_support::traits::fungibles::Inspect; impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; + type TransactAsset = Assets; - fn fungibles_asset(amount: u32, id: u32) -> Option<(MultiAsset, u128)> { + fn get_multi_asset(id: u32) -> MultiAsset { // create this asset, if it does not exists. if >::minimum_balance(id).is_zero() { assert!(!ExistentialDeposit::get().is_zero()); @@ -182,18 +183,12 @@ impl pallet_xcm_benchmarks::Config for Test { assert!(!>::minimum_balance(id).is_zero()); } - let amount = >::minimum_balance(id) as u128 * amount as u128; - Some(( - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: id.into() }), - amount, - }, + let amount = >::minimum_balance(id) as u128; + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: id.into() }), amount, - )) + } } - - type FungibleTransactAsset = Balances; - type FungiblesTransactAsset = Assets; } // This function basically just builds a genesis storage key/value store according to diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs new file mode 100644 index 000000000000..1ec5de18a429 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs @@ -0,0 +1,35 @@ +pub use pallet::*; + +#[cfg(test)] +mod mock; +// pub mod benchmarking; + +#[frame_support::pallet] +pub mod pallet { + use crate::MultiAsset; + + #[pallet::config] + pub trait Config: frame_system::Config { + /// The XCM configurations. + /// + /// These might affect the execution of XCM messages, such as defining how the + /// `TransactAsset` is implemented. + type XcmConfig: xcm_executor::Config; + + /// The type of `fungibles` that is being used under the hood. + /// + /// This is useful for testing and checking. + type TransactAsset: frame_support::traits::fungibles::Mutate; + + /// Give me a `fungibles` multi-asset that your asset transactor is going to accept. + fn get_multi_asset() -> MultiAsset; + } + + // transact asset that works with balances and asset + // + // transact asset that works with 3 assets + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); +} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 9c5c07f18c41..2fd4f8a10b59 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -18,76 +18,94 @@ #![cfg_attr(not(feature = "std"), no_std)] -pub use pallet::*; use xcm::v0::MultiAsset; +mod fungible; +mod fungibles; + #[cfg(test)] -mod mock_fungible; -#[cfg(test)] -mod mock_fungibles; -#[cfg(test)] -mod mock_shared; - -mod benchmarking; -pub mod weights; -// pub use weights::*; - -#[frame_support::pallet] -pub mod pallet { - use crate::MultiAsset; - - #[pallet::config] - pub trait Config: frame_system::Config { - /// The XCM configurations. - /// - /// These might affect the execution of XCM messages, such as defining how the - /// `TransactAsset` is implemented. - type XcmConfig: xcm_executor::Config; - - /// Give me a fungible asset that your asset transactor is going to accept. Give me none if - /// you don't really want to support this type of asset. - /// - /// A fungible asset always has an amount, return that too. - fn get_id() -> MultiAsset; - /// Same as `fungible_asset`, but for an asset of multiple instances. - // fn fungibles_asset(_amount: u32, _id: u32) -> Option<(MultiAsset, u128)> { - // None - // } - - type FungibleTransactAsset: frame_support::traits::fungible::Mutate; - // type FungiblesTransactAsset: frame_support::traits::fungibles::Inspect; - // type NonFungibleTransactAsset: traits::tokens::nonfungible::Inspect; - // type NonFungiblesTransactAsset: traits::tokens::nonfungibles::Inspect; - } +mod mock; - // transact asset that works with balances and asset - // - // transact asset that works with 3 assets +use frame_support::{dispatch::Weight, traits::{ + fungible::Inspect as FungibleInspect, + fungibles::Inspect as FungiblesInspect, + tokens::{DepositConsequence, WithdrawConsequence}, +}}; + +/// The xcm executor to use for doing stuff. +pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; +/// The asset transactor of our executor +pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Config>::AssetTransactor; +/// The overarching call type. +pub type OverArchingCallOf = ::Call; +/// The call type of executor's config. Should eventually resolve to the same overarching call type. +pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call; + +const SEED: u32 = 0; +const MAX_WEIGHT: Weight = 999_999_999_999; + +pub fn create_holding( + fungibles_count: u32, + fungibles_amount: u128, + non_fungibles_count: u32, +) -> Assets { + (0..fungibles_count) + .map(|i| { + MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), + amount: fungibles_amount * i as u128, + } + .into() + }) + .chain((0..non_fungibles_count).map(|i| MultiAsset::ConcreteNonFungible { + class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), + instance: asset_instance_from(i), + })) + .collect::>() + .into() +} - #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - pub struct Pallet(_); +pub fn asset_instance_from(x: u32) -> AssetInstance { + let bytes = x.encode(); + let mut instance = [0u8; 4]; + instance.copy_from_slice(&bytes); + AssetInstance::Array4(instance) } -// With this, we measure all weights per asset, so NONE of the benchmarks need to have a component -// that is the number of assets, that's pretty pointless. You need to iterate the `Vec` -// down the road -enum AssetTransactorType { - Fungible, // Balances - Fungibles, // Assets, - NonFungible, // Uniques +/// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single +/// order. +pub fn execute_order( + origin: MultiLocation, + mut holding: Assets, + order: Order>, +) -> Result { + ExecutorOf::::do_execute_effects(&origin, &mut holding, order) } -trait IdentifyAsset { - fn identify_asset(asset: MultiAsset) -> R; +/// Execute an xcm. +pub fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> Outcome { + // TODO: very large weight to ensure all benchmarks execute, sensible? + ExecutorOf::::execute_xcm(origin, xcm, MAX_WEIGHT) +} + +pub fn account(index: u32) -> T::AccountId { + frame_benchmarking::account::("account", index, SEED) +} + +/// Build a multi-location from an account id. +fn account_id_junction(index: u32) -> Junction { + let account = account::(index); + let mut encoded = account.encode(); + encoded.resize(32, 0u8); + let mut id = [0u8; 32]; + id.copy_from_slice(&encoded); + Junction::AccountId32 { network: NetworkId::Any, id } } -use frame_support::traits::{ - fungible::Inspect as FungibleInspect, - fungibles::Inspect as FungiblesInspect, - tokens::{DepositConsequence, WithdrawConsequence}, -}; +/// Helper struct that converts a `Fungible` to `Fungibles` +/// +/// TODO: might not be needed anymore. pub struct AsFungibles(sp_std::marker::PhantomData<(AccountId, AssetId, B)>); impl< AccountId: sp_runtime::traits::Member + frame_support::dispatch::Parameter, diff --git a/xcm/pallet-xcm-benchmarks/src/mock_shared.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs similarity index 100% rename from xcm/pallet-xcm-benchmarks/src/mock_shared.rs rename to xcm/pallet-xcm-benchmarks/src/mock.rs diff --git a/xcm/pallet-xcm-benchmarks/src/weights.rs b/xcm/pallet-xcm-benchmarks/src/weights.rs deleted file mode 100644 index 928079392d40..000000000000 --- a/xcm/pallet-xcm-benchmarks/src/weights.rs +++ /dev/null @@ -1,72 +0,0 @@ - -pub struct XcmWeight(PhantomData<(T, AssetTypes)>); -impl WeightInfo for XcmWeight -where - MultiAsset: XcmWeightInfo -{ - fn send_xcm() -> Weight { - 10 - } - fn order_null() -> Weight { - 10 - } - fn order_deposit_asset() -> Weight { - 10 - } - fn order_deposit_reserved_asset() -> Weight { - 10 - } - fn order_exchange_asset() -> Weight { - 10 - } - fn order_initiate_reserve_withdraw() -> Weight { - 10 - } - fn order_initiate_teleport() -> Weight { - 10 - } - fn order_query_holding() -> Weight { - 10 - } - fn order_buy_execution() -> Weight { - 10 - } - fn xcm_withdraw_asset(assets: Vec, effects: Vec) -> Weight { - let mut weight = 0; - for asset in assets { - weight += asset.xcm_withdraw_asset(); - // AssetType::A1 => A1WeightInfo::xcm_withdraw_asset(), - // AssetType::A2 => A2WeightInfo::xcm_withdraw_asset(), - } - } - fn xcm_reserve_asset_deposit() -> Weight { - 10 - } - fn xcm_teleport_asset() -> Weight { - 10 - } - fn xcm_query_response() -> Weight { - 10 - } - fn xcm_transfer_asset() -> Weight { - 10 - } - fn xcm_transfer_reserved_asset() -> Weight { - 10 - } - fn xcm_transact() -> Weight { - 10 - } - fn xcm_hrmp_channel_open_request() -> Weight { - 10 - } - fn xcm_hrmp_channel_accepted() -> Weight { - 10 - } - fn xcm_hrmp_channel_closing() -> Weight { - 10 - } - fn xcm_relayed_from() -> Weight { - 10 - } -} diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index da5956cd95a4..407339549060 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -15,9 +15,11 @@ // along with Polkadot. If not, see . use crate::{Assets, PhantomData}; -use frame_support::weights::Weight; +use frame_support::{dispatch::GetDispatchInfo, weights::Weight}; +use sp_runtime::traits::Saturating; +use parity_scale_codec::Decode; use sp_std::result::Result; -use xcm::v0::{Error, MultiAsset, MultiLocation, Order, Xcm}; +use xcm::v0::{Error, GetWeight, MultiAsset, MultiLocation, Order, Xcm, XcmWeightInfo}; /// Determine the weight of an XCM message. pub trait WeightBounds { @@ -88,7 +90,7 @@ impl WeightTrader for () { struct FinalXcmWeight(PhantomData<(W, C)>); impl WeightBounds for FinalXcmWeight where - W: XcmWeightInfo, + W: XcmWeightInfo, C: Decode + GetDispatchInfo, Xcm: GetWeight, Order: GetWeight, @@ -132,7 +134,7 @@ where Xcm::WithdrawAsset { effects, .. } | Xcm::ReserveAssetDeposit { effects, .. } | Xcm::TeleportAsset { effects, .. } => { - let mut extra = 0; + let mut extra: Weight = 0; for effect in effects.iter_mut() { match effect { Order::BuyExecution { xcm, .. } => From 3915752b5078b92431726d99a78de8bec3b0c533 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 3 Aug 2021 13:09:50 +0200 Subject: [PATCH 17/63] Everything now builds --- .../src/fungible/benchmarking.rs | 81 +++--------- .../src/fungible/mock.rs | 13 +- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 22 +--- .../src/fungibles/benchmarking.rs | 75 +++++++++++ .../src/fungibles/mock.rs | 15 +-- .../src/fungibles/mod.rs | 16 +-- xcm/pallet-xcm-benchmarks/src/lib.rs | 46 ++++--- xcm/pallet-xcm-benchmarks/src/mock.rs | 5 +- .../src/xcm_generic/benchmarking.rs | 75 +++++++++++ .../src/xcm_generic/mock.rs | 116 ++++++++++++++++++ .../src/xcm_generic/mod.rs | 15 +++ 11 files changed, 357 insertions(+), 122 deletions(-) create mode 100644 xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs create mode 100644 xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 6671b8c73794..75259c19eecb 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -14,79 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use crate::*; +use super::*; +use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; use codec::Encode; -use frame_benchmarking::benchmarks; -use frame_support::{ - assert_ok, - traits::{fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect}, - weights::Weight, -}; -use sp_runtime::traits::Zero; +use frame_benchmarking::benchmarks_instance_pallet; +use frame_support::assert_ok; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, - v0::{Error as XcmError, Order, Outcome, Xcm}, -}; +use xcm::{opaque::v0::MultiLocation, v0::Order}; use xcm_executor::{traits::TransactAsset, Assets}; // TODO: def. needs to be become a config, might also want to use bounded vec. const MAX_ASSETS: u32 = 25; - /// The number of fungible assets in the holding. const HOLDING_FUNGIBLES: u32 = 99; const HOLDING_NON_FUNGIBLES: u32 = 99; -// Thoughts: -// -// All XCMs should have all of their internals as parameter, regardless of it being used or not. -// This is because some implementations might need them and depend upon them, and some might not. - -// Rationale: -// -// Benchmarks ending with _fungible typically indicate the case where there is only one asset in -// the order/xcm, and it is fungible. Typically, an order/xcm that is being weighed with such a -// benchmark will have a `asset: Vec<_>` of length one. -// -// Benchmarks ending with fungibles_per_asset imply that this benchmark is for the case of a chain -// with multiple asset types (thus the name `fungibles`). Such a benchmark will still only work -// with one asset, and it is meant to be summed -benchmarks! { - where_clause { where - T::XcmConfig: xcm_executor::Config>, - >::AssetId: From, - < - < - ::FungibleTransactAsset - as - FungibleInspect<::AccountId> - >::Balance - as - TryInto - >::Error: sp_std::fmt::Debug, - < - < - ::FungiblesTransactAsset - as - FungiblesInspect<::AccountId> - >::Balance - as - TryInto - >::Error: sp_std::fmt::Debug, - } - - // a xcm-send operation. This is useful for effects of an order. +benchmarks_instance_pallet! { send_xcm {}: {} - // orders. order_null { - let order = Order::>::Null; + let order = Order::>::Null; let origin = MultiLocation::X1(account_id_junction::(1)); let holding = Assets::default(); }: { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset {}: {} verify {} order_deposit_reserved_asset {}: {} verify {} order_exchange_asset {}: {} verify {} @@ -98,25 +50,26 @@ benchmarks! { xcm_withdraw_asset {}: {} verify {} xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} - xcm_query_response {}: {} verify {} xcm_transfer_asset {}: {} verify {} xcm_transfer_reserved_asset {}: {} verify {} - xcm_transact {}: {} verify {} - xcm_hrmp_channel_open_request {}: {} verify {} - xcm_hrmp_channel_accepted {}: {} verify {} - xcm_hrmp_channel_closing {}: {} verify {} - xcm_relayed_from {}: {} verify {} + + // xcm_query_response {}: {} verify {} + // xcm_transact {}: {} verify {} + // xcm_hrmp_channel_open_request {}: {} verify {} + // xcm_hrmp_channel_accepted {}: {} verify {} + // xcm_hrmp_channel_closing {}: {} verify {} + // xcm_relayed_from {}: {} verify {} } #[cfg(test)] mod benchmark_tests { + use super::mock::{new_test_ext, Test}; use super::*; #[test] fn order_deposit_asset_fungible() { - crate::mock_fungible::new_test_ext().execute_with(|| { - test_bench_by_name::(b"") - .unwrap(); + new_test_ext().execute_with(|| { + test_bench_by_name::(b"order_null").unwrap(); }) } } diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index ec2b91578f5f..d19daf11e08d 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -16,8 +16,8 @@ //! A mock runtime for xcm benchmarking. -use crate::mock::*; use crate::fungible as xcm_balances_benchmark; +use crate::mock::*; use frame_support::parameter_types; use sp_core::H256; use sp_runtime::{ @@ -137,12 +137,15 @@ impl xcm_executor::Config for XcmConfig { type ResponseHandler = DevNull; } -impl xcm_balances_benchmark::Config for Test { +impl crate::Config for Test { type XcmConfig = XcmConfig; +} + +impl xcm_balances_benchmark::Config for Test { type TransactAsset = Balances; - fn fungible_asset(amount: u32) -> MultiAsset { - let amount = >::minimum_balance() - as u128 * amount as u128; + fn get_multi_asset() -> MultiAsset { + let amount = + >::minimum_balance() as u128; MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount } } } diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index 8826577749ce..f6e6eb3aedf8 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -1,35 +1,25 @@ pub use pallet::*; +pub mod benchmarking; #[cfg(test)] mod mock; -pub mod benchmarking; +use xcm::v0::MultiAsset; +// TODO: make this instanciable. #[frame_support::pallet] pub mod pallet { - use xcm::v0::MultiAsset; #[pallet::config] - pub trait Config: frame_system::Config { - /// The XCM configurations. - /// - /// These might affect the execution of XCM messages, such as defining how the - /// `TransactAsset` is implemented. - type XcmConfig: xcm_executor::Config; - + pub trait Config: frame_system::Config + crate::Config { /// The type of `fungible` that is being used under the hood. /// /// This is useful for testing and checking. type TransactAsset: frame_support::traits::fungible::Mutate; /// Give me a fungible asset that your asset transactor is going to accept. - fn get_multi_asset() -> MultiAsset; + fn get_multi_asset() -> xcm::v0::MultiAsset; } - // transact asset that works with balances and asset - // - // transact asset that works with 3 assets - #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - pub struct Pallet(_); + pub struct Pallet(_); } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs new file mode 100644 index 000000000000..7114552c5bc9 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -0,0 +1,75 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; +use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; +use codec::Encode; +use frame_benchmarking::benchmarks; +use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, weights::Weight}; +use sp_runtime::traits::Zero; +use sp_std::{convert::TryInto, prelude::*, vec}; +use xcm::{ + opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, + v0::{Error as XcmError, Order, Outcome, Xcm}, +}; +use xcm_executor::{traits::TransactAsset, Assets}; + +// TODO: def. needs to be become a config, might also want to use bounded vec. +const MAX_ASSETS: u32 = 25; + +/// The number of fungible assets in the holding. +const HOLDING_FUNGIBLES: u32 = 99; +const HOLDING_NON_FUNGIBLES: u32 = 99; + +benchmarks! { + send_xcm {}: {} + + // orders. + order_null { + let order = Order::>::Null; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = Assets::default(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } + + order_deposit_asset {}: {} verify {} + order_deposit_reserved_asset {}: {} verify {} + order_exchange_asset {}: {} verify {} + order_initiate_reserve_withdraw {}: {} verify {} + order_initiate_teleport {}: {} verify {} + order_query_holding {}: {} verify {} + order_buy_execution {}: {} verify {} + + xcm_withdraw_asset {}: {} verify {} + xcm_reserve_asset_deposit {}: {} verify {} + xcm_teleport_asset {}: {} verify {} + xcm_transfer_asset {}: {} verify {} + xcm_transfer_reserved_asset {}: {} verify {} +} + +#[cfg(test)] +mod benchmark_tests { + use super::mock::{new_test_ext, Test}; + use super::*; + + #[test] + fn order_deposit_asset_fungible() { + new_test_ext().execute_with(|| { + test_bench_by_name::(b"order_null").unwrap(); + }) + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 2beee6aafc95..4cbbe76e8556 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -16,8 +16,9 @@ //! A mock runtime for xcm benchmarking. -use crate as pallet_xcm_benchmarks; -use crate::{mock_shared::*, *}; +use crate::fungibles as xcm_assets_benchmarks; +use crate::{mock::*, *}; +use frame_support::traits::fungibles::Inspect; use frame_support::{parameter_types, traits::Contains}; use sp_core::H256; use sp_runtime::{ @@ -43,7 +44,7 @@ frame_support::construct_runtime!( System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, Assets: pallet_assets::{Pallet, Call, Storage, Event}, - XcmPalletBenchmarks: pallet_xcm_benchmarks::{Pallet}, + XcmAssetsBenchmarks: xcm_assets_benchmarks::{Pallet}, } ); @@ -169,9 +170,11 @@ impl xcm_executor::Config for XcmConfig { type ResponseHandler = DevNull; } -use frame_support::traits::fungibles::Inspect; -impl pallet_xcm_benchmarks::Config for Test { +impl crate::Config for Test { type XcmConfig = XcmConfig; +} + +impl xcm_assets_benchmarks::Config for Test { type TransactAsset = Assets; fn get_multi_asset(id: u32) -> MultiAsset { @@ -191,8 +194,6 @@ impl pallet_xcm_benchmarks::Config for Test { } } -// This function basically just builds a genesis storage key/value store according to -// our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); sp_tracing::try_init_simple(); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs index 1ec5de18a429..77fda26744a1 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs @@ -1,34 +1,24 @@ pub use pallet::*; +pub mod benchmarking; #[cfg(test)] mod mock; -// pub mod benchmarking; #[frame_support::pallet] pub mod pallet { use crate::MultiAsset; #[pallet::config] - pub trait Config: frame_system::Config { - /// The XCM configurations. - /// - /// These might affect the execution of XCM messages, such as defining how the - /// `TransactAsset` is implemented. - type XcmConfig: xcm_executor::Config; - + pub trait Config: frame_system::Config + crate::Config { /// The type of `fungibles` that is being used under the hood. /// /// This is useful for testing and checking. type TransactAsset: frame_support::traits::fungibles::Mutate; /// Give me a `fungibles` multi-asset that your asset transactor is going to accept. - fn get_multi_asset() -> MultiAsset; + fn get_multi_asset(id: u32) -> MultiAsset; } - // transact asset that works with balances and asset - // - // transact asset that works with 3 assets - #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 2fd4f8a10b59..767e1dfdabfb 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -18,32 +18,49 @@ #![cfg_attr(not(feature = "std"), no_std)] -use xcm::v0::MultiAsset; +use codec::Encode; +use frame_support::{ + dispatch::Weight, + traits::{ + fungible::Inspect as FungibleInspect, + fungibles::Inspect as FungiblesInspect, + tokens::{DepositConsequence, WithdrawConsequence}, + }, +}; +use xcm::v0::{ + AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, + Order, Outcome, Xcm, +}; +use xcm_executor::Assets; mod fungible; mod fungibles; +mod xcm_generic; #[cfg(test)] mod mock; -use frame_support::{dispatch::Weight, traits::{ - fungible::Inspect as FungibleInspect, - fungibles::Inspect as FungiblesInspect, - tokens::{DepositConsequence, WithdrawConsequence}, -}}; +/// A base trait for all individual pallets +pub trait Config { + /// The XCM configurations. + /// + /// These might affect the execution of XCM messages, such as defining how the + /// `TransactAsset` is implemented. + type XcmConfig: xcm_executor::Config; +} + +const SEED: u32 = 0; +const MAX_WEIGHT: Weight = 999_999_999_999; /// The xcm executor to use for doing stuff. -pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; -/// The asset transactor of our executor -pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Config>::AssetTransactor; +pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; /// The overarching call type. pub type OverArchingCallOf = ::Call; +/// The asset transactor of our executor +pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Config>::AssetTransactor; /// The call type of executor's config. Should eventually resolve to the same overarching call type. pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call; -const SEED: u32 = 0; -const MAX_WEIGHT: Weight = 999_999_999_999; - pub fn create_holding( fungibles_count: u32, fungibles_amount: u128, @@ -88,12 +105,12 @@ pub fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> ExecutorOf::::execute_xcm(origin, xcm, MAX_WEIGHT) } -pub fn account(index: u32) -> T::AccountId { +pub fn account(index: u32) -> T::AccountId { frame_benchmarking::account::("account", index, SEED) } /// Build a multi-location from an account id. -fn account_id_junction(index: u32) -> Junction { +fn account_id_junction(index: u32) -> Junction { let account = account::(index); let mut encoded = account.encode(); encoded.resize(32, 0u8); @@ -102,7 +119,6 @@ fn account_id_junction(index: u32) -> Junction { Junction::AccountId32 { network: NetworkId::Any, id } } - /// Helper struct that converts a `Fungible` to `Fungibles` /// /// TODO: might not be needed anymore. diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 19e30a9f7a39..197ac7a16f21 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -52,8 +52,9 @@ pub struct AccountIdConverter; impl xcm_executor::traits::Convert for AccountIdConverter { fn convert(ml: MultiLocation) -> Result { match ml { - MultiLocation::X1(Junction::AccountId32 { id, .. }) => - Ok(::decode(&mut &*id.to_vec()).unwrap()), + MultiLocation::X1(Junction::AccountId32 { id, .. }) => { + Ok(::decode(&mut &*id.to_vec()).unwrap()) + } _ => Err(ml), } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs new file mode 100644 index 000000000000..7114552c5bc9 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -0,0 +1,75 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; +use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; +use codec::Encode; +use frame_benchmarking::benchmarks; +use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, weights::Weight}; +use sp_runtime::traits::Zero; +use sp_std::{convert::TryInto, prelude::*, vec}; +use xcm::{ + opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, + v0::{Error as XcmError, Order, Outcome, Xcm}, +}; +use xcm_executor::{traits::TransactAsset, Assets}; + +// TODO: def. needs to be become a config, might also want to use bounded vec. +const MAX_ASSETS: u32 = 25; + +/// The number of fungible assets in the holding. +const HOLDING_FUNGIBLES: u32 = 99; +const HOLDING_NON_FUNGIBLES: u32 = 99; + +benchmarks! { + send_xcm {}: {} + + // orders. + order_null { + let order = Order::>::Null; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = Assets::default(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } + + order_deposit_asset {}: {} verify {} + order_deposit_reserved_asset {}: {} verify {} + order_exchange_asset {}: {} verify {} + order_initiate_reserve_withdraw {}: {} verify {} + order_initiate_teleport {}: {} verify {} + order_query_holding {}: {} verify {} + order_buy_execution {}: {} verify {} + + xcm_withdraw_asset {}: {} verify {} + xcm_reserve_asset_deposit {}: {} verify {} + xcm_teleport_asset {}: {} verify {} + xcm_transfer_asset {}: {} verify {} + xcm_transfer_reserved_asset {}: {} verify {} +} + +#[cfg(test)] +mod benchmark_tests { + use super::mock::{new_test_ext, Test}; + use super::*; + + #[test] + fn order_deposit_asset_fungible() { + new_test_ext().execute_with(|| { + test_bench_by_name::(b"order_null").unwrap(); + }) + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs new file mode 100644 index 000000000000..490b55274163 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -0,0 +1,116 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for xcm benchmarking. + +use crate::xcm_generic as xcm_generic_benchmarks; +use crate::{mock::*, *}; +use frame_support::traits::fungibles::Inspect; +use frame_support::{parameter_types, traits::Contains}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup, Zero}, + BuildStorage, +}; +use xcm::{ + opaque::v0::{MultiAsset, MultiLocation}, + v0::Junction, +}; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + XcmGenericBenchmarks: xcm_generic_benchmarks::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); +} + +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::AllowAll; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +/// The benchmarks in this pallet should never need an asset transactor to begin with. +pub struct NoAssetTransactor; +impl xcm_executor::traits::TransactAsset for NoAssetTransactor { + fn deposit_asset(_: &MultiAsset, _: &MultiLocation) -> Result<(), XcmError> { + unreachable!(); + } + + fn withdraw_asset(_: &MultiAsset, _: &MultiLocation) -> Result { + unreachable!(); + } +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = DevNull; + type AssetTransactor = NoAssetTransactor; + type OriginConverter = (); + type IsReserve = (); + type IsTeleporter = (); + type LocationInverter = xcm_builder::LocationInverter; + type Barrier = YesItShould; + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfConcreteFungible; + type ResponseHandler = DevNull; +} + +impl crate::Config for Test { + type XcmConfig = XcmConfig; +} +impl xcm_generic_benchmarks::Config for Test {} + +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs new file mode 100644 index 000000000000..f45a3ca6c426 --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs @@ -0,0 +1,15 @@ +pub use pallet::*; + +pub mod benchmarking; +#[cfg(test)] +mod mock; + +#[frame_support::pallet] +pub mod pallet { + #[pallet::config] + pub trait Config: frame_system::Config + crate::Config {} + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); +} From 649b422cee4becf23e8984c49eaf0ad7f8d493ab Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 3 Aug 2021 15:54:01 +0200 Subject: [PATCH 18/63] pallet-xcm-benchmarks fully compiles again with benchmarks added --- Cargo.lock | 12404 ---------------- runtime/westend/src/xcm_weights/mod.rs | 17 +- .../src/xcm_weights/pallet_balances.rs | 45 + xcm/pallet-xcm-benchmarks/Cargo.toml | 8 +- .../src/fungible/benchmarking.rs | 113 +- .../src/fungibles/benchmarking.rs | 104 +- .../src/fungibles/mod.rs | 5 +- .../src/xcm_generic/benchmarking.rs | 37 +- .../src/xcm_generic/mod.rs | 5 +- 9 files changed, 250 insertions(+), 12488 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 1fde5a0474db..000000000000 --- a/Cargo.lock +++ /dev/null @@ -1,12404 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" -dependencies = [ - "gimli 0.23.0", -] - -[[package]] -name = "addr2line" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a" -dependencies = [ - "gimli 0.24.0", -] - -[[package]] -name = "adler" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc9a9dd069569f212bc4330af9f17c4afb5e8ce185e83dbb14f1349dda18b10" - -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "aes" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" -dependencies = [ - "aes-soft", - "aesni", - "block-cipher", -] - -[[package]] -name = "aes-gcm" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" -dependencies = [ - "aead", - "aes", - "block-cipher", - "ghash", - "subtle 2.2.3", -] - -[[package]] -name = "aes-soft" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" -dependencies = [ - "block-cipher", - "byteorder", - "opaque-debug 0.2.3", -] - -[[package]] -name = "aesni" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" -dependencies = [ - "block-cipher", - "opaque-debug 0.2.3", -] - -[[package]] -name = "ahash" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6789e291be47ace86a60303502173d84af8327e3627ecf334356ee0f87a164c" - -[[package]] -name = "ahash" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" -dependencies = [ - "getrandom 0.2.1", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" -dependencies = [ - "memchr", -] - -[[package]] -name = "always-assert" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" - -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "anyhow" -version = "1.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cddc5f91628367664cc7c69714ff08deee8a3efc54623011c772544d7b2767" - -[[package]] -name = "approx" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" - -[[package]] -name = "asn1_der" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" - -[[package]] -name = "assert_cmd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc1679af9a1ab4bea16f228b05d18f8363f8327b1fa8db00d2760cfafc6b61e" -dependencies = [ - "doc-comment", - "predicates", - "predicates-core", - "predicates-tree", - "wait-timeout", -] - -[[package]] -name = "assert_matches" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "async-channel" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-mutex", - "blocking", - "futures-lite", - "num_cpus", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" -dependencies = [ - "concurrent-queue", - "fastrand", - "futures-lite", - "libc", - "log", - "nb-connect", - "once_cell", - "parking", - "polling", - "vec-arena", - "waker-fn", - "winapi 0.3.9", -] - -[[package]] -name = "async-lock" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-process" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" -dependencies = [ - "async-io", - "blocking", - "cfg-if 1.0.0", - "event-listener", - "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi 0.3.9", -] - -[[package]] -name = "async-std" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" -dependencies = [ - "async-attributes", - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "async-process", - "crossbeam-utils 0.8.1", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "num_cpus", - "once_cell", - "pin-project-lite 0.2.4", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-std-resolver" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665c56111e244fe38e7708ee10948a4356ad6a548997c21f5a63a0f4e0edc4d" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "pin-utils", - "trust-dns-resolver", -] - -[[package]] -name = "async-task" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" - -[[package]] -name = "async-trait" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "asynchronous-codec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" -dependencies = [ - "bytes 1.0.1", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite 0.2.4", -] - -[[package]] -name = "asynchronous-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" -dependencies = [ - "bytes 1.0.1", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite 0.2.4", -] - -[[package]] -name = "atomic" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" -dependencies = [ - "autocfg", -] - -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "backtrace" -version = "0.3.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" -dependencies = [ - "addr2line 0.14.1", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object 0.23.0", - "rustc-demangle", -] - -[[package]] -name = "bae" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec107f431ee3d8a8e45e6dd117adab769556ef463959e77bf6a4888d5fd500cf" -dependencies = [ - "heck", - "proc-macro-error 0.4.12", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "base-x" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" - -[[package]] -name = "base58" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "beef" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409" -dependencies = [ - "serde", -] - -[[package]] -name = "beefy-gadget" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" -dependencies = [ - "beefy-primitives", - "fnv", - "futures 0.3.15", - "hex", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-client-api", - "sc-keystore", - "sc-network", - "sc-network-gossip", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-utils", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "beefy-gadget-rpc" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" -dependencies = [ - "beefy-gadget", - "beefy-primitives", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", - "log", - "parity-scale-codec", - "sc-rpc", - "serde", - "serde_json", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "beefy-merkle-tree" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" - -[[package]] -name = "beefy-primitives" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bincode" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" -dependencies = [ - "byteorder", - "serde", -] - -[[package]] -name = "bindgen" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "bitvec" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5011ffc90248764d7005b0e10c7294f5aa1bd87d9dd7248f4ad475b347c294d" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ce5b6108f8e154604bd4eb76a2f726066c3464d5a552a4229262a18c9bb471" -dependencies = [ - "byte-tools", - "byteorder", - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug 0.2.3", -] - -[[package]] -name = "blake2-rfc" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -dependencies = [ - "arrayvec 0.4.12", - "constant_time_eq", -] - -[[package]] -name = "blake2b_simd" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - -[[package]] -name = "blake2s_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - -[[package]] -name = "blake3" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "cc", - "cfg-if 0.1.10", - "constant_time_eq", - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.3", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.4", -] - -[[package]] -name = "block-cipher" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "blocking" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - -[[package]] -name = "bp-header-chain" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bp-test-utils", - "finality-grandpa", - "frame-support", - "parity-scale-codec", - "serde", - "sp-core", - "sp-finality-grandpa", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-message-dispatch" -version = "0.1.0" -dependencies = [ - "bp-runtime", - "frame-support", - "parity-scale-codec", - "sp-std", -] - -[[package]] -name = "bp-messages" -version = "0.1.0" -dependencies = [ - "bitvec", - "bp-runtime", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "serde", - "sp-std", -] - -[[package]] -name = "bp-polkadot-core" -version = "0.1.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "hex", - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "bp-rialto" -version = "0.1.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-rococo" -version = "0.1.0" -dependencies = [ - "bp-messages", - "bp-polkadot-core", - "bp-runtime", - "frame-support", - "parity-scale-codec", - "smallvec 1.6.1", - "sp-api", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "bp-runtime" -version = "0.1.0" -dependencies = [ - "frame-support", - "hash-db", - "num-traits", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", -] - -[[package]] -name = "bp-test-utils" -version = "0.1.0" -dependencies = [ - "bp-header-chain", - "ed25519-dalek", - "finality-grandpa", - "parity-scale-codec", - "sp-application-crypto", - "sp-finality-grandpa", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-wococo" -version = "0.1.0" -dependencies = [ - "bp-messages", - "bp-polkadot-core", - "bp-rococo", - "bp-runtime", - "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bridge-runtime-common" -version = "0.1.0" -dependencies = [ - "bp-message-dispatch", - "bp-messages", - "bp-runtime", - "ed25519-dalek", - "frame-support", - "hash-db", - "pallet-bridge-dispatch", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-transaction-payment", - "parity-scale-codec", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", -] - -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bstr" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" -dependencies = [ - "memchr", -] - -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - -[[package]] -name = "bumpalo" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" - -[[package]] -name = "byte-slice-cast" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "either", - "iovec", -] - -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - -[[package]] -name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" - -[[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.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4648c6d00a709aa069a236adcaae4f605a6241c72bf5bee79331a4b625921a9" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" -dependencies = [ - "camino", - "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", - "serde", - "serde_json", -] - -[[package]] -name = "cc" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - -[[package]] -name = "chacha20" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c0f07ac275808b7bf9a39f2fd013aae1498be83632814c8c4e0bd53f2dc58" -dependencies = [ - "stream-cipher", - "zeroize", -] - -[[package]] -name = "chacha20poly1305" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b0c90556d8e3fec7cf18d84a2f53d27b21288f2fe481b830fadcf809e48205" -dependencies = [ - "aead", - "chacha20", - "poly1305", - "stream-cipher", - "zeroize", -] - -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "js-sys", - "libc", - "num-integer", - "num-traits", - "time", - "wasm-bindgen", - "winapi 0.3.9", -] - -[[package]] -name = "cid" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d88f30b1e74e7063df5711496f3ee6e74a9735d62062242d70cddf77717f18e" -dependencies = [ - "multibase", - "multihash", - "unsigned-varint 0.5.1", -] - -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e486fe53bb9f2ca0f58cb60e8679a5354fd6687a839942ef0a75967250289ca6" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "clang-sys" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" -dependencies = [ - "glob", - "libc", - "libloading 0.7.0", -] - -[[package]] -name = "clap" -version = "2.33.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" -dependencies = [ - "ansi_term 0.11.0", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "cloudabi" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" -dependencies = [ - "bitflags", -] - -[[package]] -name = "color-eyre" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f1885697ee8a177096d42f158922251a41973117f6d8a234cee94b9509157b7" -dependencies = [ - "backtrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", -] - -[[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 = "console_error_panic_hook" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" -dependencies = [ - "cfg-if 0.1.10", - "wasm-bindgen", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" -dependencies = [ - "core-foundation-sys 0.8.2", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-foundation-sys" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" - -[[package]] -name = "cpp_demangle" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" -dependencies = [ - "cfg-if 1.0.0", - "glob", -] - -[[package]] -name = "cpufeatures" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" -dependencies = [ - "libc", -] - -[[package]] -name = "cpuid-bool" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d375c433320f6c5057ae04a04376eef4d04ce2801448cf8863a78da99107be4" - -[[package]] -name = "cranelift-bforest" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ca3560686e7c9c7ed7e0fe77469f2410ba5d7781b1acaa9adc8d8deea28e3e" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf9bf1ffffb6ce3d2e5ebc83549bd2436426c99b31cc550d521364cbe35d276" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.24.0", - "log", - "regalloc", - "serde", - "smallvec 1.6.1", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc21936a5a6d07e23849ffe83e5c1f6f50305c074f4b2970ca50c13bf55b821" -dependencies = [ - "cranelift-codegen-shared", - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5b6ffaa87560bebe69a5446449da18090b126037920b0c1c6d5945f72faf6b" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-entity" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6b4a8bef04f82e4296782646f733c641d09497df2fabf791323fefaa44c64c" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-frontend" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b783b351f966fce33e3c03498cb116d16d97a8f9978164a60920bd0d3a99c" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec 1.6.1", - "target-lexicon", -] - -[[package]] -name = "cranelift-native" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c88d3dd48021ff1e37e978a00098524abd3513444ae252c08d37b310b3d2a" -dependencies = [ - "cranelift-codegen", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb6d408e2da77cdbbd65466298d44c86ae71c1785d2ab0d8657753cdb4d9d89" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.0", - "log", - "serde", - "smallvec 1.6.1", - "thiserror", - "wasmparser", -] - -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.5", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "lazy_static", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-mac" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" -dependencies = [ - "generic-array 0.12.3", - "subtle 1.0.0", -] - -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.4", - "subtle 2.2.3", -] - -[[package]] -name = "ct-logs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8e13110a84b6315df212c045be706af261fd364791cad863285439ebba672e" -dependencies = [ - "sct", -] - -[[package]] -name = "ctor" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d85653f070353a16313d0046f173f70d1aadd5b42600a14de626f0dfb3473a5" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle 2.2.3", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle 2.2.3", - "zeroize", -] - -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - -[[package]] -name = "data-encoding-macro" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a94feec3d2ba66c0b6621bca8bc6f68415b1e5c69af3586fdd0af9fd9f29b17" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f83e699727abca3c56e187945f303389590305ab2f0185ea445aa66e8d5f2a" -dependencies = [ - "data-encoding", - "syn", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive_more" -version = "0.99.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "diff" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" - -[[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.3", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "directories" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" -dependencies = [ - "libc", - "redox_users 0.3.4", - "winapi 0.3.9", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users 0.4.0", - "winapi 0.3.9", -] - -[[package]] -name = "dlmalloc" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332570860c2edf2d57914987bf9e24835425f75825086b6ba7d1e6a3e4f1f254" -dependencies = [ - "libc", -] - -[[package]] -name = "dns-parser" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" -dependencies = [ - "byteorder", - "quick-error 1.2.3", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "dyn-clonable" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dyn-clone" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c53dc3a653e0f64081026e4bf048d48fec9fce90c66e8326ca7292df0ff2d82" - -[[package]] -name = "ed25519" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf038a7b6fd7ef78ad3348b63f3a17550877b0e28f8d68bcc94894d1412158bc" -dependencies = [ - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.0.0", - "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.2", - "zeroize", -] - -[[package]] -name = "either" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" - -[[package]] -name = "enum-as-inner" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "enumflags2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" -dependencies = [ - "enumflags2_derive", -] - -[[package]] -name = "enumflags2_derive" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "enumn" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e58b112d5099aa0857c5d05f0eacab86406dd8c0f85fe5d320a13256d29ecf4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime 1.3.0", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "atty", - "humantime 2.0.1", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime 2.0.1", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "environmental" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" - -[[package]] -name = "erased-serde" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca8b296792113e1500fd935ae487be6e00ce318952a6880555554824d6ebf38" -dependencies = [ - "serde", -] - -[[package]] -name = "errno" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480f641ccf0faf324e20c1d3e53d81b7484c698b42ea677f6907ae4db195371" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" -dependencies = [ - "gcc", - "libc", -] - -[[package]] -name = "ethbloom" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd6bde671199089e601e8d47e153368b893ef885f11f365a3261ec58153c211" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-rlp", - "impl-serde", - "primitive-types", - "uint", -] - -[[package]] -name = "event-listener" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" - -[[package]] -name = "exit-future" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" -dependencies = [ - "futures 0.3.15", -] - -[[package]] -name = "eyre" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534ce924bff9118be8b28b24ede6bf7e96a00b53e4ded25050aa7b526e051e1a" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fastrand" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" -dependencies = [ - "instant", -] - -[[package]] -name = "fdlimit" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" -dependencies = [ - "libc", -] - -[[package]] -name = "femme" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af1a24f391a5a94d756db5092c6576aad494b88a71a5a36b20c67b63e0df034" -dependencies = [ - "cfg-if 0.1.10", - "js-sys", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "file-per-thread-logger" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3937f028664bd0e13df401ba49a4567ccda587420365823242977f06609ed1" -dependencies = [ - "env_logger 0.7.1", - "log", -] - -[[package]] -name = "finality-grandpa" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a1bfdcc776e63e49f741c7ce6116fa1b887e8ac2e3ccb14dd4aa113e54feb9" -dependencies = [ - "either", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot 0.11.1", -] - -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "byteorder", - "rand 0.8.4", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - -[[package]] -name = "flate2" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" -dependencies = [ - "cfg-if 0.1.10", - "crc32fast", - "libc", - "libz-sys", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "form_urlencoded" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" -dependencies = [ - "matches", - "percent-encoding 2.1.0", -] - -[[package]] -name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "linregress", - "log", - "parity-scale-codec", - "paste", - "sp-api", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", -] - -[[package]] -name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "Inflector", - "chrono", - "frame-benchmarking", - "frame-support", - "handlebars", - "parity-scale-codec", - "sc-cli", - "sc-client-db", - "sc-executor", - "sc-service", - "serde", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "structopt", -] - -[[package]] -name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-arithmetic", - "sp-npos-elections", - "sp-std", -] - -[[package]] -name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", -] - -[[package]] -name = "frame-metadata" -version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "serde", - "sp-core", - "sp-std", -] - -[[package]] -name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "bitflags", - "frame-metadata", - "frame-support-procedural", - "impl-trait-for-tuples", - "log", - "once_cell", - "parity-scale-codec", - "paste", - "serde", - "smallvec 1.6.1", - "sp-arithmetic", - "sp-core", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", -] - -[[package]] -name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "Inflector", - "frame-support-procedural-tools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-test" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-metadata", - "frame-support", - "frame-support-test-pallet", - "frame-system", - "parity-scale-codec", - "pretty_assertions 0.6.1", - "rustversion", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "trybuild", -] - -[[package]] -name = "frame-support-test-pallet" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", -] - -[[package]] -name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-api", -] - -[[package]] -name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "fs-err" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd1163ae48bda72a20ae26d66a04d3094135cadab911cff418ae5e33f253431" - -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi 0.3.9", -] - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "fs_extra" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" - -[[package]] -name = "futures" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" - -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures 0.1.29", - "num_cpus", -] - -[[package]] -name = "futures-executor" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" - -[[package]] -name = "futures-lite" -version = "1.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.4", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" -dependencies = [ - "autocfg", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-rustls" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" -dependencies = [ - "futures-io", - "rustls 0.19.1", - "webpki", -] - -[[package]] -name = "futures-sink" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" - -[[package]] -name = "futures-task" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" - -[[package]] -name = "futures-timer" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" -dependencies = [ - "gloo-timers", - "send_wrapper", -] - -[[package]] -name = "futures-util" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" -dependencies = [ - "autocfg", - "futures 0.1.29", - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite 0.2.4", - "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", -] - -[[package]] -name = "gcc" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" - -[[package]] -name = "generator" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdc09201b2e8ca1b19290cf7e65de2246b8e91fb6874279722189c4de7b94dc" -dependencies = [ - "cc", - "libc", - "log", - "rustc_version", - "winapi 0.3.9", -] - -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "ghash" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" -dependencies = [ - "polyval", -] - -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - -[[package]] -name = "gimli" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "globset" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "gloo-timers" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "fnv", - "futures 0.1.29", - "http 0.1.21", - "indexmap", - "log", - "slab", - "string", - "tokio-io", -] - -[[package]] -name = "h2" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.1", - "indexmap", - "log", - "slab", - "tokio 0.2.21", - "tokio-util", -] - -[[package]] -name = "handlebars" -version = "3.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2764f9796c0ddca4b82c07f25dd2cb3db30b9a8f47940e78e1c883d9e95c3db9" -dependencies = [ - "log", - "pest", - "pest_derive", - "quick-error 2.0.0", - "serde", - "serde_json", -] - -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash 0.4.6", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.4", -] - -[[package]] -name = "heck" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" - -[[package]] -name = "hex-literal" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8" - -[[package]] -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" - -[[package]] -name = "hmac" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" -dependencies = [ - "crypto-mac 0.7.0", - "digest 0.8.1", -] - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac-drbg" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" -dependencies = [ - "digest 0.8.1", - "generic-array 0.12.3", - "hmac 0.7.1", -] - -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.4", - "hmac 0.8.1", -] - -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi 0.3.9", -] - -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" -dependencies = [ - "bytes 0.5.6", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "http 0.1.21", - "tokio-buf", -] - -[[package]] -name = "http-body" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -dependencies = [ - "bytes 0.5.6", - "http 0.2.1", -] - -[[package]] -name = "http-body" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" -dependencies = [ - "bytes 1.0.1", - "http 0.2.1", - "pin-project-lite 0.2.4", -] - -[[package]] -name = "httparse" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" - -[[package]] -name = "httpdate" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error 1.2.3", -] - -[[package]] -name = "humantime" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" - -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "futures-cpupool", - "h2 0.1.26", - "http 0.1.21", - "http-body 0.1.0", - "httparse", - "iovec", - "itoa", - "log", - "net2", - "rustc_version", - "time", - "tokio 0.1.22", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want 0.2.0", -] - -[[package]] -name = "hyper" -version = "0.13.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" -dependencies = [ - "bytes 0.5.6", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.2.5", - "http 0.2.1", - "http-body 0.3.1", - "httparse", - "httpdate", - "itoa", - "pin-project 1.0.7", - "socket2 0.3.17", - "tokio 0.2.21", - "tower-service", - "tracing", - "want 0.3.0", -] - -[[package]] -name = "hyper" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" -dependencies = [ - "bytes 1.0.1", - "futures-channel", - "futures-core", - "futures-util", - "http 0.2.1", - "http-body 0.4.2", - "httparse", - "httpdate", - "itoa", - "pin-project 1.0.7", - "tokio 1.6.1", - "tower-service", - "tracing", - "want 0.3.0", -] - -[[package]] -name = "hyper-rustls" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" -dependencies = [ - "bytes 0.5.6", - "ct-logs", - "futures-util", - "hyper 0.13.9", - "log", - "rustls 0.18.0", - "rustls-native-certs 0.4.0", - "tokio 0.2.21", - "tokio-rustls 0.14.0", - "webpki", -] - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if-addrs" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48" -dependencies = [ - "if-addrs-sys", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "if-addrs-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "if-watch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6d52908d4ea4ab2bc22474ba149bf1011c8e2c3ebc1ff593ae28ac44f494b6" -dependencies = [ - "async-io", - "futures 0.3.15", - "futures-lite", - "if-addrs", - "ipnet", - "libc", - "log", - "winapi 0.3.9", -] - -[[package]] -name = "impl-codec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "indenter" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bd112d44d9d870a6819eb505d04dd92b5e4d94bb8c304924a0872ae7016fb5" - -[[package]] -name = "indexmap" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" -dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485" - -[[package]] -name = "integer-encoding" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4ebd0bd29be0f11973e9b3e219005661042a019fd757798c36a47c87852625" - -[[package]] -name = "integer-sqrt" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f65877bf7d44897a473350b1046277941cee20b263397e90869c50b6e766088b" - -[[package]] -name = "intervalier" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" -dependencies = [ - "futures 0.3.15", - "futures-timer 2.0.2", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "ip_network" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" - -[[package]] -name = "ipconfig" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" -dependencies = [ - "socket2 0.3.17", - "widestring", - "winapi 0.3.9", - "winreg", -] - -[[package]] -name = "ipnet" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" - -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" - -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69" -dependencies = [ - "jemalloc-sys", - "libc", -] - -[[package]] -name = "jobserver" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "jsonrpc-client-transports" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" -dependencies = [ - "failure", - "futures 0.1.29", - "jsonrpc-core", - "jsonrpc-pubsub", - "log", - "serde", - "serde_json", - "url 1.7.2", -] - -[[package]] -name = "jsonrpc-core" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" -dependencies = [ - "futures 0.1.29", - "log", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "jsonrpc-core-client" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" -dependencies = [ - "jsonrpc-client-transports", -] - -[[package]] -name = "jsonrpc-derive" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" -dependencies = [ - "proc-macro-crate 0.1.5", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "jsonrpc-http-server" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" -dependencies = [ - "hyper 0.12.35", - "jsonrpc-core", - "jsonrpc-server-utils", - "log", - "net2", - "parking_lot 0.10.2", - "unicase", -] - -[[package]] -name = "jsonrpc-ipc-server" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" -dependencies = [ - "jsonrpc-core", - "jsonrpc-server-utils", - "log", - "parity-tokio-ipc", - "parking_lot 0.10.2", - "tokio-service", -] - -[[package]] -name = "jsonrpc-pubsub" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" -dependencies = [ - "jsonrpc-core", - "log", - "parking_lot 0.10.2", - "rand 0.7.3", - "serde", -] - -[[package]] -name = "jsonrpc-server-utils" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" -dependencies = [ - "bytes 0.4.12", - "globset", - "jsonrpc-core", - "lazy_static", - "log", - "tokio 0.1.22", - "tokio-codec", - "unicase", -] - -[[package]] -name = "jsonrpc-ws-server" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" -dependencies = [ - "jsonrpc-core", - "jsonrpc-server-utils", - "log", - "parity-ws", - "parking_lot 0.10.2", - "slab", -] - -[[package]] -name = "jsonrpsee-proc-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37924e16300e249a52a22cabb5632f846dc9760b39355f5e8bc70cd23dc6300" -dependencies = [ - "Inflector", - "bae", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d67724d368c59e08b557a516cf8fcc51100e7a708850f502e1044b151fe89788" -dependencies = [ - "async-trait", - "beef", - "futures-channel", - "futures-util", - "hyper 0.14.5", - "log", - "serde", - "serde_json", - "soketto 0.6.0", - "thiserror", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2834b6e7f57ce9a4412ed4d6dc95125d2c8612e68f86b9d9a07369164e4198" -dependencies = [ - "async-trait", - "fnv", - "futures 0.3.15", - "jsonrpsee-types", - "log", - "pin-project 1.0.7", - "rustls 0.19.1", - "rustls-native-certs 0.5.0", - "serde", - "serde_json", - "soketto 0.6.0", - "thiserror", - "tokio 0.2.21", - "tokio-rustls 0.15.0", - "tokio-util", - "url 2.2.0", -] - -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "kusama-runtime" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-bounties", - "pallet-collective", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-elections-phragmen", - "pallet-gilt", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-mmr-primitives", - "pallet-multisig", - "pallet-nicks", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-proxy", - "pallet-recovery", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-society", - "pallet-staking", - "pallet-staking-reward-fn", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-xcm", - "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "rustc-hex", - "separator", - "serde", - "serde_derive", - "serde_json", - "smallvec 1.6.1", - "sp-api", - "sp-arithmetic", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "tiny-keccak", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "kvdb" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a3f58dc069ec0e205a27f5b45920722a46faed802a0541538241af6228f512" -dependencies = [ - "parity-util-mem", - "smallvec 1.6.1", -] - -[[package]] -name = "kvdb-memorydb" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b6b85fc643f5acd0bffb2cc8a6d150209379267af0d41db72170021841f9f5" -dependencies = [ - "kvdb", - "parity-util-mem", - "parking_lot 0.11.1", -] - -[[package]] -name = "kvdb-rocksdb" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431ca65516efab86e65d96281f750ebb54277dec656fcf6c027f3d1c0cb69e4c" -dependencies = [ - "fs-swap", - "kvdb", - "log", - "num_cpus", - "owning_ref", - "parity-util-mem", - "parking_lot 0.11.1", - "regex", - "rocksdb", - "smallvec 1.6.1", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" - -[[package]] -name = "libc" -version = "0.2.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" - -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi 0.3.9", -] - -[[package]] -name = "libloading" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" -dependencies = [ - "cfg-if 1.0.0", - "winapi 0.3.9", -] - -[[package]] -name = "libm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" - -[[package]] -name = "libp2p" -version = "0.37.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741b" -dependencies = [ - "atomic", - "bytes 1.0.1", - "futures 0.3.15", - "lazy_static", - "libp2p-core", - "libp2p-deflate", - "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", - "libp2p-identify", - "libp2p-kad", - "libp2p-mdns", - "libp2p-mplex", - "libp2p-noise", - "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-request-response", - "libp2p-swarm", - "libp2p-swarm-derive", - "libp2p-tcp", - "libp2p-uds", - "libp2p-wasm-ext", - "libp2p-websocket", - "libp2p-yamux", - "parity-multiaddr", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "smallvec 1.6.1", - "wasm-timer", -] - -[[package]] -name = "libp2p-core" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71dd51b562e14846e65bad00e5808d0644376e6588668c490d3c48e1dfeb4a9a" -dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures 0.3.15", - "futures-timer 3.0.2", - "lazy_static", - "libsecp256k1 0.3.5", - "log", - "multihash", - "multistream-select", - "parity-multiaddr", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "prost", - "prost-build", - "rand 0.7.3", - "ring", - "rw-stream-sink", - "sha2 0.9.2", - "smallvec 1.6.1", - "thiserror", - "unsigned-varint 0.7.0", - "void", - "zeroize", -] - -[[package]] -name = "libp2p-deflate" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" -dependencies = [ - "flate2", - "futures 0.3.15", - "libp2p-core", -] - -[[package]] -name = "libp2p-dns" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" -dependencies = [ - "async-std-resolver", - "futures 0.3.15", - "libp2p-core", - "log", - "smallvec 1.6.1", - "trust-dns-resolver", -] - -[[package]] -name = "libp2p-floodsub" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48a9b570f6766301d9c4aa00fce3554cad1598e2f466debbc4dde909028417cf" -dependencies = [ - "cuckoofilter", - "fnv", - "futures 0.3.15", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec 1.6.1", -] - -[[package]] -name = "libp2p-gossipsub" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cb9a89a301afde1e588c73f7e9131e12a5388725f290a9047b878862db1b53" -dependencies = [ - "asynchronous-codec 0.6.0", - "base64 0.13.0", - "byteorder", - "bytes 1.0.1", - "fnv", - "futures 0.3.15", - "hex_fmt", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "regex", - "sha2 0.9.2", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", - "wasm-timer", -] - -[[package]] -name = "libp2p-identify" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f668f00efd9883e8b7bcc582eaf0164615792608f886f6577da18bcbeea0a46" -dependencies = [ - "futures 0.3.15", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "smallvec 1.6.1", - "wasm-timer", -] - -[[package]] -name = "libp2p-kad" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07312ebe5ee4fd2404447a0609814574df55c65d4e20838b957bbd34907d820" -dependencies = [ - "arrayvec 0.5.2", - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "either", - "fnv", - "futures 0.3.15", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.9.2", - "smallvec 1.6.1", - "uint", - "unsigned-varint 0.7.0", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-mdns" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c221897b3fd7f215de7ecfec215c5eba598e5b61c605b5f8b56fe8a4fb507724" -dependencies = [ - "async-io", - "data-encoding", - "dns-parser", - "futures 0.3.15", - "if-watch", - "lazy_static", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.8.4", - "smallvec 1.6.1", - "socket2 0.4.0", - "void", -] - -[[package]] -name = "libp2p-mplex" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures 0.3.15", - "libp2p-core", - "log", - "nohash-hasher", - "parking_lot 0.11.1", - "rand 0.7.3", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", -] - -[[package]] -name = "libp2p-noise" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" -dependencies = [ - "bytes 1.0.1", - "curve25519-dalek 3.0.0", - "futures 0.3.15", - "lazy_static", - "libp2p-core", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.9.2", - "snow", - "static_assertions", - "x25519-dalek 1.1.0", - "zeroize", -] - -[[package]] -name = "libp2p-ping" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4bfaffac63bf3c7ec11ed9d8879d455966ddea7e78ee14737f0b6dce0d1cd1" -dependencies = [ - "futures 0.3.15", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures 0.3.15", - "libp2p-core", - "log", - "prost", - "prost-build", - "unsigned-varint 0.7.0", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" -dependencies = [ - "futures 0.3.15", - "log", - "pin-project 1.0.7", - "rand 0.7.3", - "salsa20", - "sha3", -] - -[[package]] -name = "libp2p-relay" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8786aca3f18671d8776289706a5521f6c9124a820f69e358de214b9939440d" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures 0.3.15", - "futures-timer 3.0.2", - "libp2p-core", - "libp2p-swarm", - "log", - "pin-project 1.0.7", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-request-response" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdbe172f08e6d0f95fa8634e273d4c4268c4063de2e33e7435194b0130c62e3" -dependencies = [ - "async-trait", - "bytes 1.0.1", - "futures 0.3.15", - "libp2p-core", - "libp2p-swarm", - "log", - "lru", - "minicbor", - "rand 0.7.3", - "smallvec 1.6.1", - "unsigned-varint 0.7.0", - "wasm-timer", -] - -[[package]] -name = "libp2p-swarm" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92" -dependencies = [ - "either", - "futures 0.3.15", - "libp2p-core", - "log", - "rand 0.7.3", - "smallvec 1.6.1", - "void", - "wasm-timer", -] - -[[package]] -name = "libp2p-swarm-derive" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "365b0a699fea5168676840567582a012ea297b1ca02eee467e58301b9c9c5eed" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "libp2p-tcp" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" -dependencies = [ - "async-io", - "futures 0.3.15", - "futures-timer 3.0.2", - "if-watch", - "ipnet", - "libc", - "libp2p-core", - "log", - "socket2 0.4.0", -] - -[[package]] -name = "libp2p-uds" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" -dependencies = [ - "async-std", - "futures 0.3.15", - "libp2p-core", - "log", -] - -[[package]] -name = "libp2p-wasm-ext" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef45d61e43c313531b5e903e4e8415212ff6338e0c54c47da5b9b412b5760de" -dependencies = [ - "futures 0.3.15", - "js-sys", - "libp2p-core", - "parity-send-wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - -[[package]] -name = "libp2p-websocket" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" -dependencies = [ - "either", - "futures 0.3.15", - "futures-rustls", - "libp2p-core", - "log", - "quicksink", - "rw-stream-sink", - "soketto 0.4.1", - "url 2.2.0", - "webpki-roots", -] - -[[package]] -name = "libp2p-yamux" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f35da42cfc6d5cb0dcf3ad6881bc68d146cdf38f98655e09e33fbba4d13eabc4" -dependencies = [ - "futures 0.3.15", - "libp2p-core", - "parking_lot 0.11.1", - "thiserror", - "yamux", -] - -[[package]] -name = "librocksdb-sys" -version = "6.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9" -dependencies = [ - "bindgen", - "cc", - "glob", - "libc", -] - -[[package]] -name = "libsecp256k1" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" -dependencies = [ - "arrayref", - "crunchy", - "digest 0.8.1", - "hmac-drbg 0.2.0", - "rand 0.7.3", - "sha2 0.8.2", - "subtle 2.2.3", - "typenum", -] - -[[package]] -name = "libsecp256k1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" -dependencies = [ - "arrayref", - "base64 0.12.3", - "digest 0.9.0", - "hmac-drbg 0.3.0", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.7.3", - "serde", - "sha2 0.9.2", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle 2.2.3", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libz-sys" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" - -[[package]] -name = "linked_hash_set" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "linregress" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6e407dadb4ca4b31bc69c27aff00e7ca4534fdcee855159b039a7cebb5f395" -dependencies = [ - "nalgebra", - "statrs", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "lock_api" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", - "value-bag", -] - -[[package]] -name = "loom" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" -dependencies = [ - "cfg-if 0.1.10", - "generator", - "scoped-tls", - "serde", - "serde_json", -] - -[[package]] -name = "lru" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" -dependencies = [ - "hashbrown 0.9.1", -] - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "matrixmultiply" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" -dependencies = [ - "rawpointer", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" - -[[package]] -name = "memmap2" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73be3b7d04a0123e933fea1d50d126cc7196bbc0362c0ce426694f777194eee" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memory-db" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de006e09d04fc301a5f7e817b75aa49801c4479a8af753764416b085337ddcc5" -dependencies = [ - "hash-db", - "hashbrown 0.11.2", - "parity-util-mem", -] - -[[package]] -name = "memory-lru" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" -dependencies = [ - "lru", -] - -[[package]] -name = "memory_units" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" - -[[package]] -name = "merlin" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6feca46f4fa3443a01769d768727f10c10a20fdb65e52dc16a81f0c8269bb78" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "metered-channel" -version = "0.1.0" -dependencies = [ - "assert_matches", - "derive_more", - "futures 0.3.15", - "futures-timer 3.0.2", -] - -[[package]] -name = "mick-jaeger" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c023c3f16109e7f33aa451f773fd61070e265b4977d0b6e344a51049296dd7df" -dependencies = [ - "futures 0.3.15", - "rand 0.7.3", - "thrift", -] - -[[package]] -name = "minicbor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea79ce4ab9f445ec6b71833a2290ac0a29c9dde0fa7cae4c481eecae021d9bd9" -dependencies = [ - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce18b5423c573a13e80cb3046ea0af6379ef725dc3af4886bdb8f4e5093068" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.1", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio", - "miow 0.3.5", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio", -] - -[[package]] -name = "miow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "miow" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" -dependencies = [ - "socket2 0.3.17", - "winapi 0.3.9", -] - -[[package]] -name = "more-asserts" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" - -[[package]] -name = "multibase" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb63389ee5fcd4df3f8727600f4a0c3df53c541f0ed4e8b50a9ae51a80fc1efe" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "digest 0.9.0", - "generic-array 0.14.4", - "multihash-derive", - "sha2 0.9.2", - "sha3", - "unsigned-varint 0.5.1", -] - -[[package]] -name = "multihash-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5653449cd45d502a53480ee08d7a599e8f4893d2bacb33c63d65bc20af6c1a" -dependencies = [ - "proc-macro-crate 0.1.5", - "proc-macro-error 1.0.4", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "multimap" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" - -[[package]] -name = "multistream-select" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10ddc0eb0117736f19d556355464fc87efc8ad98b29e3fd84f02531eb6e90840" -dependencies = [ - "bytes 1.0.1", - "futures 0.3.15", - "log", - "pin-project 1.0.7", - "smallvec 1.6.1", - "unsigned-varint 0.6.0", -] - -[[package]] -name = "nalgebra" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational 0.4.0", - "num-traits", - "rand 0.8.4", - "rand_distr", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "names" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" -dependencies = [ - "rand 0.3.23", -] - -[[package]] -name = "nb-connect" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "net2" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "nix" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - -[[package]] -name = "object" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" -dependencies = [ - "crc32fast", - "indexmap", -] - -[[package]] -name = "once_cell" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad167a2f54e832b82dbe003a046280dceffe5227b5f79e08e363a29638cfddd" -dependencies = [ - "parking_lot 0.11.1", -] - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssl-probe" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" - -[[package]] -name = "ordered-float" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" -dependencies = [ - "num-traits", -] - -[[package]] -name = "output_vt100" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "owo-colors" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" - -[[package]] -name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "pallet-session", - "parity-scale-codec", - "sp-application-crypto", - "sp-authority-discovery", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "sp-authorship", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-babe" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "pallet-timestamp", - "parity-scale-codec", - "sp-application-crypto", - "sp-consensus-babe", - "sp-consensus-vrf", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-beefy" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" -dependencies = [ - "beefy-primitives", - "frame-support", - "frame-system", - "pallet-session", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-beefy-mmr" -version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#26d617c699afc6c7f8f4207e72aee59449712765" -dependencies = [ - "beefy-merkle-tree", - "beefy-primitives", - "frame-support", - "frame-system", - "hex", - "libsecp256k1 0.3.5", - "log", - "pallet-beefy", - "pallet-mmr", - "pallet-mmr-primitives", - "pallet-session", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-bounties" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-treasury", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-bridge-dispatch" -version = "0.1.0" -dependencies = [ - "bp-message-dispatch", - "bp-runtime", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-bridge-grandpa" -version = "0.1.0" -dependencies = [ - "bp-header-chain", - "bp-runtime", - "bp-test-utils", - "finality-grandpa", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "num-traits", - "parity-scale-codec", - "serde", - "sp-finality-grandpa", - "sp-io", - "sp-runtime", - "sp-std", - "sp-trie", -] - -[[package]] -name = "pallet-bridge-messages" -version = "0.1.0" -dependencies = [ - "bitvec", - "bp-message-dispatch", - "bp-messages", - "bp-rialto", - "bp-runtime", - "frame-benchmarking", - "frame-support", - "frame-system", - "hex", - "hex-literal", - "log", - "num-traits", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-collective" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-democracy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "serde", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-election-provider-multi-phase" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "rand 0.7.3", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-std", - "static_assertions", -] - -[[package]] -name = "pallet-elections-phragmen" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-gilt" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-arithmetic", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "sp-application-crypto", - "sp-core", - "sp-finality-grandpa", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-identity" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-im-online" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "parity-scale-codec", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-indices" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-membership" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-mmr" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "ckb-merkle-mountain-range", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-mmr-primitives", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-mmr-primitives" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "serde", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-mmr-rpc" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "pallet-mmr-primitives", - "parity-scale-codec", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", -] - -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-nicks" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-offences" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-offences-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "pallet-babe", - "pallet-balances", - "pallet-grandpa", - "pallet-im-online", - "pallet-offences", - "pallet-session", - "pallet-staking", - "parity-scale-codec", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-proxy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-recovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "enumflags2", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-scheduler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-trie", -] - -[[package]] -name = "pallet-session-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-session", - "pallet-staking", - "rand 0.7.3", - "sp-runtime", - "sp-session", - "sp-std", -] - -[[package]] -name = "pallet-society" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "rand_chacha 0.2.2", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "paste", - "rand_chacha 0.2.2", - "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", - "static_assertions", -] - -[[package]] -name = "pallet-staking-reward-curve" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pallet-staking-reward-fn" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "sp-arithmetic", -] - -[[package]] -name = "pallet-sudo" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "pallet-tips" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-treasury", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "serde", - "smallvec 1.6.1", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", -] - -[[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "pallet-transaction-payment", - "parity-scale-codec", - "sp-api", - "sp-runtime", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-utility" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-xcm" -version = "0.1.0" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "serde", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "pallet-xcm-benchmarks" -version = "0.9.8" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-assets", - "pallet-balances", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "parity-db" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e337f62db341435f0da05b8f6b97e984ef4ea5800510cd07c2d624688c40b47" -dependencies = [ - "blake2-rfc", - "crc32fast", - "fs2", - "hex", - "libc", - "log", - "memmap2", - "parking_lot 0.11.1", - "rand 0.8.4", -] - -[[package]] -name = "parity-multiaddr" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" -dependencies = [ - "arrayref", - "bs58", - "byteorder", - "data-encoding", - "multihash", - "percent-encoding 2.1.0", - "serde", - "static_assertions", - "unsigned-varint 0.7.0", - "url 2.2.0", -] - -[[package]] -name = "parity-scale-codec" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8975095a2a03bbbdc70a74ab11a4f76a6d0b84680d87c68d722531b0ac28e8a9" -dependencies = [ - "arrayvec 0.7.0", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40dbbfef7f0a1143c5b06e0d76a6278e25dac0bc1af4be51a0fbb73f07e7ad09" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "parity-send-wrapper" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" - -[[package]] -name = "parity-tokio-ipc" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "libc", - "log", - "mio-named-pipes", - "miow 0.3.5", - "rand 0.7.3", - "tokio 0.1.22", - "tokio-named-pipes", - "tokio-uds", - "winapi 0.3.9", -] - -[[package]] -name = "parity-util-mem" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad6f1acec69b95caf435bbd158d486e5a0a44fcf51531e84922c59ff09e8457" -dependencies = [ - "cfg-if 1.0.0", - "ethereum-types", - "hashbrown 0.11.2", - "impl-trait-for-tuples", - "jemallocator", - "lru", - "parity-util-mem-derive", - "parking_lot 0.11.1", - "primitive-types", - "smallvec 1.6.1", - "winapi 0.3.9", -] - -[[package]] -name = "parity-util-mem-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -dependencies = [ - "proc-macro2", - "syn", - "synstructure", -] - -[[package]] -name = "parity-wasm" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" -dependencies = [ - "byteorder", -] - -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - -[[package]] -name = "parity-ws" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322d72dfe461b8b9e367d057ceace105379d64d5b03907d23c481ccf3fbf8aa4" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "rand 0.7.3", - "sha-1 0.8.2", - "slab", - "url 2.2.0", -] - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.6.2", - "rustc_version", -] - -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", -] - -[[package]] -name = "parking_lot" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" -dependencies = [ - "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.0.3", - "libc", - "redox_syscall 0.1.56", - "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.0.3", - "libc", - "redox_syscall 0.1.56", - "smallvec 1.6.1", - "winapi 0.3.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.1.0", - "instant", - "libc", - "redox_syscall 0.1.56", - "smallvec 1.6.1", - "winapi 0.3.9", -] - -[[package]] -name = "paste" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" - -[[package]] -name = "pbkdf2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" -dependencies = [ - "byteorder", - "crypto-mac 0.7.0", -] - -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac 0.8.0", -] - -[[package]] -name = "pdqselect" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec91767ecc0a0bbe558ce8c9da33c068066c57ecc8bb8477ef8c1ad3ef77c27" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" -dependencies = [ - "maplit", - "pest", - "sha-1 0.8.2", -] - -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" -dependencies = [ - "pin-project-internal 0.4.23", -] - -[[package]] -name = "pin-project" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" -dependencies = [ - "pin-project-internal 1.0.7", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" - -[[package]] -name = "pin-project-lite" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" - -[[package]] -name = "platforms" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" - -[[package]] -name = "polkadot" -version = "0.9.8" -dependencies = [ - "assert_cmd", - "color-eyre", - "nix", - "parity-util-mem", - "polkadot-cli", - "tempfile", -] - -[[package]] -name = "polkadot-approval-distribution" -version = "0.1.0" -dependencies = [ - "assert_matches", - "env_logger 0.8.4", - "futures 0.3.15", - "log", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand_core 0.5.1", - "schnorrkel", - "sp-core", - "tracing", -] - -[[package]] -name = "polkadot-availability-bitfield-distribution" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bitvec", - "env_logger 0.8.4", - "futures 0.3.15", - "log", - "maplit", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "tracing", -] - -[[package]] -name = "polkadot-availability-distribution" -version = "0.1.0" -dependencies = [ - "assert_matches", - "futures 0.3.15", - "futures-timer 3.0.2", - "lru", - "maplit", - "parity-scale-codec", - "polkadot-erasure-coding", - "polkadot-node-core-runtime-api", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.4", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-tracing", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-availability-recovery" -version = "0.1.0" -dependencies = [ - "assert_matches", - "env_logger 0.8.4", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "lru", - "parity-scale-codec", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.4", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-cli" -version = "0.9.8" -dependencies = [ - "frame-benchmarking-cli", - "futures 0.3.15", - "log", - "polkadot-node-core-pvf", - "polkadot-service", - "sc-cli", - "sc-service", - "sp-core", - "sp-trie", - "structopt", - "substrate-browser-utils", - "substrate-build-script-utils", - "thiserror", - "try-runtime-cli", - "wasm-bindgen", - "wasm-bindgen-futures", -] - -[[package]] -name = "polkadot-client" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "frame-benchmarking", - "frame-system-rpc-runtime-api", - "kusama-runtime", - "pallet-mmr-primitives", - "pallet-transaction-payment-rpc-runtime-api", - "polkadot-primitives", - "polkadot-runtime", - "rococo-runtime", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-service", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-finality-grandpa", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage", - "sp-transaction-pool", - "westend-runtime", -] - -[[package]] -name = "polkadot-collator-protocol" -version = "0.1.0" -dependencies = [ - "always-assert", - "assert_matches", - "env_logger 0.8.4", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-network", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-core-primitives" -version = "0.9.8" -dependencies = [ - "parity-scale-codec", - "parity-util-mem", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "polkadot-dispute-distribution" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "lazy_static", - "lru", - "maplit", - "parity-scale-codec", - "polkadot-erasure-coding", - "polkadot-node-core-runtime-api", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.4", - "sc-keystore", - "sc-network", - "smallvec 1.6.1", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-tracing", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-erasure-coding" -version = "0.9.8" -dependencies = [ - "parity-scale-codec", - "polkadot-node-primitives", - "polkadot-primitives", - "reed-solomon-novelpoly", - "sp-core", - "sp-trie", - "thiserror", -] - -[[package]] -name = "polkadot-gossip-support" -version = "0.1.0" -dependencies = [ - "assert_matches", - "futures 0.3.15", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.4", - "rand_chacha 0.3.1", - "sp-application-crypto", - "sp-consensus-babe", - "sp-core", - "sp-keyring", - "sp-keystore", - "tracing", -] - -[[package]] -name = "polkadot-network-bridge" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "parity-scale-codec", - "parking_lot 0.11.1", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sc-network", - "sp-consensus", - "sp-core", - "sp-keyring", - "strum", - "tracing", -] - -[[package]] -name = "polkadot-node-collation-generation" -version = "0.1.0" -dependencies = [ - "futures 0.3.15", - "parity-scale-codec", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "sp-maybe-compressed-blob", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-approval-voting" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bitvec", - "derive_more", - "futures 0.3.15", - "futures-timer 3.0.2", - "kvdb", - "kvdb-memorydb", - "lru", - "maplit", - "merlin", - "parity-scale-codec", - "parking_lot 0.11.1", - "polkadot-node-jaeger", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "rand 0.8.4", - "rand_core 0.5.1", - "sc-client-api", - "sc-keystore", - "schnorrkel", - "sp-application-crypto", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "tracing", -] - -[[package]] -name = "polkadot-node-core-av-store" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bitvec", - "env_logger 0.8.4", - "futures 0.3.15", - "futures-timer 3.0.2", - "kvdb", - "kvdb-memorydb", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sp-core", - "sp-keyring", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-backing" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bitvec", - "futures 0.3.15", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "polkadot-statement-table", - "sc-keystore", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-tracing", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-bitfield-signing" -version = "0.1.0" -dependencies = [ - "futures 0.3.15", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-keystore", - "thiserror", - "tracing", - "wasm-timer", -] - -[[package]] -name = "polkadot-node-core-candidate-validation" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-trait", - "futures 0.3.15", - "parity-scale-codec", - "polkadot-node-core-pvf", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-parachain", - "polkadot-primitives", - "sp-core", - "sp-keyring", - "sp-maybe-compressed-blob", - "tracing", -] - -[[package]] -name = "polkadot-node-core-chain-api" -version = "0.1.0" -dependencies = [ - "futures 0.3.15", - "maplit", - "parity-scale-codec", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-client-api", - "sc-consensus-babe", - "sp-blockchain", - "sp-core", - "tracing", -] - -[[package]] -name = "polkadot-node-core-chain-selection" -version = "0.1.0" -dependencies = [ - "assert_matches", - "futures 0.3.15", - "futures-timer 3.0.2", - "kvdb", - "kvdb-memorydb", - "parity-scale-codec", - "parking_lot 0.11.1", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-dispute-coordinator" -version = "0.1.0" -dependencies = [ - "assert_matches", - "bitvec", - "derive_more", - "futures 0.3.15", - "kvdb", - "kvdb-memorydb", - "parity-scale-codec", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sc-keystore", - "sp-core", - "sp-keyring", - "sp-keystore", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-dispute-participation" -version = "0.1.0" -dependencies = [ - "assert_matches", - "futures 0.3.15", - "parity-scale-codec", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-primitives", - "sp-core", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-parachains-inherent" -version = "0.1.0" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "polkadot-node-subsystem", - "polkadot-primitives", - "sp-blockchain", - "sp-inherents", - "sp-runtime", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-provisioner" -version = "0.1.0" -dependencies = [ - "bitvec", - "futures 0.3.15", - "futures-timer 3.0.2", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-application-crypto", - "sp-keystore", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-core-pvf" -version = "0.1.0" -dependencies = [ - "always-assert", - "assert_matches", - "async-process", - "async-std", - "futures 0.3.15", - "futures-timer 3.0.2", - "hex-literal", - "libc", - "parity-scale-codec", - "pin-project 1.0.7", - "polkadot-core-primitives", - "polkadot-parachain", - "rand 0.8.4", - "sc-executor", - "sc-executor-common", - "sc-executor-wasmtime", - "slotmap", - "sp-core", - "sp-externalities", - "sp-io", - "sp-maybe-compressed-blob", - "sp-tracing", - "sp-wasm-interface", - "tempfile", - "test-parachain-adder", - "test-parachain-halt", - "tracing", -] - -[[package]] -name = "polkadot-node-core-runtime-api" -version = "0.1.0" -dependencies = [ - "futures 0.3.15", - "memory-lru", - "parity-util-mem", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-api", - "sp-authority-discovery", - "sp-consensus-babe", - "sp-core", - "tracing", -] - -[[package]] -name = "polkadot-node-jaeger" -version = "0.1.0" -dependencies = [ - "async-std", - "lazy_static", - "log", - "mick-jaeger", - "parity-scale-codec", - "parking_lot 0.11.1", - "polkadot-node-primitives", - "polkadot-primitives", - "sc-network", - "sp-core", - "thiserror", -] - -[[package]] -name = "polkadot-node-metrics" -version = "0.1.0" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "metered-channel", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "polkadot-node-network-protocol" -version = "0.1.0" -dependencies = [ - "async-trait", - "futures 0.3.15", - "parity-scale-codec", - "polkadot-node-jaeger", - "polkadot-node-primitives", - "polkadot-primitives", - "sc-authority-discovery", - "sc-network", - "strum", - "thiserror", -] - -[[package]] -name = "polkadot-node-primitives" -version = "0.1.0" -dependencies = [ - "futures 0.3.15", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-statement-table", - "schnorrkel", - "serde", - "sp-application-crypto", - "sp-consensus-babe", - "sp-consensus-vrf", - "sp-core", - "sp-keystore", - "sp-maybe-compressed-blob", - "sp-runtime", - "thiserror", - "tracing", - "zstd", -] - -[[package]] -name = "polkadot-node-subsystem" -version = "0.1.0" -dependencies = [ - "polkadot-node-jaeger", - "polkadot-node-subsystem-types", - "polkadot-overseer", -] - -[[package]] -name = "polkadot-node-subsystem-test-helpers" -version = "0.1.0" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "polkadot-statement-table", - "sc-keystore", - "sc-network", - "smallvec 1.6.1", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "sp-keystore", - "tracing", -] - -[[package]] -name = "polkadot-node-subsystem-types" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-std", - "async-trait", - "derive_more", - "futures 0.3.15", - "futures-timer 3.0.2", - "lazy_static", - "log", - "mick-jaeger", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "polkadot-node-jaeger", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem-test-helpers", - "polkadot-overseer-gen", - "polkadot-primitives", - "polkadot-statement-table", - "sc-network", - "smallvec 1.6.1", - "sp-core", - "substrate-prometheus-endpoint", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-node-subsystem-util" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-trait", - "env_logger 0.8.4", - "futures 0.3.15", - "futures-timer 3.0.2", - "itertools 0.10.0", - "log", - "lru", - "metered-channel", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "polkadot-node-jaeger", - "polkadot-node-metrics", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-overseer", - "polkadot-primitives", - "rand 0.8.4", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "substrate-prometheus-endpoint", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-overseer" -version = "0.1.0" -dependencies = [ - "assert_matches", - "async-trait", - "femme", - "futures 0.3.15", - "futures-timer 3.0.2", - "kv-log-macro", - "lru", - "metered-channel", - "parking_lot 0.11.1", - "polkadot-node-metrics", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem-types", - "polkadot-overseer-all-subsystems-gen", - "polkadot-overseer-gen", - "polkadot-primitives", - "sc-client-api", - "sp-api", - "sp-core", - "tracing", -] - -[[package]] -name = "polkadot-overseer-all-subsystems-gen" -version = "0.1.0" -dependencies = [ - "assert_matches", - "proc-macro2", - "quote", - "syn", - "trybuild", -] - -[[package]] -name = "polkadot-overseer-gen" -version = "0.1.0" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "metered-channel", - "pin-project 1.0.7", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-overseer-gen-proc-macro", - "thiserror", - "tracing", - "trybuild", -] - -[[package]] -name = "polkadot-overseer-gen-proc-macro" -version = "0.1.0" -dependencies = [ - "assert_matches", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "polkadot-parachain" -version = "0.9.8" -dependencies = [ - "derive_more", - "parity-scale-codec", - "parity-util-mem", - "polkadot-core-primitives", - "serde", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "polkadot-primitives" -version = "0.9.8" -dependencies = [ - "bitvec", - "frame-system", - "hex-literal", - "parity-scale-codec", - "parity-util-mem", - "polkadot-core-primitives", - "polkadot-parachain", - "pretty_assertions 0.7.2", - "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-serializer", - "sp-staking", - "sp-std", - "sp-trie", - "sp-version", - "thiserror", -] - -[[package]] -name = "polkadot-rpc" -version = "0.9.8" -dependencies = [ - "beefy-gadget", - "beefy-gadget-rpc", - "jsonrpc-core", - "pallet-mmr-rpc", - "pallet-transaction-payment-rpc", - "parity-scale-codec", - "polkadot-primitives", - "sc-chain-spec", - "sc-client-api", - "sc-consensus-babe", - "sc-consensus-babe-rpc", - "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-finality-grandpa-rpc", - "sc-keystore", - "sc-rpc", - "sc-sync-state-rpc", - "sc-transaction-pool-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-keystore", - "sp-runtime", - "substrate-frame-rpc-system", -] - -[[package]] -name = "polkadot-runtime" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-bounties", - "pallet-collective", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-elections-phragmen", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-mmr-primitives", - "pallet-multisig", - "pallet-nicks", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-proxy", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-common", - "rustc-hex", - "separator", - "serde", - "serde_derive", - "serde_json", - "smallvec 1.6.1", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "tiny-keccak", - "trie-db", -] - -[[package]] -name = "polkadot-runtime-common" -version = "0.9.8" -dependencies = [ - "bitvec", - "frame-benchmarking", - "frame-support", - "frame-support-test", - "frame-system", - "hex-literal", - "impl-trait-for-tuples", - "libsecp256k1 0.6.0", - "log", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-beefy-mmr", - "pallet-election-provider-multi-phase", - "pallet-offences", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-treasury", - "pallet-vesting", - "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-parachains", - "rustc-hex", - "serde", - "serde_derive", - "serde_json", - "slot-range-helper", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-trie", - "static_assertions", - "trie-db", - "xcm", -] - -[[package]] -name = "polkadot-runtime-parachains" -version = "0.9.8" -dependencies = [ - "bitflags", - "bitvec", - "derive_more", - "frame-benchmarking", - "frame-support", - "frame-support-test", - "frame-system", - "futures 0.3.15", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-offences", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "pallet-treasury", - "pallet-vesting", - "parity-scale-codec", - "polkadot-primitives", - "rand 0.8.4", - "rand_chacha 0.3.1", - "rustc-hex", - "sc-keystore", - "serde", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-trie", - "sp-version", - "xcm", - "xcm-executor", -] - -[[package]] -name = "polkadot-service" -version = "0.9.8" -dependencies = [ - "assert_matches", - "async-trait", - "beefy-gadget", - "beefy-primitives", - "env_logger 0.9.0", - "frame-system-rpc-runtime-api", - "futures 0.3.15", - "hex-literal", - "kusama-runtime", - "kvdb", - "kvdb-rocksdb", - "log", - "pallet-babe", - "pallet-im-online", - "pallet-mmr-primitives", - "pallet-staking", - "pallet-transaction-payment-rpc-runtime-api", - "polkadot-approval-distribution", - "polkadot-availability-bitfield-distribution", - "polkadot-availability-distribution", - "polkadot-availability-recovery", - "polkadot-client", - "polkadot-collator-protocol", - "polkadot-dispute-distribution", - "polkadot-gossip-support", - "polkadot-network-bridge", - "polkadot-node-collation-generation", - "polkadot-node-core-approval-voting", - "polkadot-node-core-av-store", - "polkadot-node-core-backing", - "polkadot-node-core-bitfield-signing", - "polkadot-node-core-candidate-validation", - "polkadot-node-core-chain-api", - "polkadot-node-core-chain-selection", - "polkadot-node-core-dispute-coordinator", - "polkadot-node-core-dispute-participation", - "polkadot-node-core-parachains-inherent", - "polkadot-node-core-provisioner", - "polkadot-node-core-runtime-api", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-rpc", - "polkadot-runtime", - "polkadot-runtime-parachains", - "polkadot-statement-distribution", - "polkadot-test-client", - "rococo-runtime", - "sc-authority-discovery", - "sc-basic-authorship", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-consensus-babe", - "sc-consensus-slots", - "sc-consensus-uncles", - "sc-executor", - "sc-finality-grandpa", - "sc-finality-grandpa-warp-sync", - "sc-keystore", - "sc-network", - "sc-service", - "sc-telemetry", - "sc-transaction-pool", - "serde", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", - "sp-trie", - "substrate-prometheus-endpoint", - "thiserror", - "tracing", - "westend-runtime", -] - -[[package]] -name = "polkadot-simnet" -version = "0.9.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-collective", - "pallet-democracy", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-cli", - "polkadot-primitives", - "polkadot-runtime", - "polkadot-runtime-common", - "polkadot-service", - "sc-cli", - "sc-consensus", - "sc-consensus-babe", - "sc-consensus-manual-seal", - "sc-executor", - "sc-finality-grandpa", - "sc-service", - "sc-tracing", - "sc-transaction-pool", - "sp-api", - "sp-consensus", - "sp-consensus-babe", - "sp-inherents", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "structopt", - "test-runner", -] - -[[package]] -name = "polkadot-simnet-node" -version = "0.1.0" -dependencies = [ - "polkadot-simnet", -] - -[[package]] -name = "polkadot-simnet-test" -version = "0.1.0" -dependencies = [ - "frame-system", - "pallet-balances", - "polkadot-runtime", - "polkadot-simnet", - "sc-client-api", - "sp-blockchain", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "polkadot-statement-distribution" -version = "0.1.0" -dependencies = [ - "arrayvec 0.5.2", - "assert_matches", - "futures 0.3.15", - "futures-timer 3.0.2", - "indexmap", - "parity-scale-codec", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-keystore", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-staking", - "sp-tracing", - "thiserror", - "tracing", -] - -[[package]] -name = "polkadot-statement-table" -version = "0.9.8" -dependencies = [ - "parity-scale-codec", - "polkadot-primitives", - "sp-core", -] - -[[package]] -name = "polkadot-test-client" -version = "0.9.8" -dependencies = [ - "futures 0.3.15", - "parity-scale-codec", - "polkadot-node-subsystem", - "polkadot-primitives", - "polkadot-test-runtime", - "polkadot-test-service", - "sc-block-builder", - "sc-consensus", - "sc-service", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-keyring", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "substrate-test-client", -] - -[[package]] -name = "polkadot-test-malus" -version = "0.9.8" -dependencies = [ - "assert_matches", - "async-trait", - "color-eyre", - "parity-util-mem", - "polkadot-cli", - "polkadot-node-core-candidate-validation", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "structopt", -] - -[[package]] -name = "polkadot-test-runtime" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-grandpa", - "pallet-indices", - "pallet-mmr-primitives", - "pallet-nicks", - "pallet-offences", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-vesting", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "rustc-hex", - "serde", - "serde_derive", - "serde_json", - "smallvec 1.6.1", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "substrate-wasm-builder", - "tiny-keccak", -] - -[[package]] -name = "polkadot-test-service" -version = "0.9.8" -dependencies = [ - "frame-benchmarking", - "frame-system", - "futures 0.1.29", - "futures 0.3.15", - "hex", - "pallet-balances", - "pallet-staking", - "pallet-transaction-payment", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-overseer", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-rpc", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "polkadot-service", - "polkadot-test-runtime", - "rand 0.8.4", - "sc-authority-discovery", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-babe", - "sc-executor", - "sc-finality-grandpa", - "sc-network", - "sc-service", - "sc-tracing", - "sc-transaction-pool", - "serde_json", - "sp-arithmetic", - "sp-authority-discovery", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keyring", - "sp-runtime", - "sp-state-machine", - "substrate-test-client", - "substrate-test-utils", - "tempfile", - "tokio 0.2.21", - "tracing", -] - -[[package]] -name = "polling" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "log", - "wepoll-sys", - "winapi 0.3.9", -] - -[[package]] -name = "poly1305" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b42192ab143ed7619bf888a7f9c6733a9a2153b218e2cd557cfdb52fbf9bb1" -dependencies = [ - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" -dependencies = [ - "cfg-if 0.1.10", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" - -[[package]] -name = "predicates" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030" -dependencies = [ - "difference", - "predicates-core", -] - -[[package]] -name = "predicates-core" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" - -[[package]] -name = "predicates-tree" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" -dependencies = [ - "predicates-core", - "treeline", -] - -[[package]] -name = "pretty_assertions" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" -dependencies = [ - "ansi_term 0.11.0", - "ctor", - "difference", - "output_vt100", -] - -[[package]] -name = "pretty_assertions" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b" -dependencies = [ - "ansi_term 0.12.1", - "ctor", - "diff", - "output_vt100", -] - -[[package]] -name = "primitive-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-crate" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" -dependencies = [ - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-error" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" -dependencies = [ - "proc-macro-error-attr 0.4.12", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr 1.0.4", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "syn-mid", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" - -[[package]] -name = "proc-macro2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "prometheus" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" -dependencies = [ - "cfg-if 1.0.0", - "fnv", - "lazy_static", - "parking_lot 0.11.1", - "regex", - "thiserror", -] - -[[package]] -name = "prost" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" -dependencies = [ - "bytes 1.0.1", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" -dependencies = [ - "bytes 1.0.1", - "heck", - "itertools 0.9.0", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" -dependencies = [ - "anyhow", - "itertools 0.9.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" -dependencies = [ - "bytes 1.0.1", - "prost", -] - -[[package]] -name = "psm" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" -dependencies = [ - "cc", -] - -[[package]] -name = "pwasm-utils" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e517f47d9964362883182404b68d0b6949382c0baa40aa5ffca94f5f1e3481" -dependencies = [ - "byteorder", - "log", - "parity-wasm 0.42.2", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-error" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" - -[[package]] -name = "quicksink" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" -dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.7", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -dependencies = [ - "libc", - "rand 0.4.6", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi 0.3.9", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.14", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", - "rand_pcg", -] - -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.1", - "rand_hc 0.3.0", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.14", -] - -[[package]] -name = "rand_core" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" -dependencies = [ - "getrandom 0.2.1", -] - -[[package]] -name = "rand_distr" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051b398806e42b9cd04ad9ec8f81e355d0a382c543ac6672c62f5a5b452ef142" -dependencies = [ - "num-traits", - "rand 0.8.4", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core 0.6.1", -] - -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redox_syscall" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" - -[[package]] -name = "redox_syscall" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" -dependencies = [ - "getrandom 0.1.14", - "redox_syscall 0.1.56", - "rust-argon2", -] - -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom 0.2.1", - "redox_syscall 0.2.4", -] - -[[package]] -name = "reed-solomon-novelpoly" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" -dependencies = [ - "derive_more", - "fs-err", - "itertools 0.10.0", - "static_init", - "thiserror", -] - -[[package]] -name = "ref-cast" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745c1787167ddae5569661d5ffb8b25ae5fedbf46717eaa92d652221cec72623" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "regalloc" -version = "0.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" -dependencies = [ - "log", - "rustc-hash", - "serde", - "smallvec 1.6.1", -] - -[[package]] -name = "regex" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-automata" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" - -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi 0.3.9", -] - -[[package]] -name = "remote-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "env_logger 0.8.4", - "hex", - "jsonrpsee-proc-macros", - "jsonrpsee-ws-client", - "log", - "parity-scale-codec", - "serde", - "serde_json", - "sp-core", - "sp-io", - "sp-runtime", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error 1.2.3", -] - -[[package]] -name = "retain_mut" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c17925a9027d298a4603d286befe3f9dc0e8ed02523141914eb628798d6e5b" - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi 0.3.9", -] - -[[package]] -name = "rlp" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" -dependencies = [ - "bytes 1.0.1", - "rustc-hex", -] - -[[package]] -name = "rocksdb" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3" -dependencies = [ - "libc", - "librocksdb-sys", -] - -[[package]] -name = "rococo-runtime" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "bp-messages", - "bp-rococo", - "bp-runtime", - "bp-wococo", - "bridge-runtime-common", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-beefy", - "pallet-beefy-mmr", - "pallet-bridge-dispatch", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-collective", - "pallet-grandpa", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-mmr", - "pallet-mmr-primitives", - "pallet-offences", - "pallet-proxy", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-utility", - "pallet-xcm", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "serde", - "serde_derive", - "smallvec 1.6.1", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-version", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "rpassword" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "rust-argon2" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" -dependencies = [ - "base64 0.11.0", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils 0.7.2", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustls" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac94b333ee2aac3284c5b8a1b7fb4dd11cba88c244e3fe33cdbd047af0eb693" -dependencies = [ - "base64 0.12.3", - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.0", - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls-native-certs" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629d439a7672da82dd955498445e496ee2096fe2117b9f796558a43fdb9e59b8" -dependencies = [ - "openssl-probe", - "rustls 0.18.0", - "schannel", - "security-framework 1.0.0", -] - -[[package]] -name = "rustls-native-certs" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" -dependencies = [ - "openssl-probe", - "rustls 0.19.1", - "schannel", - "security-framework 2.2.0", -] - -[[package]] -name = "rustversion" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" - -[[package]] -name = "ruzstd" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" -dependencies = [ - "byteorder", - "twox-hash", -] - -[[package]] -name = "rw-stream-sink" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" -dependencies = [ - "futures 0.3.15", - "pin-project 0.4.23", - "static_assertions", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "salsa20" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15" -dependencies = [ - "cipher", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "sc-allocator" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "sp-core", - "sp-wasm-interface", - "thiserror", -] - -[[package]] -name = "sc-authority-discovery" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "derive_more", - "either", - "futures 0.3.15", - "futures-timer 3.0.2", - "ip_network", - "libp2p", - "log", - "parity-scale-codec", - "prost", - "prost-build", - "rand 0.7.3", - "sc-client-api", - "sc-network", - "serde_json", - "sp-api", - "sp-authority-discovery", - "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "parity-scale-codec", - "sc-block-builder", - "sc-client-api", - "sc-proposer-metrics", - "sc-telemetry", - "sc-transaction-pool-api", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sc-client-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "sc-chain-spec-derive", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-network", - "sc-telemetry", - "serde", - "serde_json", - "sp-consensus-babe", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "chrono", - "fdlimit", - "futures 0.3.15", - "hex", - "libp2p", - "log", - "names", - "parity-scale-codec", - "rand 0.7.3", - "regex", - "rpassword", - "sc-client-api", - "sc-keystore", - "sc-network", - "sc-service", - "sc-telemetry", - "sc-tracing", - "serde", - "serde_json", - "sp-blockchain", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", - "sp-utils", - "sp-version", - "structopt", - "thiserror", - "tiny-bip39", - "tokio 0.2.21", -] - -[[package]] -name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "fnv", - "futures 0.3.15", - "hash-db", - "kvdb", - "lazy_static", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-executor", - "sc-transaction-pool-api", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-database", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-storage", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "blake2-rfc", - "hash-db", - "kvdb", - "kvdb-memorydb", - "kvdb-rocksdb", - "linked-hash-map", - "log", - "parity-db", - "parity-scale-codec", - "parity-util-mem", - "parking_lot 0.11.1", - "sc-client-api", - "sc-executor", - "sc-state-db", - "sp-arithmetic", - "sp-blockchain", - "sp-core", - "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "libp2p", - "log", - "parking_lot 0.11.1", - "sc-client-api", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-utils", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sc-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "derive_more", - "fork-tree", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "merlin", - "num-bigint", - "num-rational 0.2.4", - "num-traits", - "parity-scale-codec", - "parking_lot 0.11.1", - "pdqselect", - "rand 0.7.3", - "retain_mut", - "sc-client-api", - "sc-consensus", - "sc-consensus-epochs", - "sc-consensus-slots", - "sc-consensus-uncles", - "sc-keystore", - "sc-telemetry", - "schnorrkel", - "serde", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-consensus-babe-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-rpc-api", - "serde", - "sp-api", - "sp-application-crypto", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-keystore", - "sp-runtime", -] - -[[package]] -name = "sc-consensus-epochs" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "fork-tree", - "parity-scale-codec", - "sc-client-api", - "sc-consensus", - "sp-blockchain", - "sp-runtime", -] - -[[package]] -name = "sc-consensus-manual-seal" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "assert_matches", - "async-trait", - "derive_more", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-client-api", - "sc-consensus", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-timestamp", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-consensus", - "sc-telemetry", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-trie", - "thiserror", -] - -[[package]] -name = "sc-consensus-uncles" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "sc-client-api", - "sp-authorship", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "lazy_static", - "libsecp256k1 0.3.5", - "log", - "parity-scale-codec", - "parity-wasm 0.42.2", - "parking_lot 0.11.1", - "sc-executor-common", - "sc-executor-wasmi", - "sc-executor-wasmtime", - "sp-api", - "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-serializer", - "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", - "wasmi", -] - -[[package]] -name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "parity-scale-codec", - "pwasm-utils", - "sc-allocator", - "sp-core", - "sp-maybe-compressed-blob", - "sp-serializer", - "sp-wasm-interface", - "thiserror", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "parity-scale-codec", - "sc-allocator", - "sc-executor-common", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "log", - "parity-scale-codec", - "parity-wasm 0.42.2", - "pwasm-utils", - "sc-allocator", - "sc-executor-common", - "scoped-tls", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmtime", -] - -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "derive_more", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures 0.3.15", - "futures-timer 3.0.2", - "linked-hash-map", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "rand 0.7.3", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-keystore", - "sc-network", - "sc-network-gossip", - "sc-telemetry", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-utils", - "substrate-prometheus-endpoint", - "wasm-timer", -] - -[[package]] -name = "sc-finality-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "finality-grandpa", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", - "serde", - "serde_json", - "sp-blockchain", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "sc-finality-grandpa-warp-sync" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "futures 0.3.15", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot 0.11.1", - "prost", - "sc-client-api", - "sc-finality-grandpa", - "sc-network", - "sc-service", - "sp-blockchain", - "sp-finality-grandpa", - "sp-runtime", -] - -[[package]] -name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "ansi_term 0.12.1", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "parity-util-mem", - "sc-client-api", - "sc-network", - "sc-transaction-pool-api", - "sp-blockchain", - "sp-runtime", - "wasm-timer", -] - -[[package]] -name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "derive_more", - "futures 0.3.15", - "futures-util", - "hex", - "merlin", - "parking_lot 0.11.1", - "rand 0.7.3", - "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "subtle 2.2.3", -] - -[[package]] -name = "sc-light" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "hash-db", - "lazy_static", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-client-api", - "sc-executor", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-externalities", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-std", - "async-trait", - "asynchronous-codec 0.5.0", - "bitflags", - "bs58", - "bytes 1.0.1", - "cid", - "derive_more", - "either", - "erased-serde", - "fnv", - "fork-tree", - "futures 0.3.15", - "futures-timer 3.0.2", - "hex", - "ip_network", - "libp2p", - "linked-hash-map", - "linked_hash_set", - "log", - "lru", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "prost", - "prost-build", - "rand 0.7.3", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-peerset", - "serde", - "serde_json", - "smallvec 1.6.1", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "sp-utils", - "substrate-prometheus-endpoint", - "thiserror", - "unsigned-varint 0.6.0", - "void", - "wasm-timer", - "zeroize", -] - -[[package]] -name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "futures-timer 3.0.2", - "libp2p", - "log", - "lru", - "sc-network", - "sp-runtime", - "substrate-prometheus-endpoint", - "tracing", - "wasm-timer", -] - -[[package]] -name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures 0.3.15", - "futures-timer 3.0.2", - "hex", - "hyper 0.13.9", - "hyper-rustls", - "log", - "num_cpus", - "parity-scale-codec", - "parking_lot 0.11.1", - "rand 0.7.3", - "sc-client-api", - "sc-keystore", - "sc-network", - "sp-api", - "sp-core", - "sp-offchain", - "sp-runtime", - "sp-utils", - "threadpool", -] - -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "libp2p", - "log", - "serde_json", - "sp-utils", - "wasm-timer", -] - -[[package]] -name = "sc-proposer-metrics" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-executor", - "sc-keystore", - "sc-rpc-api", - "sc-tracing", - "sc-transaction-pool-api", - "serde_json", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-offchain", - "sp-rpc", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-tracing", - "sp-utils", - "sp-version", -] - -[[package]] -name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sc-chain-spec", - "sc-transaction-pool-api", - "serde", - "serde_json", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-tracing", - "sp-version", -] - -[[package]] -name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.1.29", - "jsonrpc-core", - "jsonrpc-http-server", - "jsonrpc-ipc-server", - "jsonrpc-pubsub", - "jsonrpc-ws-server", - "log", - "serde", - "serde_json", - "sp-runtime", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "directories", - "exit-future", - "futures 0.1.29", - "futures 0.3.15", - "futures-timer 3.0.2", - "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", - "lazy_static", - "log", - "parity-scale-codec", - "parity-util-mem", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "rand 0.7.3", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-informant", - "sc-keystore", - "sc-light", - "sc-network", - "sc-offchain", - "sc-rpc", - "sc-rpc-server", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-storage", - "sp-tracing", - "sp-transaction-pool", - "sp-transaction-storage-proof", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", - "tempfile", - "thiserror", - "tracing", - "tracing-futures", - "wasm-timer", -] - -[[package]] -name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "parity-scale-codec", - "parity-util-mem", - "parity-util-mem-derive", - "parking_lot 0.11.1", - "sc-client-api", - "sp-core", - "thiserror", -] - -[[package]] -name = "sc-sync-state-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "sc-chain-spec", - "sc-client-api", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-rpc-api", - "serde_json", - "sp-blockchain", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "chrono", - "futures 0.3.15", - "libp2p", - "log", - "parking_lot 0.11.1", - "pin-project 1.0.7", - "rand 0.7.3", - "serde", - "serde_json", - "take_mut", - "thiserror", - "void", - "wasm-timer", -] - -[[package]] -name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "ansi_term 0.12.1", - "atty", - "erased-serde", - "lazy_static", - "log", - "once_cell", - "parking_lot 0.11.1", - "regex", - "rustc-hash", - "sc-client-api", - "sc-rpc-server", - "sc-telemetry", - "sc-tracing-proc-macro", - "serde", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-storage", - "sp-tracing", - "thiserror", - "tracing", - "tracing-log", - "tracing-subscriber", - "wasm-bindgen", - "wasm-timer", - "web-sys", -] - -[[package]] -name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "futures 0.3.15", - "intervalier", - "linked-hash-map", - "log", - "parity-scale-codec", - "parity-util-mem", - "parking_lot 0.11.1", - "retain_mut", - "sc-client-api", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", - "sp-transaction-pool", - "sp-utils", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "derive_more", - "futures 0.3.15", - "log", - "parity-scale-codec", - "serde", - "sp-blockchain", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "schannel" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" -dependencies = [ - "lazy_static", - "winapi 0.3.9", -] - -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.0", - "getrandom 0.1.14", - "merlin", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle 2.2.3", - "zeroize", -] - -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sct" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "secrecy" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" -dependencies = [ - "zeroize", -] - -[[package]] -name = "security-framework" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad502866817f0575705bd7be36e2b2535cc33262d493aa733a2ec862baa2bc2b" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "core-foundation-sys 0.7.0", - "libc", - "security-framework-sys 1.0.0", -] - -[[package]] -name = "security-framework" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" -dependencies = [ - "bitflags", - "core-foundation 0.9.1", - "core-foundation-sys 0.8.2", - "libc", - "security-framework-sys 2.2.0", -] - -[[package]] -name = "security-framework-sys" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ceb04988b17b6d1dcd555390fa822ca5637b4a14e1f5099f13d351bed4d6c7" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "security-framework-sys" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" -dependencies = [ - "core-foundation-sys 0.8.2", - "libc", -] - -[[package]] -name = "semver" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "separator" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" - -[[package]] -name = "serde" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha-1" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha2" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpuid-bool", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sharded-slab" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4921be914e16899a80adefb821f8ddb7974e3f1250223575a44ed994882127" -dependencies = [ - "lazy_static", - "loom", -] - -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - -[[package]] -name = "signal-hook" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65211b7b6fc3f14ff9fc7a2011a434e3e6880585bd2e9e9396315ae24cbf7852" - -[[package]] -name = "simba" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", -] - -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - -[[package]] -name = "slog" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" -dependencies = [ - "erased-serde", -] - -[[package]] -name = "slot-range-helper" -version = "0.9.8" -dependencies = [ - "enumn", - "parity-scale-codec", - "paste", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "slotmap" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a952280edbecfb1d4bd3cf2dbc309dc6ab523e53487c438ae21a6df09fe84bc4" -dependencies = [ - "version_check", -] - -[[package]] -name = "smallvec" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "snow" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "rand 0.7.3", - "rand_core 0.5.1", - "ring", - "rustc_version", - "sha2 0.9.2", - "subtle 2.2.3", - "x25519-dalek 0.6.0", -] - -[[package]] -name = "socket2" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.1.56", - "winapi 0.3.9", -] - -[[package]] -name = "socket2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "soketto" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0" -dependencies = [ - "base64 0.12.3", - "bytes 0.5.6", - "flate2", - "futures 0.3.15", - "httparse", - "log", - "rand 0.7.3", - "sha-1 0.8.2", -] - -[[package]] -name = "soketto" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74e48087dbeed4833785c2f3352b59140095dc192dce966a3bfc155020a439f" -dependencies = [ - "base64 0.13.0", - "bytes 1.0.1", - "futures 0.3.15", - "httparse", - "log", - "rand 0.8.4", - "sha-1 0.9.6", -] - -[[package]] -name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", - "thiserror", -] - -[[package]] -name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "blake2-rfc", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-application-crypto" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-arithmetic" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "serde", - "sp-debug-derive", - "sp-std", - "static_assertions", -] - -[[package]] -name = "sp-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "log", - "lru", - "parity-scale-codec", - "parking_lot 0.11.1", - "sp-api", - "sp-consensus", - "sp-database", - "sp-runtime", - "sp-state-machine", - "thiserror", -] - -[[package]] -name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "serde", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-utils", - "sp-version", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "merlin", - "parity-scale-codec", - "serde", - "sp-api", - "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-arithmetic", - "sp-runtime", -] - -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-core" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "base58", - "blake2-rfc", - "byteorder", - "dyn-clonable", - "ed25519-dalek", - "futures 0.3.15", - "hash-db", - "hash256-std-hasher", - "hex", - "impl-serde", - "lazy_static", - "libsecp256k1 0.3.5", - "log", - "merlin", - "num-traits", - "parity-scale-codec", - "parity-util-mem", - "parking_lot 0.11.1", - "primitive-types", - "rand 0.7.3", - "regex", - "schnorrkel", - "secrecy", - "serde", - "sha2 0.9.2", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "tiny-keccak", - "twox-hash", - "wasmi", - "zeroize", -] - -[[package]] -name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "kvdb", - "parking_lot 0.11.1", -] - -[[package]] -name = "sp-debug-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std", - "sp-storage", -] - -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "sp-core", - "sp-runtime", - "sp-std", - "thiserror", -] - -[[package]] -name = "sp-io" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "hash-db", - "libsecp256k1 0.3.5", - "log", - "parity-scale-codec", - "parking_lot 0.11.1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-maybe-compressed-blob", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-keyring" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "lazy_static", - "sp-core", - "sp-runtime", - "strum", -] - -[[package]] -name = "sp-keystore" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "derive_more", - "futures 0.3.15", - "merlin", - "parity-scale-codec", - "parking_lot 0.11.1", - "schnorrkel", - "serde", - "sp-core", - "sp-externalities", -] - -[[package]] -name = "sp-maybe-compressed-blob" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "ruzstd", - "zstd", -] - -[[package]] -name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "serde", - "sp-arithmetic", - "sp-core", - "sp-npos-elections-compact", - "sp-std", -] - -[[package]] -name = "sp-npos-elections-compact" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "sp-panic-handler" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "backtrace", -] - -[[package]] -name = "sp-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "rustc-hash", - "serde", - "sp-core", - "tracing-core", -] - -[[package]] -name = "sp-runtime" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "parity-util-mem", - "paste", - "rand 0.7.3", - "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-runtime-interface" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "Inflector", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-serializer" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-state-machine" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "hash-db", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot 0.11.1", - "rand 0.7.3", - "smallvec 1.6.1", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", - "thiserror", - "tracing", - "trie-db", - "trie-root", -] - -[[package]] -name = "sp-std" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" - -[[package]] -name = "sp-storage" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "sp-tasks" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std", -] - -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "futures-timer 3.0.2", - "log", - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sp-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "erased-serde", - "log", - "parity-scale-codec", - "parking_lot 0.10.2", - "serde", - "serde_json", - "slog", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "sp-api", - "sp-runtime", -] - -[[package]] -name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "log", - "parity-scale-codec", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-trie", -] - -[[package]] -name = "sp-trie" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "hash-db", - "memory-db", - "parity-scale-codec", - "sp-core", - "sp-std", - "trie-db", - "trie-root", -] - -[[package]] -name = "sp-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "futures-core", - "futures-timer 3.0.2", - "lazy_static", - "prometheus", -] - -[[package]] -name = "sp-version" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "parity-wasm 0.42.2", - "serde", - "sp-runtime", - "sp-std", - "sp-version-proc-macro", - "thiserror", -] - -[[package]] -name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "parity-scale-codec", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-wasm-interface" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "sp-std", - "wasmi", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "stable_deref_trait" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" - -[[package]] -name = "staking-miner" -version = "0.9.0" -dependencies = [ - "env_logger 0.8.4", - "frame-election-provider-support", - "frame-support", - "frame-system", - "hex", - "jsonrpsee-ws-client", - "kusama-runtime", - "lazy_static", - "log", - "pallet-election-provider-multi-phase", - "pallet-staking", - "pallet-transaction-payment", - "parity-scale-codec", - "paste", - "polkadot-core-primitives", - "polkadot-runtime", - "polkadot-runtime-common", - "remote-externalities", - "sc-transaction-pool-api", - "serde", - "serde_json", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-version", - "structopt", - "thiserror", - "tokio 0.2.21", - "westend-runtime", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "static_init" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" -dependencies = [ - "cfg_aliases", - "libc", - "parking_lot 0.11.1", - "static_init_macro", -] - -[[package]] -name = "static_init_macro" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" -dependencies = [ - "cfg_aliases", - "memchr", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "statrs" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.4", -] - -[[package]] -name = "stream-cipher" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes 0.4.12", -] - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "structopt" -version = "0.3.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b041cdcb67226aca307e6e7be44c8806423d83e018bd662360a93dabce4d71" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7813934aecf5f51a54775e00068c237de98489463968231a51746bbbc03f9c10" -dependencies = [ - "heck", - "proc-macro-error 1.0.4", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "strum" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "substrate-bip39" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236" -dependencies = [ - "hmac 0.7.1", - "pbkdf2 0.3.0", - "schnorrkel", - "sha2 0.8.2", - "zeroize", -] - -[[package]] -name = "substrate-browser-utils" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "chrono", - "console_error_panic_hook", - "futures 0.1.29", - "futures 0.3.15", - "futures-timer 3.0.2", - "getrandom 0.2.1", - "js-sys", - "kvdb-memorydb", - "libp2p-wasm-ext", - "log", - "rand 0.7.3", - "sc-chain-spec", - "sc-informant", - "sc-network", - "sc-service", - "sc-tracing", - "sp-database", - "wasm-bindgen", - "wasm-bindgen-futures", -] - -[[package]] -name = "substrate-build-script-utils" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "platforms", -] - -[[package]] -name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-system-rpc-runtime-api", - "futures 0.3.15", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-rpc-api", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "substrate-prometheus-endpoint" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-std", - "derive_more", - "futures-util", - "hyper 0.13.9", - "log", - "prometheus", - "tokio 0.2.21", -] - -[[package]] -name = "substrate-test-client" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "async-trait", - "futures 0.1.29", - "futures 0.3.15", - "hash-db", - "hex", - "parity-scale-codec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-light", - "sc-offchain", - "sc-service", - "serde", - "serde_json", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "substrate-test-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "futures 0.3.15", - "substrate-test-utils-derive", - "tokio 0.2.21", -] - -[[package]] -name = "substrate-test-utils-derive" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "proc-macro-crate 1.0.0", - "quote", - "syn", -] - -[[package]] -name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "ansi_term 0.12.1", - "atty", - "build-helper", - "cargo_metadata", - "sp-maybe-compressed-blob", - "tempfile", - "toml", - "walkdir", - "wasm-gc-api", -] - -[[package]] -name = "subtle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - -[[package]] -name = "subtle" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" - -[[package]] -name = "syn" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "syn-mid" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa8e7560a164edb1621a55d18a0c59abf49d360f47aa7b821061dd7eea7fac9" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "synstructure" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - -[[package]] -name = "tap" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" - -[[package]] -name = "target-lexicon" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" - -[[package]] -name = "tempfile" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "rand 0.8.4", - "redox_syscall 0.2.4", - "remove_dir_all", - "winapi 0.3.9", -] - -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "test-parachain-adder" -version = "0.9.8" -dependencies = [ - "dlmalloc", - "parity-scale-codec", - "polkadot-parachain", - "sp-io", - "sp-std", - "substrate-wasm-builder", - "tiny-keccak", -] - -[[package]] -name = "test-parachain-adder-collator" -version = "0.9.8" -dependencies = [ - "futures 0.3.15", - "futures-timer 3.0.2", - "log", - "parity-scale-codec", - "polkadot-cli", - "polkadot-node-core-pvf", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-service", - "polkadot-test-service", - "sc-authority-discovery", - "sc-cli", - "sc-service", - "sp-core", - "sp-keyring", - "structopt", - "substrate-test-utils", - "test-parachain-adder", - "tokio 0.2.21", -] - -[[package]] -name = "test-parachain-halt" -version = "0.9.8" -dependencies = [ - "substrate-wasm-builder", -] - -[[package]] -name = "test-parachains" -version = "0.9.8" -dependencies = [ - "parity-scale-codec", - "polkadot-parachain", - "sp-core", - "test-parachain-adder", - "test-parachain-halt", - "tiny-keccak", -] - -[[package]] -name = "test-runner" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-system", - "futures 0.3.15", - "jsonrpc-core", - "log", - "num-traits", - "sc-basic-authorship", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-babe", - "sc-consensus-manual-seal", - "sc-executor", - "sc-finality-grandpa", - "sc-informant", - "sc-network", - "sc-rpc", - "sc-rpc-server", - "sc-service", - "sc-transaction-pool", - "sc-transaction-pool-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-keyring", - "sp-keystore", - "sp-offchain", - "sp-runtime", - "sp-runtime-interface", - "sp-session", - "sp-state-machine", - "sp-transaction-pool", - "sp-wasm-interface", - "tokio 0.2.21", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" -dependencies = [ - "once_cell", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - -[[package]] -name = "thrift" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6d965454947cc7266d22716ebfd07b18d84ebaf35eec558586bbb2a8cb6b5b" -dependencies = [ - "byteorder", - "integer-encoding", - "log", - "ordered-float", - "threadpool", -] - -[[package]] -name = "time" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "tiny-bip39" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" -dependencies = [ - "anyhow", - "hmac 0.8.1", - "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.2", - "thiserror", - "unicode-normalization", - "zeroize", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" - -[[package]] -name = "tinyvec" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio", - "num_cpus", - "tokio-codec", - "tokio-current-thread", - "tokio-executor", - "tokio-fs", - "tokio-io", - "tokio-reactor", - "tokio-sync", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "tokio-udp", - "tokio-uds", -] - -[[package]] -name = "tokio" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio", - "mio-uds", - "num_cpus", - "pin-project-lite 0.1.7", - "signal-hook-registry", - "slab", - "tokio-macros", - "winapi 0.3.9", -] - -[[package]] -name = "tokio" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" -dependencies = [ - "autocfg", - "pin-project-lite 0.2.4", -] - -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes 0.4.12", - "either", - "futures 0.1.29", -] - -[[package]] -name = "tokio-codec" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "tokio-io", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures 0.1.29", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", -] - -[[package]] -name = "tokio-fs" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" -dependencies = [ - "futures 0.1.29", - "tokio-io", - "tokio-threadpool", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", -] - -[[package]] -name = "tokio-macros" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-named-pipes" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio", - "mio-named-pipes", - "tokio 0.1.22", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "mio", - "num_cpus", - "parking_lot 0.9.0", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", -] - -[[package]] -name = "tokio-rustls" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228139ddd4fea3fa345a29233009635235833e52807af7ea6448ead03890d6a9" -dependencies = [ - "futures-core", - "rustls 0.18.0", - "tokio 0.2.21", - "webpki", -] - -[[package]] -name = "tokio-rustls" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d15e5669243a45f630a5167d101b942174ca94b615445b2057eace1c818736" -dependencies = [ - "futures-core", - "rustls 0.19.1", - "tokio 0.2.21", - "webpki", -] - -[[package]] -name = "tokio-service" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" -dependencies = [ - "futures 0.1.29", -] - -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -dependencies = [ - "fnv", - "futures 0.1.29", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "mio", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-udp" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", - "mio", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-uds" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "libc", - "log", - "mio", - "mio-uds", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.6", - "futures-core", - "futures-io", - "futures-sink", - "log", - "pin-project-lite 0.1.7", - "tokio 0.2.21", -] - -[[package]] -name = "toml" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" -dependencies = [ - "serde", -] - -[[package]] -name = "tower-service" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" - -[[package]] -name = "tracing" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if 1.0.0", - "log", - "pin-project-lite 0.2.4", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "tracing-futures" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" -dependencies = [ - "pin-project 0.4.23", - "tracing", -] - -[[package]] -name = "tracing-log" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" -dependencies = [ - "ansi_term 0.12.1", - "chrono", - "lazy_static", - "matchers", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec 1.6.1", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - -[[package]] -name = "treeline" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" - -[[package]] -name = "trie-db" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac131e334e81b6b3be07399482042838adcd7957aa0010231d0813e39e02fa" -dependencies = [ - "hash-db", - "hashbrown 0.11.2", - "log", - "rustc-hex", - "smallvec 1.6.1", -] - -[[package]] -name = "trie-root" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" -dependencies = [ - "hash-db", -] - -[[package]] -name = "trust-dns-proto" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d57e219ba600dd96c2f6d82eb79645068e14edbc5c7e27514af40436b88150c" -dependencies = [ - "async-trait", - "cfg-if 1.0.0", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.0", - "ipnet", - "lazy_static", - "log", - "rand 0.8.4", - "smallvec 1.6.1", - "thiserror", - "tinyvec 1.1.1", - "url 2.2.0", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0437eea3a6da51acc1e946545ff53d5b8fb2611ff1c3bed58522dde100536ae" -dependencies = [ - "cfg-if 1.0.0", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot 0.11.1", - "resolv-conf", - "smallvec 1.6.1", - "thiserror", - "trust-dns-proto", -] - -[[package]] -name = "try-lock" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" - -[[package]] -name = "try-runtime-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" -dependencies = [ - "frame-try-runtime", - "log", - "parity-scale-codec", - "remote-externalities", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-executor", - "sc-service", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "structopt", -] - -[[package]] -name = "trybuild" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02c413315329fc96167f922b46fd0caa3a43f4697b7a7896b183c7142635832" -dependencies = [ - "glob", - "lazy_static", - "serde", - "serde_json", - "termcolor", - "toml", -] - -[[package]] -name = "twox-hash" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" -dependencies = [ - "cfg-if 0.1.10", - "rand 0.7.3", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - -[[package]] -name = "uint" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" -dependencies = [ - "tinyvec 0.3.3", -] - -[[package]] -name = "unicode-segmentation" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "universal-hash" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" -dependencies = [ - "generic-array 0.14.4", - "subtle 2.2.3", -] - -[[package]] -name = "unsigned-varint" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" - -[[package]] -name = "unsigned-varint" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" -dependencies = [ - "asynchronous-codec 0.5.0", - "bytes 1.0.1", - "futures-io", - "futures-util", -] - -[[package]] -name = "unsigned-varint" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7f" -dependencies = [ - "asynchronous-codec 0.6.0", - "bytes 1.0.1", - "futures-io", - "futures-util", -] - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" -dependencies = [ - "form_urlencoded", - "idna 0.2.0", - "matches", - "percent-encoding 2.1.0", -] - -[[package]] -name = "value-bag" -version = "1.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" -dependencies = [ - "ctor", -] - -[[package]] -name = "vcpkg" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" - -[[package]] -name = "vec-arena" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures 0.1.29", - "log", - "try-lock", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasm-bindgen" -version = "0.2.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" -dependencies = [ - "cfg-if 1.0.0", - "serde", - "serde_json", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" - -[[package]] -name = "wasm-gc-api" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" -dependencies = [ - "log", - "parity-wasm 0.32.0", - "rustc-demangle", -] - -[[package]] -name = "wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" -dependencies = [ - "futures 0.3.15", - "js-sys", - "parking_lot 0.11.1", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmi" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ee05bba3d1d994652079893941a2ef9324d2b58a63c31b40678fb7eddd7a5a" -dependencies = [ - "downcast-rs", - "libc", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", - "wasmi-validation", -] - -[[package]] -name = "wasmi-validation" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb8e860796d8be48efef530b60eebf84e74a88bce107374fffb0da97d504b8" -dependencies = [ - "parity-wasm 0.42.2", -] - -[[package]] -name = "wasmparser" -version = "0.78.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" - -[[package]] -name = "wasmtime" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b310b9d20fcf59385761d1ade7a3ef06aecc380e3d3172035b919eaf7465d9f7" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "cfg-if 1.0.0", - "cpp_demangle", - "indexmap", - "lazy_static", - "libc", - "log", - "paste", - "psm", - "region", - "rustc-demangle", - "serde", - "smallvec 1.6.1", - "target-lexicon", - "wasmparser", - "wasmtime-cache", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-profiling", - "wasmtime-runtime", - "winapi 0.3.9", -] - -[[package]] -name = "wasmtime-cache" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14d500d5c3dc5f5c097158feee123d64b3097f0d836a2a27dff9c761c73c843" -dependencies = [ - "anyhow", - "base64 0.13.0", - "bincode", - "directories-next", - "errno", - "file-per-thread-logger", - "libc", - "log", - "serde", - "sha2 0.9.2", - "toml", - "winapi 0.3.9", - "zstd", -] - -[[package]] -name = "wasmtime-cranelift" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c525b39f062eada7db3c1298287b96dcb6e472b9f6b22501300b28d9fa7582f6" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-wasm", - "target-lexicon", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-debug" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d2a763e7a6fc734218e0e463196762a4f409c483063d81e0e85f96343b2e0a" -dependencies = [ - "anyhow", - "gimli 0.24.0", - "more-asserts", - "object 0.24.0", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64d0c2d881c31b0d65c1f2695e022d71eb60b9fbdd336aacca28208b58eac90" -dependencies = [ - "cfg-if 1.0.0", - "cranelift-codegen", - "cranelift-entity", - "cranelift-wasm", - "gimli 0.24.0", - "indexmap", - "log", - "more-asserts", - "serde", - "thiserror", - "wasmparser", -] - -[[package]] -name = "wasmtime-jit" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4539ea734422b7c868107e2187d7746d8affbcaa71916d72639f53757ad707" -dependencies = [ - "addr2line 0.15.1", - "anyhow", - "cfg-if 1.0.0", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.24.0", - "log", - "more-asserts", - "object 0.24.0", - "rayon", - "region", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-cranelift", - "wasmtime-debug", - "wasmtime-environ", - "wasmtime-obj", - "wasmtime-profiling", - "wasmtime-runtime", - "winapi 0.3.9", -] - -[[package]] -name = "wasmtime-obj" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1a8ff85246d091828e2225af521a6208ed28c997bb5c39eb697366dc2e2f2b" -dependencies = [ - "anyhow", - "more-asserts", - "object 0.24.0", - "target-lexicon", - "wasmtime-debug", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-profiling" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24364d522dcd67c897c8fffc42e5bdfc57207bbb6d7eeade0da9d4a7d70105b" -dependencies = [ - "anyhow", - "cfg-if 1.0.0", - "lazy_static", - "libc", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-runtime", -] - -[[package]] -name = "wasmtime-runtime" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51e57976e8a19a18a18e002c6eb12e5769554204238e47ff155fda1809ef0f7" -dependencies = [ - "anyhow", - "backtrace", - "cc", - "cfg-if 1.0.0", - "indexmap", - "lazy_static", - "libc", - "log", - "mach", - "memoffset 0.6.1", - "more-asserts", - "rand 0.8.4", - "region", - "thiserror", - "wasmtime-environ", - "winapi 0.3.9", -] - -[[package]] -name = "web-sys" -version = "0.3.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" -dependencies = [ - "webpki", -] - -[[package]] -name = "wepoll-sys" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" -dependencies = [ - "cc", -] - -[[package]] -name = "westend-runtime" -version = "0.9.8" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-collective", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-elections-phragmen", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-mmr-primitives", - "pallet-multisig", - "pallet-nicks", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-proxy", - "pallet-recovery", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-society", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "rustc-hex", - "serde", - "serde_derive", - "serde_json", - "smallvec 1.6.1", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "tiny-keccak", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "which" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" -dependencies = [ - "libc", - "thiserror", -] - -[[package]] -name = "widestring" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winreg" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "x25519-dalek" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" -dependencies = [ - "curve25519-dalek 2.1.0", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "x25519-dalek" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" -dependencies = [ - "curve25519-dalek 3.0.0", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "xcm" -version = "0.9.8" -dependencies = [ - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", -] - -[[package]] -name = "xcm-builder" -version = "0.9.8" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-parachain", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "xcm-executor" -version = "0.9.8" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", -] - -[[package]] -name = "yamux" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" -dependencies = [ - "futures 0.3.15", - "log", - "nohash-hasher", - "parking_lot 0.11.1", - "rand 0.8.4", - "static_assertions", -] - -[[package]] -name = "zeroize" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zstd" -version = "0.6.1+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "3.0.1+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "1.4.20+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" -dependencies = [ - "cc", - "libc", -] diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index cde35f11b0f3..398bafc428e2 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -1,17 +1,22 @@ mod pallet_balances; mod xcm_generic; +use pallet_assets::WeightInfo as PalletAssets; use pallet_balances::WeightInfo as PalletBalances; + use xcm_generic::WeightInfo as XcmGeneric; pub enum AssetTypes { Balances, + Assets, + Unknown, } impl From for AssetTypes { fn from(asset: MultiAsset) -> Self { - match self { - _ => Balances, + match asset { + ConcreteFungible => Balances, + _ => Assets, } } } @@ -25,9 +30,11 @@ impl XcmWeightInfo for WestendXcmWeight { XcmGeneric::order_null() } fn order_deposit_asset(assets: Vec, dest: MultiLocation) -> Weight { - assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { - AssetType::Balances => PalletBalances::order_deposit_asset(), - }) + // assets.weight() + // assets.iter().map(|asset| asset.into()).map(|asset_type| match asset_type { + // AssetType::Balances => PalletBalances::order_deposit_asset(), + // AssetType::Assets => PalletAsset::order_deposit_asset() + // }) } fn order_deposit_reserved_asset( assets: Vec, diff --git a/runtime/westend/src/xcm_weights/pallet_balances.rs b/runtime/westend/src/xcm_weights/pallet_balances.rs index ed7bcf7577fc..449d6493ed67 100644 --- a/runtime/westend/src/xcm_weights/pallet_balances.rs +++ b/runtime/westend/src/xcm_weights/pallet_balances.rs @@ -40,3 +40,48 @@ impl WeightInfo { 10 } } + +impl XcmWeightInfo for WeightInfo { + fn order_deposit_asset() -> Weight { + 10 + } + fn order_deposit_reserved_asset() -> Weight { + 10 + } + fn order_exchange_asset() -> Weight { + 10 + } + fn order_initiate_reserve_withdraw() -> Weight { + 10 + } + fn order_initiate_teleport() -> Weight { + 10 + } + fn order_query_holding() -> Weight { + 10 + } + fn order_buy_execution() -> Weight { + 10 + } + fn xcm_withdraw_asset() -> Weight { + 10 + } + fn xcm_reserve_asset_deposit() -> Weight { + 10 + } + fn xcm_teleport_asset() -> Weight { + 10 + } + fn xcm_query_response() -> Weight { + 10 + } + fn xcm_transfer_asset() -> Weight { + 10 + } + fn xcm_transfer_reserved_asset() -> Weight { + 10 + } + fn xcm_hrmp_channel_open_request() -> Weight { + unimplemented! {} + } +} diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index f294a268d37f..3c7fdb0c8084 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -16,8 +16,8 @@ sp-std = { version = "4.0.0-dev", default-features = false, branch = "master", g xcm-executor = { path = "../xcm-executor", default-features = false } # Benchmarks dependencies. -frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, branch = "master", git = "https://github.com/paritytech/substrate" } -xcm = { path = "..", default-features = false, optional = true } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } +xcm = { path = "..", default-features = false, features = ["runtime-benchmarks"] } [dev-dependencies] pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } @@ -39,7 +39,3 @@ std = [ "sp-runtime/std", "sp-std/std" ] -runtime-benchmarks = [ - "frame-benchmarking", - "xcm/runtime-benchmarks" -] diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 75259c19eecb..db7884e65c47 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -15,21 +15,40 @@ // along with Polkadot. If not, see . use super::*; -use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; +use crate::{ + account, account_id_junction, create_holding, execute_order, execute_xcm, AssetTransactorOf, + OverArchingCallOf, XcmCallOf, +}; use codec::Encode; -use frame_benchmarking::benchmarks_instance_pallet; -use frame_support::assert_ok; +use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; +use frame_support::{assert_ok, instances::Instance1, traits::fungible::Inspect}; +use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{opaque::v0::MultiLocation, v0::Order}; +use xcm::{ + opaque::v0::MultiLocation, + v0::{Order, Xcm}, +}; use xcm_executor::{traits::TransactAsset, Assets}; // TODO: def. needs to be become a config, might also want to use bounded vec. const MAX_ASSETS: u32 = 25; + /// The number of fungible assets in the holding. const HOLDING_FUNGIBLES: u32 = 99; const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks_instance_pallet! { + where_clause { where + < + < + T::TransactAsset + as + Inspect + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + } send_xcm {}: {} order_null { @@ -39,7 +58,29 @@ benchmarks_instance_pallet! { }: { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset {}: {} verify {} + + order_deposit_asset { + let origin = MultiLocation::X1(account_id_junction::(1)); + let asset = T::get_multi_asset(); + let order = Order::>::DepositAsset { + assets: vec![asset.clone()], + dest: MultiLocation::X1(account_id_junction::(77)), + }; + + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset); + // our dest must have no balance initially. + assert!(T::TransactAsset::balance(&account::(77)).is_zero()); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + // sender should have received some asset. + assert!(!T::TransactAsset::balance(&account::(77)).is_zero()) + } + order_deposit_reserved_asset {}: {} verify {} order_exchange_asset {}: {} verify {} order_initiate_reserve_withdraw {}: {} verify {} @@ -47,10 +88,50 @@ benchmarks_instance_pallet! { order_query_holding {}: {} verify {} order_buy_execution {}: {} verify {} - xcm_withdraw_asset {}: {} verify {} + xcm_withdraw_asset { + let origin: MultiLocation = (account_id_junction::(1)).into(); + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &origin).unwrap(); + + // TODO that this is sum-optimal. We should ideally populate the holding account, but we + // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log + // of n), and we can't really capture this yet. We could still make a wrapper for + // execute_xcm and hack around this. It will be like + // + // `fn execute_xcm_with_holding(xcm, holding)` + // + // and it will execute the xcm, assuming that the holding was already set. This only makes + // sense by our assumption of xcm's being weighed by each of their asset. If you have 3 + // assets, while benchmarking the third, you artificially set some values into the holding, + // which reflect the state of the holding after executing the previous two xcms. + + // check the assets of origin. + assert!(!T::TransactAsset::balance(&account::(1)).is_zero()); + // TODO: probably we can and should just use the opaque xcm/order types. + let xcm = Xcm::WithdrawAsset::> { assets: vec![asset], effects: vec![] }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + // check one of the assets of origin. + assert!(T::TransactAsset::balance(&account::(1)).is_zero()); + } xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} - xcm_transfer_asset {}: {} verify {} + xcm_transfer_asset { + let origin: MultiLocation = (account_id_junction::(1)).into(); + let dest = account_id_junction::(2).into(); + + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &origin).unwrap(); + let assets = vec![ asset ]; + assert!(T::TransactAsset::balance(&account::(2)).is_zero()); + let xcm = Xcm::TransferAsset { assets, dest }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + assert!(!T::TransactAsset::balance(&account::(2)).is_zero()); + } + xcm_transfer_reserved_asset {}: {} verify {} // xcm_query_response {}: {} verify {} @@ -61,15 +142,9 @@ benchmarks_instance_pallet! { // xcm_relayed_from {}: {} verify {} } -#[cfg(test)] -mod benchmark_tests { - use super::mock::{new_test_ext, Test}; - use super::*; - - #[test] - fn order_deposit_asset_fungible() { - new_test_ext().execute_with(|| { - test_bench_by_name::(b"order_null").unwrap(); - }) - } -} +// TODO: this macro cannot be called alone, fix it in substrate. +impl_benchmark_test_suite!( + Pallet, + crate::fungible::mock::new_test_ext(), + crate::fungible::mock::Test +); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 7114552c5bc9..163673e4e2be 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -15,10 +15,13 @@ // along with Polkadot. If not, see . use super::*; -use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; +use crate::{ + account, account_id_junction, create_holding, execute_order, execute_xcm, AssetTransactorOf, + OverArchingCallOf, XcmCallOf, +}; use codec::Encode; -use frame_benchmarking::benchmarks; -use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, weights::Weight}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_support::{assert_ok, traits::fungibles::Inspect, weights::Weight}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::{ @@ -35,6 +38,19 @@ const HOLDING_FUNGIBLES: u32 = 99; const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks! { + where_clause { + where >::AssetId: From, + < + < + T::TransactAsset + as + Inspect + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + } + send_xcm {}: {} // orders. @@ -46,7 +62,27 @@ benchmarks! { assert_ok!(execute_order::(origin, holding, order)); } - order_deposit_asset {}: {} verify {} + order_deposit_asset_per_asset { + // create one asset with our desired id. + let asset_id = 9; + let origin = MultiLocation::X1(account_id_junction::(1)); + + let asset = T::get_multi_asset(asset_id); + let order = Order::>::DepositAsset { + assets: vec![ asset.clone() ], + dest: MultiLocation::X1(account_id_junction::(2)), + }; + + let amount: u128 = T::TransactAsset::minimum_balance(asset_id.into()).try_into().unwrap(); + let mut holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + holding.saturating_subsume(asset); + assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) + } + order_deposit_reserved_asset {}: {} verify {} order_exchange_asset {}: {} verify {} order_initiate_reserve_withdraw {}: {} verify {} @@ -54,22 +90,56 @@ benchmarks! { order_query_holding {}: {} verify {} order_buy_execution {}: {} verify {} - xcm_withdraw_asset {}: {} verify {} + xcm_withdraw_asset_per_asset { + // number of fungible assets. + let a in 1..MAX_ASSETS+1; + + let origin: MultiLocation = (account_id_junction::(1)).into(); + let assets = (1..=a).map(|i| { + let asset = T::get_multi_asset(i); + // give all of these assets to the origin. + >::deposit_asset(&asset, &origin).unwrap(); + asset + }) + .collect::>(); + // check just one of the asset ids, namely 1. + assert!(!T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); + let xcm = Xcm::WithdrawAsset::> { assets, effects: vec![] }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + // check one of the assets of origin. All assets must have been withdrawn. + assert!(T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); + } xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} - xcm_transfer_asset {}: {} verify {} - xcm_transfer_reserved_asset {}: {} verify {} -} + xcm_transfer_asset_per_asset { + let origin: MultiLocation = (account_id_junction::(1)).into(); + let dest = (account_id_junction::(2)).into(); + let asset_id = 9; -#[cfg(test)] -mod benchmark_tests { - use super::mock::{new_test_ext, Test}; - use super::*; + let asset = T::get_multi_asset(asset_id); + // Note that we deposit a new asset with twice the amount into the sender to prevent it + // being dying. + >::deposit_asset( + &T::get_multi_asset(asset_id), // TODO: @shawntabrizi this won't work now. We need amount. + &origin + ).unwrap(); - #[test] - fn order_deposit_asset_fungible() { - new_test_ext().execute_with(|| { - test_bench_by_name::(b"order_null").unwrap(); - }) + assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + assert!(!T::TransactAsset::balance(asset_id.into(), &account::(1)).is_zero()); + + let xcm = Xcm::TransferAsset { assets: vec![asset], dest }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); } + xcm_transfer_reserved_asset {}: {} verify {} } + +impl_benchmark_test_suite!( + Pallet, + crate::fungibles::mock::new_test_ext(), + crate::fungibles::mock::Test +); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs index 77fda26744a1..a4a582a058bb 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mod.rs @@ -9,7 +9,7 @@ pub mod pallet { use crate::MultiAsset; #[pallet::config] - pub trait Config: frame_system::Config + crate::Config { + pub trait Config: frame_system::Config + crate::Config { /// The type of `fungibles` that is being used under the hood. /// /// This is useful for testing and checking. @@ -20,6 +20,5 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - pub struct Pallet(_); + pub struct Pallet(_); } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 7114552c5bc9..dc7a79f008e0 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -17,7 +17,7 @@ use super::*; use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; use codec::Encode; -use frame_benchmarking::benchmarks; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, weights::Weight}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; @@ -36,24 +36,6 @@ const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks! { send_xcm {}: {} - - // orders. - order_null { - let order = Order::>::Null; - let origin = MultiLocation::X1(account_id_junction::(1)); - let holding = Assets::default(); - }: { - assert_ok!(execute_order::(origin, holding, order)); - } - - order_deposit_asset {}: {} verify {} - order_deposit_reserved_asset {}: {} verify {} - order_exchange_asset {}: {} verify {} - order_initiate_reserve_withdraw {}: {} verify {} - order_initiate_teleport {}: {} verify {} - order_query_holding {}: {} verify {} - order_buy_execution {}: {} verify {} - xcm_withdraw_asset {}: {} verify {} xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} @@ -61,15 +43,8 @@ benchmarks! { xcm_transfer_reserved_asset {}: {} verify {} } -#[cfg(test)] -mod benchmark_tests { - use super::mock::{new_test_ext, Test}; - use super::*; - - #[test] - fn order_deposit_asset_fungible() { - new_test_ext().execute_with(|| { - test_bench_by_name::(b"order_null").unwrap(); - }) - } -} +impl_benchmark_test_suite!( + Pallet, + crate::xcm_generic::mock::new_test_ext(), + crate::xcm_generic::mock::Test +); diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs index f45a3ca6c426..2054ddb0f225 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs @@ -7,9 +7,8 @@ mod mock; #[frame_support::pallet] pub mod pallet { #[pallet::config] - pub trait Config: frame_system::Config + crate::Config {} + pub trait Config: frame_system::Config + crate::Config {} #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - pub struct Pallet(_); + pub struct Pallet(_); } From 78c4c3ea0ee321992fe9b59b8291a06de74b2944 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 3 Aug 2021 17:34:58 +0200 Subject: [PATCH 19/63] make build --- runtime/westend/src/xcm_weights/mod.rs | 102 ++++++++++-------- .../westend/src/xcm_weights/xcm_balances.rs | 6 -- .../westend/src/xcm_weights/xcm_generic.rs | 6 ++ 3 files changed, 62 insertions(+), 52 deletions(-) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index ee161935883b..0304873d2ce9 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -17,8 +17,8 @@ pub enum AssetTypes { Unknown, } -impl From for AssetTypes { - fn from(asset: MultiAsset) -> Self { +impl From<&MultiAsset> for AssetTypes { + fn from(asset: &MultiAsset) -> Self { match asset { MultiAsset::ConcreteFungible { .. } => AssetTypes::Balances, _ => AssetTypes::Unknown, @@ -26,14 +26,15 @@ impl From for AssetTypes { } } +// TODO from Shawn: I dont like this trait WeighMultiAssets { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight; } impl WeighMultiAssets for Vec { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight { - self.iter() - .map(|m| >::from(m)) + self.into_iter() + .map(|m| >::from(m)) .map(|t| match t { AssetTypes::Balances => balances_weight, AssetTypes::Unknown => Weight::MAX, @@ -50,85 +51,94 @@ impl XcmWeightInfo<()> for WestendXcmWeight { fn order_null() -> Weight { XcmGeneric::::order_null() } - fn order_deposit_asset(assets: &Vec, dest: &MultiLocation) -> Weight { + fn order_deposit_asset(assets: &Vec, _dest: &MultiLocation) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_asset()) } fn order_deposit_reserved_asset( - assets: Vec, - dest: MultiLocation, - effects: Vec>, + assets: &Vec, + _dest: &MultiLocation, + _effects: &Vec>, ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) } - fn order_exchange_asset(give: Vec, receive: Vec) -> Weight { - unimplemented!() + fn order_exchange_asset(give: &Vec, _receive: &Vec) -> Weight { + // TODO: Probably not right + give.weigh_multi_assets(XcmBalancesWeight::::order_exchange_asset()) } fn order_initiate_reserve_withdraw( - assets: Vec, - reserve: MultiLocation, - effects: Vec>, + assets: &Vec, + _reserve: &MultiLocation, + _effects: &Vec>, ) -> Weight { - unimplemented!() + assets.weigh_multi_assets(XcmBalancesWeight::::order_initiate_reserve_withdraw()) } fn order_initiate_teleport( - assets: Vec, - dest: MultiLocation, - effects: Vec>, + assets: &Vec, + _dest: &MultiLocation, + _effects: &Vec>, ) -> Weight { - unimplemented!() + assets.weigh_multi_assets(XcmBalancesWeight::::order_initiate_teleport()) } - fn order_query_holding(query_id: u64, dest: MultiLocation, assets: Vec) -> Weight { - unimplemented!() + fn order_query_holding( + _query_id: &u64, + _dest: &MultiLocation, + _assets: &Vec, + ) -> Weight { + XcmGeneric::::order_query_holding() } fn order_buy_execution( - fees: MultiAsset, - weight: u64, - debt: u64, - halt_on_error: bool, - xcm: Vec>, + _fees: &MultiAsset, + _weight: &u64, + _debt: &u64, + _halt_on_error: &bool, + _xcm: &Vec>, ) -> Weight { XcmGeneric::::order_buy_execution() } - fn xcm_withdraw_asset(assets: Vec, effects: Vec>) -> Weight { - unimplemented!() + fn xcm_withdraw_asset(assets: &Vec, _effects: &Vec>) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_withdraw_asset()) } - fn xcm_reserve_asset_deposit(assets: Vec, effects: Vec>) -> Weight { - unimplemented!() + fn xcm_reserve_asset_deposit(assets: &Vec, _effects: &Vec>) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_reserve_asset_deposit()) } // TODO none of these need effects - fn xcm_teleport_asset(assets: Vec, effects: Vec>) -> Weight { - unimplemented!() + fn xcm_teleport_asset(assets: &Vec, _effects: &Vec>) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_teleport_asset()) } - fn xcm_query_response(query_id: u64, response: Response) -> Weight { + fn xcm_query_response(_query_id: &u64, _response: &Response) -> Weight { XcmGeneric::::xcm_query_response() } - fn xcm_transfer_asset(assets: Vec, dest: MultiLocation) -> Weight { - unimplemented!() + fn xcm_transfer_asset(assets: &Vec, _dest: &MultiLocation) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_asset()) } - fn xcm_transfer_reserved_asset(assets: Vec, dest: MultiLocation) -> Weight { - unimplemented!() + fn xcm_transfer_reserved_asset( + assets: &Vec, + _dest: &MultiLocation, + _effects: &Vec>, + ) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_reserved_asset()) } fn xcm_transact( - origin_type: OriginKind, - require_weight_at_most: u64, - call: DoubleEncoded, + _origin_type: &OriginKind, + _require_weight_at_most: &u64, + _call: &DoubleEncoded<()>, ) -> Weight { XcmGeneric::::xcm_transact() } fn xcm_hrmp_channel_open_request( - sender: u32, - max_message_size: u32, - max_capacity: u32, + _sender: &u32, + _max_message_size: &u32, + _max_capacity: &u32, ) -> Weight { XcmGeneric::::xcm_hrmp_channel_open_request() } - fn xcm_hrmp_channel_accepted(recipient: u32) -> Weight { + fn xcm_hrmp_channel_accepted(_recipient: &u32) -> Weight { XcmGeneric::::xcm_hrmp_channel_accepted() } - fn xcm_hrmp_channel_closing(initiator: u32, sender: u32, recipient: u32) -> Weight { - XcmGeneric::::xcm_hrmp_channel_accepted() + fn xcm_hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { + XcmGeneric::::xcm_hrmp_channel_closing() } - fn xcm_relayed_from(who: MultiLocation, message: Box>) -> Weight { + fn xcm_relayed_from(_who: &MultiLocation, _message: &Box>) -> Weight { XcmGeneric::::xcm_relayed_from() } } diff --git a/runtime/westend/src/xcm_weights/xcm_balances.rs b/runtime/westend/src/xcm_weights/xcm_balances.rs index 5476496b165c..fc0e221cd774 100644 --- a/runtime/westend/src/xcm_weights/xcm_balances.rs +++ b/runtime/westend/src/xcm_weights/xcm_balances.rs @@ -17,12 +17,6 @@ impl WeightInfo { pub fn order_initiate_teleport() -> Weight { 10 } - pub fn order_query_holding() -> Weight { - 10 - } - pub fn order_buy_execution() -> Weight { - 10 - } pub fn xcm_withdraw_asset() -> Weight { 10 } diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs index c8739c87b4a5..1a459527e5a2 100644 --- a/runtime/westend/src/xcm_weights/xcm_generic.rs +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -8,6 +8,12 @@ impl WeightInfo { pub fn order_null() -> Weight { 10 } + pub fn order_query_holding() -> Weight { + 10 + } + pub fn order_buy_execution() -> Weight { + 10 + } pub fn xcm_transact() -> Weight { 10 } From 2049112af2ef19ff539013f3db1303aa44e711fb Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 3 Aug 2021 18:12:17 +0200 Subject: [PATCH 20/63] fix benchmark compile --- runtime/westend/src/lib.rs | 24 +++++++++++------------- runtime/westend/src/xcm_weights/mod.rs | 5 +++-- xcm/pallet-xcm-benchmarks/src/lib.rs | 7 ++++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 11d01b437a9d..17d74f257128 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1504,25 +1504,20 @@ sp_api::impl_runtime_apis! { impl pallet_offences_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} - use pallet_xcm_benchmarks::AsFungibles; use xcm::v0::MultiAsset; impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; - type FungibleTransactAsset = Balances; + } - fn fungible_asset(amount: u32) -> Option<(MultiAsset, u128)> { - let amount: Balance = amount.into(); - let amount = ExistentialDeposit::get() * amount; - Some((MultiAsset::ConcreteFungible { id: WndLocation::get(), amount }, amount)) - } + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; - // We pass in this adapter for the fungibles stuff, so our weights for fungibles - // will be quite similar to fungible, understandably. We don't need these weights - // anyways, westend does not have or use fungibles.. - type FungiblesTransactAsset = AsFungibles; + fn get_multi_asset() -> MultiAsset { + MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 0 } + } } - type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::; + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; let whitelist: Vec = vec![ // Block Number @@ -1549,6 +1544,7 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, runtime_common::crowdloan, Crowdloan); add_benchmark!(params, batches, runtime_common::paras_registrar, Registrar); add_benchmark!(params, batches, runtime_common::slots, Slots); + // Substrate add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); @@ -1565,7 +1561,9 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_vesting, Vesting); - add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks); + + // XCM Benchmarks + add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmBalances); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index 0304873d2ce9..eac07f3994f8 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -4,7 +4,7 @@ mod xcm_generic; use frame_support::weights::Weight; use xcm_balances::WeightInfo as XcmBalancesWeight; -use crate::Runtime; +use crate::{Runtime, WndLocation}; use sp_std::prelude::*; use xcm::{ v0::{MultiAsset, MultiLocation, Order, OriginKind, Response, Xcm, XcmWeightInfo}, @@ -19,8 +19,9 @@ pub enum AssetTypes { impl From<&MultiAsset> for AssetTypes { fn from(asset: &MultiAsset) -> Self { + let WND_LOCATION = WndLocation::get(); match asset { - MultiAsset::ConcreteFungible { .. } => AssetTypes::Balances, + MultiAsset::ConcreteFungible { id: WND_LOCATION, .. } => AssetTypes::Balances, _ => AssetTypes::Unknown, } } diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 767e1dfdabfb..6c7649d26e0c 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -27,15 +27,16 @@ use frame_support::{ tokens::{DepositConsequence, WithdrawConsequence}, }, }; +use sp_std::prelude::*; use xcm::v0::{ AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, Order, Outcome, Xcm, }; use xcm_executor::Assets; -mod fungible; -mod fungibles; -mod xcm_generic; +pub mod fungible; +pub mod fungibles; +pub mod xcm_generic; #[cfg(test)] mod mock; From 45dedc966743cc66977f4dfef74c2c8e8b3200e3 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 3 Aug 2021 23:50:31 +0200 Subject: [PATCH 21/63] benchmark fix --- runtime/westend/src/lib.rs | 6 +++ runtime/westend/src/xcm_weights/mod.rs | 4 +- xcm/pallet-xcm-benchmarks/template.hbs | 66 ++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 xcm/pallet-xcm-benchmarks/template.hbs diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 17d74f257128..cd2183e6a3f9 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1456,6 +1456,8 @@ sp_api::impl_runtime_apis! { use pallet_offences_benchmarking::Pallet as OffencesBench; use frame_system_benchmarking::Pallet as SystemBench; + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + let mut list = Vec::::new(); // Polkadot @@ -1465,6 +1467,7 @@ sp_api::impl_runtime_apis! { list_benchmark!(list, extra, runtime_common::crowdloan, Crowdloan); list_benchmark!(list, extra, runtime_common::paras_registrar, Registrar); list_benchmark!(list, extra, runtime_common::slots, Slots); + // Substrate list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); @@ -1482,6 +1485,9 @@ sp_api::impl_runtime_apis! { list_benchmark!(list, extra, pallet_utility, Utility); list_benchmark!(list, extra, pallet_vesting, Vesting); + // XCM Benchmarks + list_benchmark!(list, extra, pallet_xcm_benchmarks, XcmBalances); + let storage_info = AllPalletsWithSystem::storage_info(); return (list, storage_info) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index eac07f3994f8..ffd656ed8065 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -19,9 +19,9 @@ pub enum AssetTypes { impl From<&MultiAsset> for AssetTypes { fn from(asset: &MultiAsset) -> Self { - let WND_LOCATION = WndLocation::get(); + let wnd_location = WndLocation::get(); match asset { - MultiAsset::ConcreteFungible { id: WND_LOCATION, .. } => AssetTypes::Balances, + MultiAsset::ConcreteFungible { id: wnd_location, .. } => AssetTypes::Balances, _ => AssetTypes::Unknown, } } diff --git a/xcm/pallet-xcm-benchmarks/template.hbs b/xcm/pallet-xcm-benchmarks/template.hbs new file mode 100644 index 000000000000..130e811ba67b --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/template.hbs @@ -0,0 +1,66 @@ +// Copyright 2017-2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Autogenerated weights for {{pallet}} +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} + +// Executed Command: +{{#each args as |arg|~}} +// {{arg}} +{{/each}} + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for {{pallet}} using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + {{~#each benchmarks as |benchmark|}} + {{~#each benchmark.comments as |comment|}} + // {{comment}} + {{~/each}} + fn {{benchmark.name~}} + ( + {{~#each benchmark.components as |c| ~}} + {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} + ) -> Weight { + ({{underscore benchmark.base_weight}} as Weight) + {{~#each benchmark.component_weight as |cw|}} + // Standard Error: {{underscore cw.error}} + .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + {{~/each}} + {{~#if (ne benchmark.base_reads "0")}} + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) + {{~/if}} + {{~#each benchmark.component_reads as |cr|}} + .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + {{~/each}} + {{~#if (ne benchmark.base_writes "0")}} + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) + {{~/if}} + {{~#each benchmark.component_writes as |cw|}} + .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + {{~/each}} + } + {{~/each}} +} From 893d5726c5fc0a68a757bd0618a149d819a20bc0 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 00:51:21 +0200 Subject: [PATCH 22/63] fix benchmark --- .../src/fungibles/benchmarking.rs | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 163673e4e2be..ed9969a621c4 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -21,7 +21,11 @@ use crate::{ }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{assert_ok, traits::fungibles::Inspect, weights::Weight}; +use frame_support::{ + assert_ok, + traits::fungibles::{Inspect, Mutate}, + weights::Weight, +}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::{ @@ -114,26 +118,34 @@ benchmarks! { xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_transfer_asset_per_asset { + let a in 1..MAX_ASSETS+1; + let origin: MultiLocation = (account_id_junction::(1)).into(); let dest = (account_id_junction::(2)).into(); - let asset_id = 9; - let asset = T::get_multi_asset(asset_id); - // Note that we deposit a new asset with twice the amount into the sender to prevent it - // being dying. - >::deposit_asset( - &T::get_multi_asset(asset_id), // TODO: @shawntabrizi this won't work now. We need amount. - &origin - ).unwrap(); + let assets = (1..a).map(|asset_id| { + let asset = T::get_multi_asset(asset_id); + // Note that we deposit a new asset with twice the amount into the sender to prevent it + // being dying. + let amount = T::TransactAsset::minimum_balance(asset_id.into()) * 2u32.into(); + assert_ok!(T::TransactAsset::mint_into(asset_id.into(), &account::(1), amount)); - assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); - assert!(!T::TransactAsset::balance(asset_id.into(), &account::(1)).is_zero()); + // verify accounts funded + assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + assert!(!T::TransactAsset::balance(asset_id.into(), &account::(1)).is_zero()); + + // return asset + asset + }) + .collect::>(); - let xcm = Xcm::TransferAsset { assets: vec![asset], dest }; + let xcm = Xcm::TransferAsset { assets, dest }; }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { - assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + for asset_id in 1..a { + assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); + } } xcm_transfer_reserved_asset {}: {} verify {} } From 2038bbd918fcaf9212701048143304217ccfb1ed Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 11:59:11 +0200 Subject: [PATCH 23/63] new bm --- .../src/fungible/benchmarking.rs | 54 ++++++++++++------- xcm/pallet-xcm-benchmarks/src/lib.rs | 7 +++ .../src/xcm_generic/benchmarking.rs | 7 +++ 3 files changed, 49 insertions(+), 19 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index db7884e65c47..40e8f33107ec 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -16,8 +16,8 @@ use super::*; use crate::{ - account, account_id_junction, create_holding, execute_order, execute_xcm, AssetTransactorOf, - OverArchingCallOf, XcmCallOf, + account, account_and_location, account_id_junction, create_holding, execute_order, execute_xcm, + AssetTransactorOf, OverArchingCallOf, XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; @@ -49,40 +49,56 @@ benchmarks_instance_pallet! { TryInto >::Error: sp_std::fmt::Debug, } - send_xcm {}: {} - - order_null { - let order = Order::>::Null; - let origin = MultiLocation::X1(account_id_junction::(1)); - let holding = Assets::default(); - }: { - assert_ok!(execute_order::(origin, holding, order)); - } order_deposit_asset { let origin = MultiLocation::X1(account_id_junction::(1)); + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset.clone()); + // our dest must have no balance initially. + let (dest_account, dest_location) = account_and_location::(77); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + let order = Order::>::DepositAsset { assets: vec![asset.clone()], - dest: MultiLocation::X1(account_id_junction::(77)), + dest: dest_location, }; + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + // dest should have received some asset. + assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + } + + order_deposit_reserve_asset { + let origin = MultiLocation::X1(account_id_junction::(1)); + let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset); + holding.saturating_subsume(asset.clone()); // our dest must have no balance initially. - assert!(T::TransactAsset::balance(&account::(77)).is_zero()); + let (dest_account, dest_location) = account_and_location::(77); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let effects = Vec::new(); // TODO fix + let order = Order::>::DepositReserveAsset { + assets: vec![asset.clone()], + dest: dest_location, + effects, + }; }: { assert_ok!(execute_order::(origin, holding, order)); } verify { - // sender should have received some asset. - assert!(!T::TransactAsset::balance(&account::(77)).is_zero()) + // dest should have received some asset. + assert!(!T::TransactAsset::balance(&dest_account).is_zero()) } - - order_deposit_reserved_asset {}: {} verify {} - order_exchange_asset {}: {} verify {} order_initiate_reserve_withdraw {}: {} verify {} order_initiate_teleport {}: {} verify {} order_query_holding {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 6c7649d26e0c..dfe115436f99 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -120,6 +120,13 @@ fn account_id_junction(index: u32) -> Junction { Junction::AccountId32 { network: NetworkId::Any, id } } +pub fn account_and_location(index: u32) -> (T::AccountId, MultiLocation) { + let account = account::(index); + let location = MultiLocation::X1(account_id_junction::(index)); + + (account, location) +} + /// Helper struct that converts a `Fungible` to `Fungibles` /// /// TODO: might not be needed anymore. diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index dc7a79f008e0..4021068d2069 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -36,6 +36,13 @@ const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks! { send_xcm {}: {} + order_null { + let order = Order::>::Null; + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = Assets::default(); + }: { + assert_ok!(execute_order::(origin, holding, order)); + } xcm_withdraw_asset {}: {} verify {} xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} From 3b056c7c5e9da554ce994047cb0102c23f6a98d4 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 12:56:00 +0200 Subject: [PATCH 24/63] more benches --- .../src/fungible/benchmarking.rs | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 40e8f33107ec..99b269985192 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -24,10 +24,7 @@ use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; use frame_support::{assert_ok, instances::Instance1, traits::fungible::Inspect}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - opaque::v0::MultiLocation, - v0::{Order, Xcm}, -}; +use xcm::v0::{Junction, MultiLocation, Order, Xcm}; use xcm_executor::{traits::TransactAsset, Assets}; // TODO: def. needs to be become a config, might also want to use bounded vec. @@ -87,7 +84,7 @@ benchmarks_instance_pallet! { let (dest_account, dest_location) = account_and_location::(77); assert!(T::TransactAsset::balance(&dest_account).is_zero()); - let effects = Vec::new(); // TODO fix + let effects = Vec::new(); // No effects to isolate the order let order = Order::>::DepositReserveAsset { assets: vec![asset.clone()], dest: dest_location, @@ -99,8 +96,47 @@ benchmarks_instance_pallet! { // dest should have received some asset. assert!(!T::TransactAsset::balance(&dest_account).is_zero()) } - order_initiate_reserve_withdraw {}: {} verify {} - order_initiate_teleport {}: {} verify {} + order_initiate_reserve_withdraw { + let origin = MultiLocation::X1(account_id_junction::(1)); + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset.clone()); + + let effects = Vec::new(); // No effects to isolate the order + let order = Order::>::DepositReserveAsset { + assets: vec![asset.clone()], + dest: MultiLocation::X1(account_id_junction::(77)), // TODO FIX, maybe needs a config trait + effects, + }; + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + // execute_order succeeding is enough to verify this completed. + } + order_initiate_teleport { + let (sender_account, origin) = account_and_location::(1); + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + // .. and the specific asset that we want to take out. + holding.saturating_subsume(asset.clone()); + + let effects = Vec::new(); // No effects to isolate the order + let order = Order::>::DepositReserveAsset { + assets: vec![asset.clone()], + dest: MultiLocation::X1(account_id_junction::(77)), // TODO FIX, maybe needs a config trait + effects, + }; + }: { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + // sender should have received some asset. + assert!(!T::TransactAsset::balance(&sender_account).is_zero()) + } order_query_holding {}: {} verify {} order_buy_execution {}: {} verify {} From 46a3af0e771ca378a40ad00a5b0e7c482840611f Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 13:28:32 +0200 Subject: [PATCH 25/63] fix bench --- node/core/bitfield-signing/src/lib.rs | 8 +-- parachain/test-parachains/adder/src/lib.rs | 2 +- .../src/fungible/benchmarking.rs | 16 +++-- .../src/fungible/mock.rs | 4 +- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 4 ++ .../src/fungibles/mock.rs | 9 +-- xcm/pallet-xcm-benchmarks/src/mock.rs | 5 +- .../src/xcm_generic/mock.rs | 9 +-- xcm/src/v0/mod.rs | 60 ++++++++----------- xcm/src/v0/order.rs | 42 ++++++------- xcm/xcm-builder/src/currency_adapter.rs | 5 +- xcm/xcm-builder/src/weight.rs | 35 +++++------ xcm/xcm-executor/src/lib.rs | 36 +++++------ xcm/xcm-executor/src/traits/transact_asset.rs | 2 +- xcm/xcm-executor/src/traits/weight.rs | 53 ++++++++-------- 15 files changed, 139 insertions(+), 151 deletions(-) diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index 12d8dcfdd9d0..4d322fffb7cd 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -280,8 +280,8 @@ impl JobTrait for BitfieldSigningJob { Err(Error::Runtime(runtime_err)) => { // Don't take down the node on runtime API errors. tracing::warn!(target: LOG_TARGET, err = ?runtime_err, "Encountered a runtime API error"); - return Ok(()); - } + return Ok(()) + }, Err(err) => return Err(err), Ok(bitfield) => bitfield, }; @@ -300,8 +300,8 @@ impl JobTrait for BitfieldSigningJob { target: LOG_TARGET, "Key was found at construction, but while signing it could not be found.", ); - return Ok(()); - } + return Ok(()) + }, }; metrics.on_bitfield_signed(); diff --git a/parachain/test-parachains/adder/src/lib.rs b/parachain/test-parachains/adder/src/lib.rs index a9155efcaeb0..096c5eac969c 100644 --- a/parachain/test-parachains/adder/src/lib.rs +++ b/parachain/test-parachains/adder/src/lib.rs @@ -97,7 +97,7 @@ pub fn execute( assert_eq!(parent_hash, parent_head.hash()); if hash_state(block_data.state) != parent_head.post_state { - return Err(StateMismatch); + return Err(StateMismatch) } let new_state = block_data.state.wrapping_add(block_data.add); diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 99b269985192..fc6fd7222453 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -21,7 +21,9 @@ use crate::{ }; use codec::Encode; use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; -use frame_support::{assert_ok, instances::Instance1, traits::fungible::Inspect}; +use frame_support::{ + assert_ok, instances::Instance1, pallet_prelude::Get, traits::fungible::Inspect, +}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::v0::{Junction, MultiLocation, Order, Xcm}; @@ -126,16 +128,22 @@ benchmarks_instance_pallet! { holding.saturating_subsume(asset.clone()); let effects = Vec::new(); // No effects to isolate the order - let order = Order::>::DepositReserveAsset { + let order = Order::>::InitiateTeleport { assets: vec![asset.clone()], dest: MultiLocation::X1(account_id_junction::(77)), // TODO FIX, maybe needs a config trait effects, }; + if let Some(checked_account) = T::CheckedAccount::get() { + // Checked account starts at zero + assert!(T::TransactAsset::balance(&checked_account).is_zero()); + } }: { assert_ok!(execute_order::(origin, holding, order)); } verify { - // sender should have received some asset. - assert!(!T::TransactAsset::balance(&sender_account).is_zero()) + if let Some(checked_account) = T::CheckedAccount::get() { + // teleport checked account should have received some asset. + assert!(!T::TransactAsset::balance(&checked_account).is_zero()); + } } order_query_holding {}: {} verify {} order_buy_execution {}: {} verify {} diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index d19daf11e08d..c9219a3bca7a 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -16,8 +16,7 @@ //! A mock runtime for xcm benchmarking. -use crate::fungible as xcm_balances_benchmark; -use crate::mock::*; +use crate::{fungible as xcm_balances_benchmark, mock::*}; use frame_support::parameter_types; use sp_core::H256; use sp_runtime::{ @@ -143,6 +142,7 @@ impl crate::Config for Test { impl xcm_balances_benchmark::Config for Test { type TransactAsset = Balances; + type CheckedAccount = CheckedAccount; fn get_multi_asset() -> MultiAsset { let amount = >::minimum_balance() as u128; diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index f6e6eb3aedf8..d0b0f39e0c00 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -8,6 +8,7 @@ use xcm::v0::MultiAsset; // TODO: make this instanciable. #[frame_support::pallet] pub mod pallet { + use frame_support::pallet_prelude::Get; #[pallet::config] pub trait Config: frame_system::Config + crate::Config { @@ -16,6 +17,9 @@ pub mod pallet { /// This is useful for testing and checking. type TransactAsset: frame_support::traits::fungible::Mutate; + /// temp? + type CheckedAccount: Get>; + /// Give me a fungible asset that your asset transactor is going to accept. fn get_multi_asset() -> xcm::v0::MultiAsset; } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 4cbbe76e8556..52e7d7b7a4d8 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -16,10 +16,11 @@ //! A mock runtime for xcm benchmarking. -use crate::fungibles as xcm_assets_benchmarks; -use crate::{mock::*, *}; -use frame_support::traits::fungibles::Inspect; -use frame_support::{parameter_types, traits::Contains}; +use crate::{fungibles as xcm_assets_benchmarks, mock::*, *}; +use frame_support::{ + parameter_types, + traits::{fungibles::Inspect, Contains}, +}; use sp_core::H256; use sp_runtime::{ testing::Header, diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 197ac7a16f21..19e30a9f7a39 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -52,9 +52,8 @@ pub struct AccountIdConverter; impl xcm_executor::traits::Convert for AccountIdConverter { fn convert(ml: MultiLocation) -> Result { match ml { - MultiLocation::X1(Junction::AccountId32 { id, .. }) => { - Ok(::decode(&mut &*id.to_vec()).unwrap()) - } + MultiLocation::X1(Junction::AccountId32 { id, .. }) => + Ok(::decode(&mut &*id.to_vec()).unwrap()), _ => Err(ml), } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 490b55274163..124aa557acac 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -16,10 +16,11 @@ //! A mock runtime for xcm benchmarking. -use crate::xcm_generic as xcm_generic_benchmarks; -use crate::{mock::*, *}; -use frame_support::traits::fungibles::Inspect; -use frame_support::{parameter_types, traits::Contains}; +use crate::{mock::*, xcm_generic as xcm_generic_benchmarks, *}; +use frame_support::{ + parameter_types, + traits::{fungibles::Inspect, Contains}, +}; use sp_core::H256; use sp_runtime::{ testing::Header, diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index eceaa75e1e9e..d52050aeab03 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -297,34 +297,27 @@ impl Xcm { pub fn from(xcm: Xcm) -> Self { use Xcm::*; match xcm { - WithdrawAsset { assets, effects } => { - WithdrawAsset { assets, effects: effects.into_iter().map(Order::into).collect() } - } + WithdrawAsset { assets, effects } => + WithdrawAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, ReserveAssetDeposit { assets, effects } => ReserveAssetDeposit { assets, effects: effects.into_iter().map(Order::into).collect(), }, - TeleportAsset { assets, effects } => { - TeleportAsset { assets, effects: effects.into_iter().map(Order::into).collect() } - } + TeleportAsset { assets, effects } => + TeleportAsset { assets, effects: effects.into_iter().map(Order::into).collect() }, QueryResponse { query_id: u64, response } => QueryResponse { query_id: u64, response }, TransferAsset { assets, dest } => TransferAsset { assets, dest }, - TransferReserveAsset { assets, dest, effects } => { - TransferReserveAsset { assets, dest, effects } - } - HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => { - HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } - } + TransferReserveAsset { assets, dest, effects } => + TransferReserveAsset { assets, dest, effects }, + HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity }, HrmpChannelAccepted { recipient } => HrmpChannelAccepted { recipient }, - HrmpChannelClosing { initiator, sender, recipient } => { - HrmpChannelClosing { initiator, sender, recipient } - } - Transact { origin_type, require_weight_at_most, call } => { - Transact { origin_type, require_weight_at_most, call: call.into() } - } - RelayedFrom { who, message } => { - RelayedFrom { who, message: alloc::boxed::Box::new((*message).into()) } - } + HrmpChannelClosing { initiator, sender, recipient } => + HrmpChannelClosing { initiator, sender, recipient }, + Transact { origin_type, require_weight_at_most, call } => + Transact { origin_type, require_weight_at_most, call: call.into() }, + RelayedFrom { who, message } => + RelayedFrom { who, message: alloc::boxed::Box::new((*message).into()) }, } } // TODO: is this needed? @@ -341,25 +334,20 @@ impl> GetWeight for Xcm<()> { fn weight(&self) -> Weight { match self { Xcm::WithdrawAsset { assets, effects } => W::xcm_withdraw_asset(assets, effects), - Xcm::ReserveAssetDeposit { assets, effects } => { - W::xcm_reserve_asset_deposit(assets, effects) - } + Xcm::ReserveAssetDeposit { assets, effects } => + W::xcm_reserve_asset_deposit(assets, effects), Xcm::TeleportAsset { assets, effects } => W::xcm_teleport_asset(assets, effects), Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), Xcm::TransferAsset { assets, dest } => W::xcm_transfer_asset(assets, dest), - Xcm::TransferReserveAsset { assets, dest, effects } => { - W::xcm_transfer_reserved_asset(&assets, dest, effects) - } - Xcm::Transact { origin_type, require_weight_at_most, call } => { - W::xcm_transact(origin_type, require_weight_at_most, call) - } - Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => { - W::xcm_hrmp_channel_open_request(sender, max_message_size, max_capacity) - } + Xcm::TransferReserveAsset { assets, dest, effects } => + W::xcm_transfer_reserved_asset(&assets, dest, effects), + Xcm::Transact { origin_type, require_weight_at_most, call } => + W::xcm_transact(origin_type, require_weight_at_most, call), + Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + W::xcm_hrmp_channel_open_request(sender, max_message_size, max_capacity), Xcm::HrmpChannelAccepted { recipient } => W::xcm_hrmp_channel_accepted(recipient), - Xcm::HrmpChannelClosing { initiator, sender, recipient } => { - W::xcm_hrmp_channel_closing(initiator, sender, recipient) - } + Xcm::HrmpChannelClosing { initiator, sender, recipient } => + W::xcm_hrmp_channel_closing(initiator, sender, recipient), Xcm::RelayedFrom { who, message } => W::xcm_relayed_from(who, message), } } diff --git a/xcm/src/v0/order.rs b/xcm/src/v0/order.rs index 19fd4d8aef8e..7cf058d9c99a 100644 --- a/xcm/src/v0/order.rs +++ b/xcm/src/v0/order.rs @@ -137,21 +137,18 @@ impl Order { match order { Null => Null, DepositAsset { assets, dest } => DepositAsset { assets, dest }, - DepositReserveAsset { assets, dest, effects } => { - DepositReserveAsset { assets, dest, effects } - } + DepositReserveAsset { assets, dest, effects } => + DepositReserveAsset { assets, dest, effects }, ExchangeAsset { give, receive } => ExchangeAsset { give, receive }, - InitiateReserveWithdraw { assets, reserve, effects } => { - InitiateReserveWithdraw { assets, reserve, effects } - } - InitiateTeleport { assets, dest, effects } => { - InitiateTeleport { assets, dest, effects } - } + InitiateReserveWithdraw { assets, reserve, effects } => + InitiateReserveWithdraw { assets, reserve, effects }, + InitiateTeleport { assets, dest, effects } => + InitiateTeleport { assets, dest, effects }, QueryHolding { query_id, dest, assets } => QueryHolding { query_id, dest, assets }, BuyExecution { fees, weight, debt, halt_on_error, xcm } => { let xcm = xcm.into_iter().map(Xcm::from).collect(); BuyExecution { fees, weight, debt, halt_on_error, xcm } - } + }, } } } @@ -161,22 +158,17 @@ impl> GetWeight for Order<()> { match self { Order::Null => W::order_null(), Order::DepositAsset { assets, dest } => W::order_deposit_asset(assets, dest), - Order::DepositReserveAsset { assets, dest, effects } => { - W::order_deposit_reserved_asset(assets, dest, effects) - } + Order::DepositReserveAsset { assets, dest, effects } => + W::order_deposit_reserved_asset(assets, dest, effects), Order::ExchangeAsset { give, receive } => W::order_exchange_asset(give, receive), - Order::InitiateReserveWithdraw { assets, reserve, effects } => { - W::order_initiate_reserve_withdraw(assets, reserve, effects) - } - Order::InitiateTeleport { assets, dest, effects } => { - W::order_initiate_teleport(assets, dest, effects) - } - Order::QueryHolding { query_id, dest, assets } => { - W::order_query_holding(query_id, dest, assets) - } - Order::BuyExecution { fees, weight, debt, halt_on_error, xcm } => { - W::order_buy_execution(fees, weight, debt, halt_on_error, xcm) - } + Order::InitiateReserveWithdraw { assets, reserve, effects } => + W::order_initiate_reserve_withdraw(assets, reserve, effects), + Order::InitiateTeleport { assets, dest, effects } => + W::order_initiate_teleport(assets, dest, effects), + Order::QueryHolding { query_id, dest, assets } => + W::order_query_holding(query_id, dest, assets), + Order::BuyExecution { fees, weight, debt, halt_on_error, xcm } => + W::order_buy_execution(fees, weight, debt, halt_on_error, xcm), } } } diff --git a/xcm/xcm-builder/src/currency_adapter.rs b/xcm/xcm-builder/src/currency_adapter.rs index 8aaa70fd3754..c911a0775d38 100644 --- a/xcm/xcm-builder/src/currency_adapter.rs +++ b/xcm/xcm-builder/src/currency_adapter.rs @@ -41,9 +41,8 @@ impl From for XcmError { match e { Error::AssetNotFound => XcmError::AssetNotFound, Error::AccountIdConversionFailed => FailedToTransactAsset("AccountIdConversionFailed"), - Error::AmountToBalanceConversionFailed => { - FailedToTransactAsset("AmountToBalanceConversionFailed") - } + Error::AmountToBalanceConversionFailed => + FailedToTransactAsset("AmountToBalanceConversionFailed"), } } } diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index 78158e55eafe..f86030b902b3 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -31,15 +31,13 @@ pub struct FixedWeightBounds(PhantomData<(T, C)>); impl, C: Decode + GetDispatchInfo> WeightBounds for FixedWeightBounds { fn shallow(message: &mut Xcm) -> Result { Ok(match message { - Xcm::Transact { call, .. } => { - call.ensure_decoded()?.get_dispatch_info().weight.saturating_add(T::get()) - } - Xcm::RelayedFrom { ref mut message, .. } => { - T::get().saturating_add(Self::shallow(message.as_mut())?) - } - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } => { + Xcm::Transact { call, .. } => + call.ensure_decoded()?.get_dispatch_info().weight.saturating_add(T::get()), + Xcm::RelayedFrom { ref mut message, .. } => + T::get().saturating_add(Self::shallow(message.as_mut())?), + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { let inner: Weight = effects .iter_mut() .map(|effect| match effect { @@ -50,36 +48,35 @@ impl, C: Decode + GetDispatchInfo> WeightBounds for FixedWeigh // be definitely consumed from any existing weight credit if execution of the message // is attempted. T::get() - } + }, _ => T::get(), }) .sum(); T::get().saturating_add(inner) - } + }, _ => T::get(), }) } fn deep(message: &mut Xcm) -> Result { Ok(match message { Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } => { + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { let mut extra = 0; for effect in effects.iter_mut() { match effect { - Order::BuyExecution { xcm, .. } => { + Order::BuyExecution { xcm, .. } => for message in xcm.iter_mut() { extra.saturating_accrue( Self::shallow(message)?.saturating_add(Self::deep(message)?), ); - } - } - _ => {} + }, + _ => {}, } } extra - } + }, _ => 0, }) } diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 67fe2bfb46fc..d38ffa499248 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -71,7 +71,7 @@ impl ExecuteXcm for XcmExecutor { None => return Outcome::Error(XcmError::Overflow), }; if maximum_weight > weight_limit { - return Outcome::Error(XcmError::WeightLimitReached(maximum_weight)); + return Outcome::Error(XcmError::WeightLimitReached(maximum_weight)) } let mut trader = Config::Trader::new(); let result = Self::do_execute_xcm( @@ -150,7 +150,7 @@ impl XcmExecutor { holding.saturating_subsume_all(withdrawn); } Some((holding, effects)) - } + }, (origin, Xcm::ReserveAssetDeposit { assets, effects }) => { // check whether we trust origin to be our reserve location for this asset. for asset in assets.iter() { @@ -163,7 +163,7 @@ impl XcmExecutor { ); } Some((Assets::from(assets), effects)) - } + }, (origin, Xcm::TransferAsset { assets, dest }) => { // Take `assets` from the origin account (on-chain) and place into dest account. for asset in assets { @@ -171,7 +171,7 @@ impl XcmExecutor { Config::AssetTransactor::teleport_asset(&asset, &origin, &dest)?; } None - } + }, (origin, Xcm::TransferReserveAsset { mut assets, dest, effects }) => { // Take `assets` from the origin account (on-chain) and place into dest account. let inv_dest = Config::LocationInverter::invert_location(&dest); @@ -182,7 +182,7 @@ impl XcmExecutor { } Config::XcmSender::send_xcm(dest, Xcm::ReserveAssetDeposit { assets, effects })?; None - } + }, (origin, Xcm::TeleportAsset { assets, effects }) => { // check whether we trust origin to teleport this asset to us via config trait. for asset in assets.iter() { @@ -202,7 +202,7 @@ impl XcmExecutor { Config::AssetTransactor::check_in(&origin, asset); } Some((Assets::from(assets), effects)) - } + }, (origin, Xcm::Transact { origin_type, require_weight_at_most, mut call }) => { // We assume that the Relay-chain is allowed to use transact on this parachain. @@ -218,7 +218,7 @@ impl XcmExecutor { // Not much to do with the result as it is. It's up to the parachain to ensure that the // message makes sense. error_and_info.post_info.actual_weight - } + }, } .unwrap_or(weight); let surplus = weight.saturating_sub(actual_weight); @@ -233,11 +233,11 @@ impl XcmExecutor { // Return the overestimated amount so we can adjust our expectations on how much this entire // execution has taken. None - } + }, (origin, Xcm::QueryResponse { query_id, response }) => { Config::ResponseHandler::on_response(origin, query_id, response); None - } + }, (origin, Xcm::RelayedFrom { who, message }) => { ensure!(who.is_interior(), XcmError::EscalationOfPrivilege); let mut origin = origin; @@ -246,7 +246,7 @@ impl XcmExecutor { Self::do_execute_xcm(origin, top_level, *message, weight_credit, None, trader)?; total_surplus = total_surplus.saturating_add(surplus); None - } + }, _ => Err(XcmError::UnhandledXcmMessage)?, // Unhandled XCM message. }; @@ -279,7 +279,7 @@ impl XcmExecutor { for asset in deposited.into_assets_iter() { Config::AssetTransactor::deposit_asset(&asset, &dest)?; } - } + }, Order::DepositReserveAsset { assets, dest, effects } => { let deposited = holding.saturating_take(assets); for asset in deposited.assets_iter() { @@ -287,11 +287,11 @@ impl XcmExecutor { } let assets = Self::reanchored(deposited, &dest); Config::XcmSender::send_xcm(dest, Xcm::ReserveAssetDeposit { assets, effects })?; - } + }, Order::InitiateReserveWithdraw { assets, reserve, effects } => { let assets = Self::reanchored(holding.saturating_take(assets), &reserve); Config::XcmSender::send_xcm(reserve, Xcm::WithdrawAsset { assets, effects })?; - } + }, Order::InitiateTeleport { assets, dest, effects } => { // We must do this first in order to resolve wildcards. let assets = holding.saturating_take(assets); @@ -300,14 +300,14 @@ impl XcmExecutor { } let assets = Self::reanchored(assets, &dest); Config::XcmSender::send_xcm(dest, Xcm::TeleportAsset { assets, effects })?; - } + }, Order::QueryHolding { query_id, dest, assets } => { let assets = Self::reanchored(holding.min(assets.iter()), &dest); Config::XcmSender::send_xcm( dest, Xcm::QueryResponse { query_id, response: Response::Assets(assets) }, )?; - } + }, Order::BuyExecution { fees, weight, debt, halt_on_error, xcm } => { // pay for `weight` using up to `fees` of the holding account. let purchasing_weight = @@ -327,15 +327,15 @@ impl XcmExecutor { trader, ) { Err(e) if halt_on_error => return Err(e), - Err(_) => {} + Err(_) => {}, Ok(surplus) => total_surplus += surplus, } } holding.saturating_subsume(trader.refund_weight(remaining_weight)); - } + }, Order::Null => { // nada - } + }, _ => return Err(XcmError::UnhandledEffect)?, } Ok(total_surplus) diff --git a/xcm/xcm-executor/src/traits/transact_asset.rs b/xcm/xcm-executor/src/traits/transact_asset.rs index 3b6c4a0e9d81..be78d2274947 100644 --- a/xcm/xcm-executor/src/traits/transact_asset.rs +++ b/xcm/xcm-executor/src/traits/transact_asset.rs @@ -100,7 +100,7 @@ pub trait TransactAsset { // Not a very forgiving attitude; once we implement roll-backs then it'll be nicer. Self::deposit_asset(asset, to)?; Ok(assets) - } + }, result => result, } } diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index aedfe2f3b839..4ffe0d422dbe 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -100,27 +100,27 @@ where Xcm::RelayedFrom { ref mut message, .. } => { let relay_message_weight = Self::shallow(message.as_mut())?; message.weight().saturating_add(relay_message_weight) - } + }, // These XCM - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } => { + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { let inner: Weight = effects.iter_mut().map(|effect| effect.weight()).sum(); message.weight().saturating_add(inner) - } + }, // The shallow weight of `Transact` is the full weight of the message, thus there is no // deeper weight. Xcm::Transact { call, .. } => { let call_weight = call.ensure_decoded()?.get_dispatch_info().weight; message.weight().saturating_add(call_weight) - } + }, // These - Xcm::QueryResponse { .. } - | Xcm::TransferAsset { .. } - | Xcm::TransferReserveAsset { .. } - | Xcm::HrmpNewChannelOpenRequest { .. } - | Xcm::HrmpChannelAccepted { .. } - | Xcm::HrmpChannelClosing { .. } => message.weight(), + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => message.weight(), }; Ok(weight) @@ -131,34 +131,33 @@ where // `RelayFrom` needs to account for the deep weight of the internal message. Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, // These XCM have internal effects which are not accounted for in the `shallow` weight. - Xcm::WithdrawAsset { effects, .. } - | Xcm::ReserveAssetDeposit { effects, .. } - | Xcm::TeleportAsset { effects, .. } => { + Xcm::WithdrawAsset { effects, .. } | + Xcm::ReserveAssetDeposit { effects, .. } | + Xcm::TeleportAsset { effects, .. } => { let mut extra: Weight = 0; for effect in effects.iter_mut() { match effect { - Order::BuyExecution { xcm, .. } => { + Order::BuyExecution { xcm, .. } => for message in xcm.iter_mut() { extra.saturating_accrue({ let shallow = Self::shallow(message)?; let deep = Self::deep(message)?; shallow.saturating_add(deep) }); - } - } - _ => {} + }, + _ => {}, } } extra - } + }, // These XCM do not have any deeper weight. - Xcm::Transact { .. } - | Xcm::QueryResponse { .. } - | Xcm::TransferAsset { .. } - | Xcm::TransferReserveAsset { .. } - | Xcm::HrmpNewChannelOpenRequest { .. } - | Xcm::HrmpChannelAccepted { .. } - | Xcm::HrmpChannelClosing { .. } => 0, + Xcm::Transact { .. } | + Xcm::QueryResponse { .. } | + Xcm::TransferAsset { .. } | + Xcm::TransferReserveAsset { .. } | + Xcm::HrmpNewChannelOpenRequest { .. } | + Xcm::HrmpChannelAccepted { .. } | + Xcm::HrmpChannelClosing { .. } => 0, }; Ok(weight) From e400bc1a03d31b0040f5b158f2bea9c0dce02966 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 13:45:19 +0200 Subject: [PATCH 26/63] finish fungible? --- runtime/westend/src/xcm_weights/mod.rs | 8 ++---- .../westend/src/xcm_weights/xcm_balances.rs | 2 +- .../src/fungible/benchmarking.rs | 28 ++++++++++++------- .../src/fungibles/benchmarking.rs | 2 +- .../src/xcm_generic/benchmarking.rs | 2 +- xcm/src/v0/mod.rs | 2 +- xcm/src/v0/traits.rs | 2 +- 7 files changed, 25 insertions(+), 21 deletions(-) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index ffd656ed8065..db7237f7297f 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -62,10 +62,6 @@ impl XcmWeightInfo<()> for WestendXcmWeight { ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) } - fn order_exchange_asset(give: &Vec, _receive: &Vec) -> Weight { - // TODO: Probably not right - give.weigh_multi_assets(XcmBalancesWeight::::order_exchange_asset()) - } fn order_initiate_reserve_withdraw( assets: &Vec, _reserve: &MultiLocation, @@ -112,12 +108,12 @@ impl XcmWeightInfo<()> for WestendXcmWeight { fn xcm_transfer_asset(assets: &Vec, _dest: &MultiLocation) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_asset()) } - fn xcm_transfer_reserved_asset( + fn xcm_transfer_reserve_asset( assets: &Vec, _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_reserved_asset()) + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_reserve_asset()) } fn xcm_transact( _origin_type: &OriginKind, diff --git a/runtime/westend/src/xcm_weights/xcm_balances.rs b/runtime/westend/src/xcm_weights/xcm_balances.rs index fc0e221cd774..7eb2a189ef41 100644 --- a/runtime/westend/src/xcm_weights/xcm_balances.rs +++ b/runtime/westend/src/xcm_weights/xcm_balances.rs @@ -29,7 +29,7 @@ impl WeightInfo { pub fn xcm_transfer_asset() -> Weight { 10 } - pub fn xcm_transfer_reserved_asset() -> Weight { + pub fn xcm_transfer_reserve_asset() -> Weight { 10 } } diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index fc6fd7222453..638dbb37516b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -98,6 +98,7 @@ benchmarks_instance_pallet! { // dest should have received some asset. assert!(!T::TransactAsset::balance(&dest_account).is_zero()) } + order_initiate_reserve_withdraw { let origin = MultiLocation::X1(account_id_junction::(1)); let asset = T::get_multi_asset(); @@ -118,6 +119,7 @@ benchmarks_instance_pallet! { } verify { // execute_order succeeding is enough to verify this completed. } + order_initiate_teleport { let (sender_account, origin) = account_and_location::(1); let asset = T::get_multi_asset(); @@ -145,8 +147,6 @@ benchmarks_instance_pallet! { assert!(!T::TransactAsset::balance(&checked_account).is_zero()); } } - order_query_holding {}: {} verify {} - order_buy_execution {}: {} verify {} xcm_withdraw_asset { let origin: MultiLocation = (account_id_junction::(1)).into(); @@ -175,7 +175,6 @@ benchmarks_instance_pallet! { // check one of the assets of origin. assert!(T::TransactAsset::balance(&account::(1)).is_zero()); } - xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_transfer_asset { let origin: MultiLocation = (account_id_junction::(1)).into(); @@ -189,17 +188,26 @@ benchmarks_instance_pallet! { }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { + assert!(T::TransactAsset::balance(&account::(1)).is_zero()); assert!(!T::TransactAsset::balance(&account::(2)).is_zero()); } - xcm_transfer_reserved_asset {}: {} verify {} + xcm_transfer_reserve_asset { + let origin: MultiLocation = (account_id_junction::(1)).into(); + let dest = account_id_junction::(2).into(); - // xcm_query_response {}: {} verify {} - // xcm_transact {}: {} verify {} - // xcm_hrmp_channel_open_request {}: {} verify {} - // xcm_hrmp_channel_accepted {}: {} verify {} - // xcm_hrmp_channel_closing {}: {} verify {} - // xcm_relayed_from {}: {} verify {} + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &origin).unwrap(); + let assets = vec![ asset ]; + assert!(T::TransactAsset::balance(&account::(2)).is_zero()); + let effects = Vec::new(); // No effects to isolate the xcm + let xcm = Xcm::TransferReserveAsset { assets, dest, effects }; + }: { + assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + } verify { + assert!(T::TransactAsset::balance(&account::(1)).is_zero()); + assert!(!T::TransactAsset::balance(&account::(2)).is_zero()); + } } // TODO: this macro cannot be called alone, fix it in substrate. diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index ed9969a621c4..8f000f07a325 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -147,7 +147,7 @@ benchmarks! { assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); } } - xcm_transfer_reserved_asset {}: {} verify {} + xcm_transfer_reserve_asset {}: {} verify {} } impl_benchmark_test_suite!( diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 4021068d2069..1573ee299f1b 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -47,7 +47,7 @@ benchmarks! { xcm_reserve_asset_deposit {}: {} verify {} xcm_teleport_asset {}: {} verify {} xcm_transfer_asset {}: {} verify {} - xcm_transfer_reserved_asset {}: {} verify {} + xcm_transfer_reserve_asset {}: {} verify {} } impl_benchmark_test_suite!( diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index d52050aeab03..db4cbac96f68 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -340,7 +340,7 @@ impl> GetWeight for Xcm<()> { Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), Xcm::TransferAsset { assets, dest } => W::xcm_transfer_asset(assets, dest), Xcm::TransferReserveAsset { assets, dest, effects } => - W::xcm_transfer_reserved_asset(&assets, dest, effects), + W::xcm_transfer_reserve_asset(&assets, dest, effects), Xcm::Transact { origin_type, require_weight_at_most, call } => W::xcm_transact(origin_type, require_weight_at_most, call), Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 0f2d757f5232..b0eb524a217b 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -299,7 +299,7 @@ pub trait XcmWeightInfo { fn xcm_teleport_asset(assets: &Vec, effects: &Vec>) -> Weight; fn xcm_query_response(query_id: &u64, response: &Response) -> Weight; fn xcm_transfer_asset(assets: &Vec, dest: &MultiLocation) -> Weight; - fn xcm_transfer_reserved_asset( + fn xcm_transfer_reserve_asset( assets: &Vec, dest: &MultiLocation, effects: &Vec>, From 6621af3d1abab53ad01e6fd8f1b639ec0870bc63 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 14:58:07 +0200 Subject: [PATCH 27/63] fix westend build --- runtime/westend/src/lib.rs | 2 ++ runtime/westend/src/xcm_weights/mod.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index cd2183e6a3f9..7aa22d026d40 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1519,6 +1519,8 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::fungible::Config for Runtime { type TransactAsset = Balances; + type CheckedAccount = CheckAccount; + fn get_multi_asset() -> MultiAsset { MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 0 } } diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index db7237f7297f..7904c4f3e577 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -62,6 +62,9 @@ impl XcmWeightInfo<()> for WestendXcmWeight { ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) } + fn order_exchange_asset(give: &Vec, receive: &Vec) -> Weight { + Weight::MAX // todo fix + } fn order_initiate_reserve_withdraw( assets: &Vec, _reserve: &MultiLocation, From f20ae754cf9d4914b6fb32dc1696c1dcadd24755 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 17:55:50 +0200 Subject: [PATCH 28/63] benchmark barrier --- Cargo.lock | 3 + runtime/westend/src/lib.rs | 33 ++- runtime/westend/src/xcm_weights/mod.rs | 2 +- xcm/pallet-xcm-benchmarks/Cargo.toml | 5 + .../src/fungible/benchmarking.rs | 45 +-- .../src/fungible/mock.rs | 28 +- .../src/fungible/mock2.rs | 276 ++++++++++++++++++ xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 8 +- .../src/fungibles/mock.rs | 1 + xcm/pallet-xcm-benchmarks/src/lib.rs | 12 +- .../src/xcm_generic/mock.rs | 1 + xcm/xcm-builder/src/barriers.rs | 22 ++ xcm/xcm-builder/src/lib.rs | 4 +- 13 files changed, 393 insertions(+), 47 deletions(-) create mode 100644 xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs diff --git a/Cargo.lock b/Cargo.lock index baee1a45a6a3..4a381b870dc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5487,7 +5487,10 @@ dependencies = [ "log", "pallet-assets", "pallet-balances", + "pallet-xcm", "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", "sp-core", "sp-io", "sp-runtime", diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 7aa22d026d40..da3047c9a2a2 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -51,7 +51,7 @@ use xcm::v0::{ NetworkId, Xcm, }; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + AccountId32Aliases, AllowBenchmarks, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete, LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, @@ -926,6 +926,9 @@ pub type Barrier = ( AllowTopLevelPaidExecutionFrom>, // Messages coming from system parachains need not pay for execution. AllowUnpaidExecutionFrom>, + // The last barrier should allow benchmarks through. + // We want it to be last so that other barriers are touched for a "worst case scenario". + AllowBenchmarks, ); pub struct XcmConfig; @@ -1150,6 +1153,21 @@ impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { } } +impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = XcmConfig; + type AccountIdConverter = LocationConverter; +} + +impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckAccount; + + fn get_multi_asset() -> MultiAsset { + MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 0 } + } +} + #[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { @@ -1512,19 +1530,6 @@ sp_api::impl_runtime_apis! { use xcm::v0::MultiAsset; - impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = XcmConfig; - } - - impl pallet_xcm_benchmarks::fungible::Config for Runtime { - type TransactAsset = Balances; - - type CheckedAccount = CheckAccount; - - fn get_multi_asset() -> MultiAsset { - MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 0 } - } - } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; let whitelist: Vec = vec![ diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index 7904c4f3e577..cff749226066 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -62,7 +62,7 @@ impl XcmWeightInfo<()> for WestendXcmWeight { ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) } - fn order_exchange_asset(give: &Vec, receive: &Vec) -> Weight { + fn order_exchange_asset(_give: &Vec, _receive: &Vec) -> Weight { Weight::MAX // todo fix } fn order_initiate_reserve_withdraw( diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index b4c8db667517..8b95523c1ffa 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -26,6 +26,11 @@ sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.c xcm-builder = { path = "../xcm-builder" } xcm = { path = ".." } log = "0.4.0" +# temp +pallet-xcm = { path = "../pallet-xcm" } +polkadot-runtime-common = { path = "../../runtime/common" } +# westend-runtime = { path = "../../runtime/westend", features = ["runtime-benchmarks"] } +polkadot-primitives = { path = "../../primitives" } [features] default = ["std"] diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 638dbb37516b..64ee997c6df7 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -16,7 +16,7 @@ use super::*; use crate::{ - account, account_and_location, account_id_junction, create_holding, execute_order, execute_xcm, + account_and_location, account_id_junction, create_holding, execute_order, execute_xcm, AssetTransactorOf, OverArchingCallOf, XcmCallOf, }; use codec::Encode; @@ -149,9 +149,9 @@ benchmarks_instance_pallet! { } xcm_withdraw_asset { - let origin: MultiLocation = (account_id_junction::(1)).into(); + let (sender_account, sender_location) = account_and_location::(1); let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &origin).unwrap(); + >::deposit_asset(&asset, &sender_location).unwrap(); // TODO that this is sum-optimal. We should ideally populate the holding account, but we // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log @@ -166,47 +166,47 @@ benchmarks_instance_pallet! { // which reflect the state of the holding after executing the previous two xcms. // check the assets of origin. - assert!(!T::TransactAsset::balance(&account::(1)).is_zero()); + assert!(!T::TransactAsset::balance(&sender_account).is_zero()); // TODO: probably we can and should just use the opaque xcm/order types. let xcm = Xcm::WithdrawAsset::> { assets: vec![asset], effects: vec![] }; }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); } verify { // check one of the assets of origin. - assert!(T::TransactAsset::balance(&account::(1)).is_zero()); + assert!(T::TransactAsset::balance(&sender_account).is_zero()); } xcm_teleport_asset {}: {} verify {} xcm_transfer_asset { - let origin: MultiLocation = (account_id_junction::(1)).into(); - let dest = account_id_junction::(2).into(); + let (sender_account, sender_location) = account_and_location::(1); + let (dest_account, dest_location) = account_and_location::(2); let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &origin).unwrap(); + >::deposit_asset(&asset, &sender_location).unwrap(); let assets = vec![ asset ]; - assert!(T::TransactAsset::balance(&account::(2)).is_zero()); - let xcm = Xcm::TransferAsset { assets, dest }; + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + let xcm = Xcm::TransferAsset { assets, dest: dest_location }; }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); } verify { - assert!(T::TransactAsset::balance(&account::(1)).is_zero()); - assert!(!T::TransactAsset::balance(&account::(2)).is_zero()); + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&dest_account).is_zero()); } xcm_transfer_reserve_asset { - let origin: MultiLocation = (account_id_junction::(1)).into(); - let dest = account_id_junction::(2).into(); + let (sender_account, sender_location) = account_and_location::(1); + let (dest_account, dest_location) = account_and_location::(2); let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &origin).unwrap(); + >::deposit_asset(&asset, &sender_location).unwrap(); let assets = vec![ asset ]; - assert!(T::TransactAsset::balance(&account::(2)).is_zero()); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); let effects = Vec::new(); // No effects to isolate the xcm - let xcm = Xcm::TransferReserveAsset { assets, dest, effects }; + let xcm = Xcm::TransferReserveAsset { assets, dest: dest_location, effects }; }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); } verify { - assert!(T::TransactAsset::balance(&account::(1)).is_zero()); - assert!(!T::TransactAsset::balance(&account::(2)).is_zero()); + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&dest_account).is_zero()); } } @@ -214,5 +214,6 @@ benchmarks_instance_pallet! { impl_benchmark_test_suite!( Pallet, crate::fungible::mock::new_test_ext(), + //westend_runtime::Runtime, crate::fungible::mock::Test ); diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index c9219a3bca7a..2ca5c2932e0e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -17,14 +17,19 @@ //! A mock runtime for xcm benchmarking. use crate::{fungible as xcm_balances_benchmark, mock::*}; -use frame_support::parameter_types; +use frame_support::{parameter_types, traits::All}; +use polkadot_primitives::v1::Id as ParaId; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::opaque::v0::{MultiAsset, MultiLocation}; +use xcm::v0::{Junction, MultiAsset, MultiLocation, NetworkId}; +use xcm_builder::{ + AllowBenchmarks, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + IsChildSystemParachain, TakeWeightCredit, +}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -110,6 +115,10 @@ impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { parameter_types! { pub const CheckedAccount: Option = Some(100); + pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + network: NetworkId::Any, + id: [0u8; 32], + }); } // Use balances as the asset transactor. @@ -121,6 +130,17 @@ pub type AssetTransactor = xcm_builder::CurrencyAdapter< CheckedAccount, >; +/// The barriers one of which must be passed for an XCM message to be executed. +pub type Barrier = ( + // Weight that is paid for may be consumed. + TakeWeightCredit, + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom>, + // Messages coming from system parachains need not pay for execution. + AllowUnpaidExecutionFrom>, + AllowBenchmarks, +); + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -130,7 +150,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = Barrier; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfConcreteFungible; type ResponseHandler = DevNull; @@ -138,11 +158,13 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; + type AccountIdConverter = AccountIdConverter; } impl xcm_balances_benchmark::Config for Test { type TransactAsset = Balances; type CheckedAccount = CheckedAccount; + type ValidDestination = ValidDestination; fn get_multi_asset() -> MultiAsset { let amount = >::minimum_balance() as u128; diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs new file mode 100644 index 000000000000..d01c6a7c426b --- /dev/null +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs @@ -0,0 +1,276 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for xcm benchmarking. + +use crate::{fungible as xcm_balances_benchmark, mock::*, Weight}; +use frame_support::{parameter_types, traits::All}; +use polkadot_runtime_common::xcm_sender; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; + +use xcm::v0::{ + Junction::Parachain, + MultiAsset::{self, AllConcreteFungible}, + MultiLocation::{self, Null, X1}, + NetworkId, Xcm, +}; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, + CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete, + LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, + TakeWeightCredit, UsingComponents, +}; +use xcm_executor::XcmExecutor; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// For testing the pallet, we construct a mock runtime. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + XcmBalancesBenchmark: xcm_balances_benchmark::{Pallet}, + XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, + } +); + +type AccountId = u64; + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); +} +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::AllowAll; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 7; +} + +type Balance = u64; + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); +} + +/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location +/// of this chain. +pub type LocalOriginToLocation = ( + // And a usual Signed origin to be used in XCM as a corresponding AccountId32 + SignedToAccountId32, +); + +impl pallet_xcm::Config for Test { + type Event = Event; + type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; + type XcmRouter = XcmRouter; + // Anyone can execute XCM messages locally... + type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; + // ...but they must match our filter, which requires them to be a simple withdraw + teleport. + type XcmExecuteFilter = OnlyWithdrawTeleportForAccounts; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = All<(MultiLocation, Vec)>; + type XcmReserveTransferFilter = All<(MultiLocation, Vec)>; + type Weigher = FixedWeightBounds; +} + +parameter_types! { + pub const WndLocation: MultiLocation = MultiLocation::Null; + pub const Ancestry: MultiLocation = MultiLocation::Null; + pub WestendNetwork: NetworkId = NetworkId::Named(b"Westend".to_vec()); + pub CheckAccount: AccountId = XcmPallet::check_account(); +} + +pub struct OnlyWithdrawTeleportForAccounts; +impl frame_support::traits::Contains<(MultiLocation, Xcm)> + for OnlyWithdrawTeleportForAccounts +{ + fn contains((ref origin, ref msg): &(MultiLocation, Xcm)) -> bool { + use xcm::v0::{ + Junction::AccountId32, + MultiAsset::{All, ConcreteFungible}, + Order::{BuyExecution, DepositAsset, InitiateTeleport}, + Xcm::WithdrawAsset, + }; + match origin { + // Root is allowed to execute anything. + Null => true, + X1(AccountId32 { .. }) => { + // An account ID trying to send a message. We ensure that it's sensible. + // This checks that it's of the form: + // WithdrawAsset { + // assets: [ ConcreteFungible { id: Null } ], + // effects: [ BuyExecution, InitiateTeleport { + // assets: All, + // dest: Parachain, + // effects: [ BuyExecution, DepositAssets { + // assets: All, + // dest: AccountId32, + // } ] + // } ] + // } + matches!(msg, WithdrawAsset { ref assets, ref effects } + if assets.len() == 1 + && matches!(assets[0], ConcreteFungible { id: Null, .. }) + && effects.len() == 2 + && matches!(effects[0], BuyExecution { .. }) + && matches!(effects[1], InitiateTeleport { ref assets, dest: X1(Parachain(..)), ref effects } + if assets.len() == 1 + && matches!(assets[0], All) + && effects.len() == 2 + && matches!(effects[0], BuyExecution { .. }) + && matches!(effects[1], DepositAsset { ref assets, dest: X1(AccountId32{..}) } + if assets.len() == 1 + && matches!(assets[0], All) + ) + ) + ) + }, + // Nobody else is allowed to execute anything. + _ => false, + } + } +} + +pub type LocationConverter = + (ChildParachainConvertsVia, AccountId32Aliases); + +pub type LocalAssetTransactor = XcmCurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // We can convert the MultiLocations with our converter above: + LocationConverter, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // It's a native asset so we keep track of the teleports to maintain total issuance. + CheckAccount, +>; + +type LocalOriginConverter = ( + SovereignSignedViaLocation, + //ChildParachainAsNative, + SignedAccountId32AsNative, + ChildSystemParachainAsSuperuser, +); + +parameter_types! { + pub const BaseXcmWeight: Weight = 10_000_000; +} + +/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our +/// individual routers. +pub type XcmRouter = ( + // Only one router so far - use DMP to communicate with child parachains. + xcm_sender::ChildParachainRouter, +); + +parameter_types! { + pub const WestendForWestmint: (MultiAsset, MultiLocation) = + (AllConcreteFungible { id: Null }, X1(Parachain(1000))); +} +pub type TrustedTeleporters = (xcm_builder::Case,); + +/// The barriers one of which must be passed for an XCM message to be executed. +pub type Barrier = ( + // Weight that is paid for may be consumed. + TakeWeightCredit, + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom>, + // Messages coming from system parachains need not pay for execution. + AllowUnpaidExecutionFrom>, +); + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = XcmRouter; + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = LocalOriginConverter; + type IsReserve = (); + type IsTeleporter = TrustedTeleporters; + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = + UsingComponents, WndLocation, AccountId, Balances, ToAuthor>; + type ResponseHandler = (); +} + +impl crate::Config for Test { + type XcmConfig = XcmConfig; + type AccountIdConverter = AccountIdConverter; +} + +impl xcm_balances_benchmark::Config for Test { + type TransactAsset = Balances; + type CheckedAccount = CheckedAccount; + fn get_multi_asset() -> MultiAsset { + let amount = + >::minimum_balance() as u128; + MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount } + } +} + +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index d0b0f39e0c00..e5de38845f83 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -3,12 +3,15 @@ pub use pallet::*; pub mod benchmarking; #[cfg(test)] mod mock; +// #[cfg(test)] +// mod mock2; use xcm::v0::MultiAsset; // TODO: make this instanciable. #[frame_support::pallet] pub mod pallet { use frame_support::pallet_prelude::Get; + use xcm::v0::MultiLocation; #[pallet::config] pub trait Config: frame_system::Config + crate::Config { @@ -17,9 +20,12 @@ pub mod pallet { /// This is useful for testing and checking. type TransactAsset: frame_support::traits::fungible::Mutate; - /// temp? + /// Maybe I can get this in some better way? type CheckedAccount: Get>; + /// A valid destination location which can be used in benchmarks. + type ValidDestination: Get; + /// Give me a fungible asset that your asset transactor is going to accept. fn get_multi_asset() -> xcm::v0::MultiAsset; } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 52e7d7b7a4d8..02ccc8b4479e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -173,6 +173,7 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; + type AccountIdConverter = AccountIdConverter; } impl xcm_assets_benchmarks::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index dfe115436f99..29c2743becb1 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -32,7 +32,7 @@ use xcm::v0::{ AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, Order, Outcome, Xcm, }; -use xcm_executor::Assets; +use xcm_executor::{traits::Convert, Assets}; pub mod fungible; pub mod fungibles; @@ -42,12 +42,15 @@ pub mod xcm_generic; mod mock; /// A base trait for all individual pallets -pub trait Config { +pub trait Config: frame_system::Config { /// The XCM configurations. /// /// These might affect the execution of XCM messages, such as defining how the /// `TransactAsset` is implemented. type XcmConfig: xcm_executor::Config; + + // temp? + type AccountIdConverter: Convert; } const SEED: u32 = 0; @@ -106,6 +109,7 @@ pub fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> ExecutorOf::::execute_xcm(origin, xcm, MAX_WEIGHT) } +// TODO probably delete and use converter pub fn account(index: u32) -> T::AccountId { frame_benchmarking::account::("account", index, SEED) } @@ -120,9 +124,9 @@ fn account_id_junction(index: u32) -> Junction { Junction::AccountId32 { network: NetworkId::Any, id } } -pub fn account_and_location(index: u32) -> (T::AccountId, MultiLocation) { - let account = account::(index); +pub fn account_and_location(index: u32) -> (T::AccountId, MultiLocation) { let location = MultiLocation::X1(account_id_junction::(index)); + let account = T::AccountIdConverter::convert(location.clone()).unwrap(); (account, location) } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 124aa557acac..aba02da77543 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -107,6 +107,7 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; + type AccountIdConverter = (); } impl xcm_generic_benchmarks::Config for Test {} diff --git a/xcm/xcm-builder/src/barriers.rs b/xcm/xcm-builder/src/barriers.rs index 17d5b721b3cb..d56be6adff14 100644 --- a/xcm/xcm-builder/src/barriers.rs +++ b/xcm/xcm-builder/src/barriers.rs @@ -106,3 +106,25 @@ impl ShouldExecute for AllowKnownQueryResponses( + _: &MultiLocation, + _: bool, + _: &xcm::v0::Xcm, + _: Weight, + _: &mut Weight, + ) -> Result<(), ()> { + #[cfg(feature = "runtime-benchmarks")] + { + Ok(()) + } + + #[cfg(not(feature = "runtime-benchmarks"))] + { + Err(()) + } + } +} diff --git a/xcm/xcm-builder/src/lib.rs b/xcm/xcm-builder/src/lib.rs index a6cccc2d288a..c82b6eb8cbec 100644 --- a/xcm/xcm-builder/src/lib.rs +++ b/xcm/xcm-builder/src/lib.rs @@ -41,8 +41,8 @@ pub use origin_conversion::{ mod barriers; pub use barriers::{ - AllowKnownQueryResponses, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - IsChildSystemParachain, TakeWeightCredit, + AllowBenchmarks, AllowKnownQueryResponses, AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, IsChildSystemParachain, TakeWeightCredit, }; mod currency_adapter; From e4b8a4cf3017a9e8e35a178b2c79e0583a37632d Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 17:59:59 +0200 Subject: [PATCH 29/63] use `ValidDestination` --- .../src/fungible/benchmarking.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 64ee997c6df7..1efefd491e4b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -27,7 +27,10 @@ use frame_support::{ use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::v0::{Junction, MultiLocation, Order, Xcm}; -use xcm_executor::{traits::TransactAsset, Assets}; +use xcm_executor::{ + traits::{Convert, TransactAsset}, + Assets, +}; // TODO: def. needs to be become a config, might also want to use bounded vec. const MAX_ASSETS: u32 = 25; @@ -59,7 +62,8 @@ benchmarks_instance_pallet! { // .. and the specific asset that we want to take out. holding.saturating_subsume(asset.clone()); // our dest must have no balance initially. - let (dest_account, dest_location) = account_and_location::(77); + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); assert!(T::TransactAsset::balance(&dest_account).is_zero()); let order = Order::>::DepositAsset { @@ -83,7 +87,8 @@ benchmarks_instance_pallet! { // .. and the specific asset that we want to take out. holding.saturating_subsume(asset.clone()); // our dest must have no balance initially. - let (dest_account, dest_location) = account_and_location::(77); + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); assert!(T::TransactAsset::balance(&dest_account).is_zero()); let effects = Vec::new(); // No effects to isolate the order @@ -178,7 +183,8 @@ benchmarks_instance_pallet! { xcm_teleport_asset {}: {} verify {} xcm_transfer_asset { let (sender_account, sender_location) = account_and_location::(1); - let (dest_account, dest_location) = account_and_location::(2); + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); let asset = T::get_multi_asset(); >::deposit_asset(&asset, &sender_location).unwrap(); @@ -194,7 +200,8 @@ benchmarks_instance_pallet! { xcm_transfer_reserve_asset { let (sender_account, sender_location) = account_and_location::(1); - let (dest_account, dest_location) = account_and_location::(2); + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); let asset = T::get_multi_asset(); >::deposit_asset(&asset, &sender_location).unwrap(); From 847932901a4e60d52bf0d17e306fdf5d45216425 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Aug 2021 23:15:16 +0200 Subject: [PATCH 30/63] working on westend --- runtime/westend/src/lib.rs | 36 ++++++++++--------- .../src/fungible/benchmarking.rs | 6 ++-- .../src/fungible/mock.rs | 17 ++++----- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 4 +-- .../src/fungibles/mock.rs | 2 +- xcm/pallet-xcm-benchmarks/src/mock.rs | 4 +-- .../src/xcm_generic/mock.rs | 2 +- 7 files changed, 37 insertions(+), 34 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index da3047c9a2a2..ec31f35eb29d 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -913,8 +913,9 @@ pub type XcmRouter = ( ); parameter_types! { - pub const WestendForWestmint: (MultiAsset, MultiLocation) = - (AllConcreteFungible { id: Null }, X1(Parachain(1000))); + pub const Westend: MultiLocation = X1(Parachain(1000)); + pub const Westmint: MultiAsset = AllConcreteFungible { id: Null }; + pub const WestendForWestmint: (MultiAsset, MultiLocation) = (Westmint::get(), Westend::get()); } pub type TrustedTeleporters = (xcm_builder::Case,); @@ -1153,21 +1154,6 @@ impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { } } -impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = XcmConfig; - type AccountIdConverter = LocationConverter; -} - -impl pallet_xcm_benchmarks::fungible::Config for Runtime { - type TransactAsset = Balances; - - type CheckedAccount = CheckAccount; - - fn get_multi_asset() -> MultiAsset { - MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 0 } - } -} - #[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { @@ -1530,6 +1516,22 @@ sp_api::impl_runtime_apis! { use xcm::v0::MultiAsset; + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = XcmConfig; + type AccountIdConverter = LocationConverter; + } + + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckAccount; + type ValidDestination = Westend; + + fn get_multi_asset() -> MultiAsset { + MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 1 * UNITS } + } + } + type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; let whitelist: Vec = vec![ diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 1efefd491e4b..d0298e67569b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -83,6 +83,7 @@ benchmarks_instance_pallet! { let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. + // TODO: maybe update this api let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. holding.saturating_subsume(asset.clone()); @@ -116,13 +117,14 @@ benchmarks_instance_pallet! { let effects = Vec::new(); // No effects to isolate the order let order = Order::>::DepositReserveAsset { assets: vec![asset.clone()], - dest: MultiLocation::X1(account_id_junction::(77)), // TODO FIX, maybe needs a config trait + dest: T::ValidDestination::get(), effects, }; }: { assert_ok!(execute_order::(origin, holding, order)); } verify { // execute_order succeeding is enough to verify this completed. + // TODO: ideally we query DMP queue } order_initiate_teleport { @@ -137,7 +139,7 @@ benchmarks_instance_pallet! { let effects = Vec::new(); // No effects to isolate the order let order = Order::>::InitiateTeleport { assets: vec![asset.clone()], - dest: MultiLocation::X1(account_id_junction::(77)), // TODO FIX, maybe needs a config trait + dest: T::ValidDestination::get(), effects, }; if let Some(checked_account) = T::CheckedAccount::get() { diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index 2ca5c2932e0e..acbda2f32a7d 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -113,14 +113,6 @@ impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { } } -parameter_types! { - pub const CheckedAccount: Option = Some(100); - pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { - network: NetworkId::Any, - id: [0u8; 32], - }); -} - // Use balances as the asset transactor. pub type AssetTransactor = xcm_builder::CurrencyAdapter< Balances, @@ -161,9 +153,18 @@ impl crate::Config for Test { type AccountIdConverter = AccountIdConverter; } +parameter_types! { + pub const CheckedAccount: Option = Some(100); + pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + network: NetworkId::Any, + id: [0u8; 32], + }); +} + impl xcm_balances_benchmark::Config for Test { type TransactAsset = Balances; type CheckedAccount = CheckedAccount; + type ValidDestination = ValidDestination; fn get_multi_asset() -> MultiAsset { let amount = diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index e5de38845f83..ab7446087f3f 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -5,13 +5,11 @@ pub mod benchmarking; mod mock; // #[cfg(test)] // mod mock2; -use xcm::v0::MultiAsset; - // TODO: make this instanciable. #[frame_support::pallet] pub mod pallet { use frame_support::pallet_prelude::Get; - use xcm::v0::MultiLocation; + use xcm::v0::{MultiAsset, MultiLocation}; #[pallet::config] pub trait Config: frame_system::Config + crate::Config { diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 02ccc8b4479e..453e52c0f942 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -165,7 +165,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); // no one can teleport. type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = YesItShould; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfConcreteFungible; type ResponseHandler = DevNull; diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 19e30a9f7a39..a7a30473842d 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -18,8 +18,8 @@ use crate::*; use frame_support::{parameter_types, weights::Weight}; use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiLocation, Response, Xcm}; -pub struct YesItShould(sp_std::marker::PhantomData); -impl xcm_executor::traits::ShouldExecute for YesItShould { +pub struct YesItShould; +impl xcm_executor::traits::ShouldExecute for YesItShould { fn should_execute( _: &MultiLocation, _: bool, diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index aba02da77543..85c24cc7b4c3 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -99,7 +99,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = YesItShould; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfConcreteFungible; type ResponseHandler = DevNull; From c8819da1a05d5481baf142a6ab76b31ee41d3d23 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 11:57:08 +0200 Subject: [PATCH 31/63] fix xcm v1 --- Cargo.lock | 347 ++++++++++-------- .../src/fungibles/benchmarking.rs | 2 +- .../src/xcm_generic/benchmarking.rs | 2 +- xcm/src/v0/mod.rs | 25 +- xcm/src/v0/traits.rs | 64 ---- xcm/src/v1/mod.rs | 27 +- xcm/src/v1/order.rs | 22 ++ xcm/src/v1/traits.rs | 76 +++- 8 files changed, 319 insertions(+), 246 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd449c18b316..5bb8b1bf511f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1997,7 +1997,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", ] @@ -2015,7 +2015,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -2034,7 +2034,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "Inflector", "chrono", @@ -2060,7 +2060,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -2073,7 +2073,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -2088,7 +2088,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "serde", @@ -2099,7 +2099,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "bitflags", "frame-metadata", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2137,7 +2137,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2149,7 +2149,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro2", "quote", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-metadata", "frame-support", @@ -2180,7 +2180,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -2190,7 +2190,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -2207,7 +2207,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -2221,7 +2221,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-api", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "parity-scale-codec", @@ -4701,10 +4701,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -4719,7 +4732,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -4733,7 +4746,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4756,7 +4769,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4811,7 +4824,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4889,7 +4902,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4905,7 +4918,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4920,7 +4933,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4941,7 +4954,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4958,7 +4971,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4972,7 +4985,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4994,7 +5007,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5009,7 +5022,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,7 +5041,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5044,7 +5057,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5059,7 +5072,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5076,7 +5089,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5092,7 +5105,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5110,7 +5123,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5125,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5138,7 +5151,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5154,7 +5167,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5176,7 +5189,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5191,7 +5204,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "enumflags2", "frame-support", @@ -5205,7 +5218,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5220,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5240,7 +5253,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5256,7 +5269,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5269,7 +5282,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5293,7 +5306,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5304,7 +5317,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "sp-arithmetic", @@ -5313,7 +5326,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5326,7 +5339,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5344,7 +5357,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5359,7 +5372,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-support", "frame-system", @@ -5375,7 +5388,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5392,7 +5405,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5403,7 +5416,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5419,7 +5432,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-benchmarking", "frame-support", @@ -5434,7 +5447,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5466,6 +5479,30 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.2.4" @@ -7932,7 +7969,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "env_logger 0.8.4", "hex", @@ -8231,7 +8268,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "sp-core", @@ -8242,7 +8279,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "derive_more", @@ -8271,7 +8308,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8294,7 +8331,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8310,7 +8347,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8326,7 +8363,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8337,7 +8374,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "chrono", "fdlimit", @@ -8375,7 +8412,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "fnv", @@ -8409,7 +8446,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "blake2-rfc", "hash-db", @@ -8438,7 +8475,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "futures 0.3.16", @@ -8463,7 +8500,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "derive_more", @@ -8510,7 +8547,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "futures 0.3.16", @@ -8534,7 +8571,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8547,7 +8584,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "assert_matches", "async-trait", @@ -8583,7 +8620,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "futures 0.3.16", @@ -8612,7 +8649,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "sc-client-api", "sp-authorship", @@ -8623,7 +8660,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "lazy_static", @@ -8652,7 +8689,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "parity-scale-codec", @@ -8669,7 +8706,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "parity-scale-codec", @@ -8684,7 +8721,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8704,7 +8741,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "derive_more", @@ -8745,7 +8782,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "finality-grandpa", @@ -8769,7 +8806,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "ansi_term 0.12.1", "futures 0.3.16", @@ -8787,7 +8824,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "derive_more", @@ -8807,7 +8844,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "hash-db", "lazy_static", @@ -8826,7 +8863,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-std", "async-trait", @@ -8881,7 +8918,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8898,7 +8935,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "bytes 0.5.6", "fnv", @@ -8926,7 +8963,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "libp2p", @@ -8939,7 +8976,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8948,7 +8985,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "hash-db", @@ -8983,7 +9020,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "futures 0.3.16", @@ -9008,7 +9045,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -9026,7 +9063,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "directories", @@ -9094,7 +9131,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "parity-scale-codec", @@ -9109,7 +9146,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9131,7 +9168,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "chrono", "futures 0.3.16", @@ -9151,7 +9188,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "ansi_term 0.12.1", "atty", @@ -9188,7 +9225,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9199,7 +9236,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "futures 0.3.16", @@ -9228,7 +9265,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "derive_more", "futures 0.3.16", @@ -9695,7 +9732,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "hash-db", "log", @@ -9712,7 +9749,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9724,7 +9761,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "serde", @@ -9736,7 +9773,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "integer-sqrt", "num-traits", @@ -9750,7 +9787,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-api", @@ -9762,7 +9799,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "parity-scale-codec", @@ -9774,7 +9811,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-api", @@ -9786,7 +9823,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "log", @@ -9804,7 +9841,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "futures 0.3.16", @@ -9830,7 +9867,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "merlin", @@ -9852,7 +9889,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9862,7 +9899,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9874,7 +9911,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "base58", "blake2-rfc", @@ -9918,7 +9955,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9927,7 +9964,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro2", "quote", @@ -9937,7 +9974,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "environmental", "parity-scale-codec", @@ -9948,7 +9985,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "finality-grandpa", "log", @@ -9965,7 +10002,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9979,7 +10016,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "hash-db", @@ -10004,7 +10041,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "lazy_static", "sp-core", @@ -10015,7 +10052,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "derive_more", @@ -10032,7 +10069,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "ruzstd", "zstd", @@ -10041,7 +10078,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "serde", @@ -10054,7 +10091,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -10065,7 +10102,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "sp-api", "sp-core", @@ -10075,7 +10112,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "backtrace", ] @@ -10083,7 +10120,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "rustc-hash", "serde", @@ -10094,7 +10131,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "either", "hash256-std-hasher", @@ -10115,7 +10152,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10132,7 +10169,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -10144,7 +10181,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "serde", "serde_json", @@ -10153,7 +10190,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-api", @@ -10166,7 +10203,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -10176,7 +10213,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "hash-db", "log", @@ -10199,12 +10236,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10217,7 +10254,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "log", "sp-core", @@ -10230,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -10247,7 +10284,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "erased-serde", "log", @@ -10265,7 +10302,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "sp-api", "sp-runtime", @@ -10274,7 +10311,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "log", @@ -10289,7 +10326,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "hash-db", "memory-db", @@ -10303,7 +10340,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "futures-core", @@ -10315,7 +10352,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10330,7 +10367,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "parity-scale-codec", "proc-macro-crate 1.0.0", @@ -10342,7 +10379,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10527,7 +10564,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "chrono", "console_error_panic_hook", @@ -10553,7 +10590,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "platforms", ] @@ -10561,7 +10598,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.16", @@ -10584,7 +10621,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-std", "derive_more", @@ -10598,7 +10635,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "async-trait", "futures 0.1.29", @@ -10627,7 +10664,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "futures 0.3.16", "substrate-test-utils-derive", @@ -10637,7 +10674,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10647,7 +10684,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "ansi_term 0.12.1", "atty", @@ -10809,7 +10846,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-system", "futures 0.3.16", @@ -11449,7 +11486,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4d93a6ee4b78c4d9b01901b2100582a672c2aadb" +source = "git+https://github.com/paritytech/substrate?branch=master#423a46fb318961c5def77128f2a5e110fa15f3a3" dependencies = [ "frame-try-runtime", "log", @@ -12133,6 +12170,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -12291,6 +12329,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain", diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 8f000f07a325..1d327d30d1a3 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -58,7 +58,7 @@ benchmarks! { send_xcm {}: {} // orders. - order_null { + order_noop { let order = Order::>::Null; let origin = MultiLocation::X1(account_id_junction::(1)); let holding = Assets::default(); diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 1573ee299f1b..934e48504b32 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -36,7 +36,7 @@ const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks! { send_xcm {}: {} - order_null { + order_noop { let order = Order::>::Null; let origin = MultiLocation::X1(account_id_junction::(1)); let holding = Assets::default(); diff --git a/xcm/src/v0/mod.rs b/xcm/src/v0/mod.rs index 86076f1590bc..2329338f0a07 100644 --- a/xcm/src/v0/mod.rs +++ b/xcm/src/v0/mod.rs @@ -33,7 +33,7 @@ use super::v1::Xcm as Xcm1; pub use multi_asset::{AssetInstance, MultiAsset}; pub use multi_location::MultiLocation; pub use order::Order; -pub use traits::{Error, ExecuteXcm, GetWeight, Outcome, Result, SendXcm, Weight, XcmWeightInfo}; +pub use traits::{Error, ExecuteXcm, Outcome, Result, SendXcm}; /// A prelude for importing all types typically used when interacting with XCM messages. pub mod prelude { @@ -287,29 +287,6 @@ impl Xcm { } } -impl> GetWeight for Xcm<()> { - fn weight(&self) -> Weight { - match self { - Xcm::WithdrawAsset { assets, effects } => W::xcm_withdraw_asset(assets, effects), - Xcm::ReserveAssetDeposit { assets, effects } => - W::xcm_reserve_asset_deposit(assets, effects), - Xcm::TeleportAsset { assets, effects } => W::xcm_teleport_asset(assets, effects), - Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), - Xcm::TransferAsset { assets, dest } => W::xcm_transfer_asset(assets, dest), - Xcm::TransferReserveAsset { assets, dest, effects } => - W::xcm_transfer_reserve_asset(&assets, dest, effects), - Xcm::Transact { origin_type, require_weight_at_most, call } => - W::xcm_transact(origin_type, require_weight_at_most, call), - Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => - W::xcm_hrmp_channel_open_request(sender, max_message_size, max_capacity), - Xcm::HrmpChannelAccepted { recipient } => W::xcm_hrmp_channel_accepted(recipient), - Xcm::HrmpChannelClosing { initiator, sender, recipient } => - W::xcm_hrmp_channel_closing(initiator, sender, recipient), - Xcm::RelayedFrom { who, message } => W::xcm_relayed_from(who, message), - } - } -} - pub mod opaque { /// The basic concrete type of `generic::Xcm`, which doesn't make any assumptions about the format of a /// call other than it is pre-encoded. diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index b0eb524a217b..90f149a1f6e1 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -260,67 +260,3 @@ impl SendXcm for Tuple { Err(Error::CannotReachDestination(destination, message)) } } - -// The info needed to weight an XCM. -pub trait XcmWeightInfo { - fn send_xcm() -> Weight; - fn order_null() -> Weight; - fn order_deposit_asset(assets: &Vec, dest: &MultiLocation) -> Weight; - fn order_deposit_reserved_asset( - assets: &Vec, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_exchange_asset(give: &Vec, receive: &Vec) -> Weight; - fn order_initiate_reserve_withdraw( - assets: &Vec, - reserve: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_initiate_teleport( - assets: &Vec, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_query_holding( - query_id: &u64, - dest: &MultiLocation, - assets: &Vec, - ) -> Weight; - fn order_buy_execution( - fees: &MultiAsset, - weight: &u64, - debt: &u64, - halt_on_error: &bool, - xcm: &Vec>, - ) -> Weight; - fn xcm_withdraw_asset(assets: &Vec, effects: &Vec>) -> Weight; - fn xcm_reserve_asset_deposit(assets: &Vec, effects: &Vec>) -> Weight; - fn xcm_teleport_asset(assets: &Vec, effects: &Vec>) -> Weight; - fn xcm_query_response(query_id: &u64, response: &Response) -> Weight; - fn xcm_transfer_asset(assets: &Vec, dest: &MultiLocation) -> Weight; - fn xcm_transfer_reserve_asset( - assets: &Vec, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - // TODO: &Maybe remove call - fn xcm_transact( - origin_type: &OriginKind, - require_weight_at_most: &u64, - call: &DoubleEncoded, - ) -> Weight; - fn xcm_hrmp_channel_open_request( - sender: &u32, - max_message_size: &u32, - max_capacity: &u32, - ) -> Weight; - fn xcm_hrmp_channel_accepted(recipient: &u32) -> Weight; - fn xcm_hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; - fn xcm_relayed_from(who: &MultiLocation, message: &alloc::boxed::Box>) -> Weight; -} - -// A simple trait to get the weight of some object. -pub trait GetWeight { - fn weight(&self) -> Weight; -} diff --git a/xcm/src/v1/mod.rs b/xcm/src/v1/mod.rs index 6b7b4d4f2aea..883746ccaa2a 100644 --- a/xcm/src/v1/mod.rs +++ b/xcm/src/v1/mod.rs @@ -40,7 +40,7 @@ pub use multiasset::{ }; pub use multilocation::MultiLocation; pub use order::Order; -pub use traits::{Error, ExecuteXcm, Outcome, Result, SendXcm}; +pub use traits::{Error, ExecuteXcm, GetWeight, Outcome, Result, SendXcm, Weight, XcmWeightInfo}; /// A prelude for importing all types typically used when interacting with XCM messages. pub mod prelude { @@ -390,3 +390,28 @@ impl TryFrom> for Xcm { }) } } + +impl> GetWeight for Xcm<()> { + fn weight(&self) -> Weight { + match self { + Xcm::WithdrawAsset { assets, effects } => W::xcm_withdraw_asset(assets, effects), + Xcm::ReserveAssetDeposited { assets, effects } => + W::xcm_reserve_asset_deposited(assets, effects), + Xcm::ReceiveTeleportedAsset { assets, effects } => + W::xcm_receive_teleported_asset(assets, effects), + Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), + Xcm::TransferAsset { assets, beneficiary } => + W::xcm_transfer_asset(assets, beneficiary), + Xcm::TransferReserveAsset { assets, dest, effects } => + W::xcm_transfer_reserve_asset(&assets, dest, effects), + Xcm::Transact { origin_type, require_weight_at_most, call } => + W::xcm_transact(origin_type, require_weight_at_most, call), + Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + W::xcm_hrmp_new_channel_open_request(sender, max_message_size, max_capacity), + Xcm::HrmpChannelAccepted { recipient } => W::xcm_hrmp_channel_accepted(recipient), + Xcm::HrmpChannelClosing { initiator, sender, recipient } => + W::xcm_hrmp_channel_closing(initiator, sender, recipient), + Xcm::RelayedFrom { who, message } => W::xcm_relayed_from(who, message), + } + } +} diff --git a/xcm/src/v1/order.rs b/xcm/src/v1/order.rs index 06363c39ce83..f3f2e4eb6225 100644 --- a/xcm/src/v1/order.rs +++ b/xcm/src/v1/order.rs @@ -19,6 +19,7 @@ use super::{ super::v0::Order as Order0, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Xcm, }; +use crate::latest::{GetWeight, Weight, XcmWeightInfo}; use alloc::{vec, vec::Vec}; use core::{ convert::{TryFrom, TryInto}, @@ -241,3 +242,24 @@ impl TryFrom> for Order { }) } } + +impl> GetWeight for Order<()> { + fn weight(&self) -> Weight { + match self { + Order::Noop => W::order_noop(), + Order::DepositAsset { assets, max_assets, beneficiary } => + W::order_deposit_asset(assets, max_assets, beneficiary), + Order::DepositReserveAsset { assets, max_assets, dest, effects } => + W::order_deposit_reserved_asset(assets, max_assets, dest, effects), + Order::ExchangeAsset { give, receive } => W::order_exchange_asset(give, receive), + Order::InitiateReserveWithdraw { assets, reserve, effects } => + W::order_initiate_reserve_withdraw(assets, reserve, effects), + Order::InitiateTeleport { assets, dest, effects } => + W::order_initiate_teleport(assets, dest, effects), + Order::QueryHolding { query_id, dest, assets } => + W::order_query_holding(query_id, dest, assets), + Order::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => + W::order_buy_execution(fees, weight, debt, halt_on_error, orders, instructions), + } + } +} diff --git a/xcm/src/v1/traits.rs b/xcm/src/v1/traits.rs index 94fd4449f21d..1e2bb98a66c2 100644 --- a/xcm/src/v1/traits.rs +++ b/xcm/src/v1/traits.rs @@ -16,10 +16,14 @@ //! Cross-Consensus Message format data structures. +use alloc::vec::Vec; use core::result; use parity_scale_codec::{Decode, Encode}; -use super::{MultiLocation, Xcm}; +use super::{ + DoubleEncoded, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, OriginKind, + Response, Xcm, +}; #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug)] pub enum Error { @@ -261,3 +265,73 @@ impl SendXcm for Tuple { Err(Error::CannotReachDestination(destination, message)) } } + +// A simple trait to get the weight of some object. +pub trait GetWeight { + fn weight(&self) -> Weight; +} + +// TODO: Macro to generate this +// The info needed to weight an XCM. +pub trait XcmWeightInfo { + fn order_noop() -> Weight; + fn order_deposit_asset( + assets: &MultiAssetFilter, + max_assets: &u32, + dest: &MultiLocation, + ) -> Weight; + fn order_deposit_reserved_asset( + assets: &MultiAssetFilter, + max_assets: &u32, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_exchange_asset(give: &MultiAssetFilter, receive: &MultiAssets) -> Weight; + fn order_initiate_reserve_withdraw( + assets: &MultiAssetFilter, + reserve: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_initiate_teleport( + assets: &MultiAssetFilter, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + fn order_query_holding( + query_id: &u64, + dest: &MultiLocation, + assets: &MultiAssetFilter, + ) -> Weight; + fn order_buy_execution( + fees: &MultiAsset, + weight: &u64, + debt: &u64, + halt_on_error: &bool, + orders: &Vec>, + instructions: &Vec>, + ) -> Weight; + fn xcm_withdraw_asset(assets: &MultiAssets, effects: &Vec>) -> Weight; + fn xcm_reserve_asset_deposited(assets: &MultiAssets, effects: &Vec>) -> Weight; + fn xcm_receive_teleported_asset(assets: &MultiAssets, effects: &Vec>) -> Weight; + fn xcm_query_response(query_id: &u64, response: &Response) -> Weight; + fn xcm_transfer_asset(assets: &MultiAssets, beneficiary: &MultiLocation) -> Weight; + fn xcm_transfer_reserve_asset( + assets: &MultiAssets, + dest: &MultiLocation, + effects: &Vec>, + ) -> Weight; + // TODO: &Maybe remove call + fn xcm_transact( + origin_type: &OriginKind, + require_weight_at_most: &u64, + call: &DoubleEncoded, + ) -> Weight; + fn xcm_hrmp_new_channel_open_request( + sender: &u32, + max_message_size: &u32, + max_capacity: &u32, + ) -> Weight; + fn xcm_hrmp_channel_accepted(recipient: &u32) -> Weight; + fn xcm_hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; + fn xcm_relayed_from(who: &MultiLocation, message: &alloc::boxed::Box>) -> Weight; +} From b56df818a3d04c2d64c8c60f2c5643f59a4e0f9c Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 12:19:04 +0200 Subject: [PATCH 32/63] fix xcm-executor --- xcm/src/v0/traits.rs | 3 +- xcm/xcm-executor/src/lib.rs | 2 +- xcm/xcm-executor/src/traits/weight.rs | 73 ++++++++++++++++++++------- 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/xcm/src/v0/traits.rs b/xcm/src/v0/traits.rs index 90f149a1f6e1..e1673fd5d990 100644 --- a/xcm/src/v0/traits.rs +++ b/xcm/src/v0/traits.rs @@ -16,11 +16,10 @@ //! Cross-Consensus Message format data structures. -use alloc::vec::Vec; use core::result; use parity_scale_codec::{Decode, Encode}; -use super::{DoubleEncoded, MultiAsset, MultiLocation, Order, OriginKind, Response, Xcm}; +use super::{MultiLocation, Xcm}; #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug)] pub enum Error { diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index d954ee3e8b2c..887af359da08 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -338,7 +338,7 @@ impl XcmExecutor { holding.subsume(w); } }, - Order::Null => { + Order::Noop => { // nada }, _ => return Err(XcmError::UnhandledEffect)?, diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index 755fb414fc06..b300c7106622 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -19,7 +19,7 @@ use frame_support::{dispatch::GetDispatchInfo, weights::Weight}; use parity_scale_codec::Decode; use sp_runtime::traits::Saturating; use sp_std::result::Result; -use xcm::latest::{Error, MultiAsset, MultiLocation, Xcm}; +use xcm::latest::{Error, GetWeight, MultiAsset, MultiLocation, Order, Xcm, XcmWeightInfo}; /// Determine the weight of an XCM message. pub trait WeightBounds { @@ -103,10 +103,14 @@ where }, // These XCM Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposit { effects, .. } | - Xcm::TeleportAsset { effects, .. } => { - let inner: Weight = effects.iter_mut().map(|effect| effect.weight()).sum(); - message.weight().saturating_add(inner) + Xcm::ReserveAssetDeposited { effects, .. } | + Xcm::ReceiveTeleportedAsset { effects, .. } => { + let mut extra = 0; + for order in effects.iter_mut() { + extra.saturating_accrue(Self::shallow_order(order)?); + } + extra.saturating_accrue(message.weight()); + extra }, // The shallow weight of `Transact` is the full weight of the message, thus there is no // deeper weight. @@ -132,21 +136,11 @@ where Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, // These XCM have internal effects which are not accounted for in the `shallow` weight. Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposit { effects, .. } | - Xcm::TeleportAsset { effects, .. } => { + Xcm::ReserveAssetDeposited { effects, .. } | + Xcm::ReceiveTeleportedAsset { effects, .. } => { let mut extra: Weight = 0; - for effect in effects.iter_mut() { - match effect { - Order::BuyExecution { xcm, .. } => - for message in xcm.iter_mut() { - extra.saturating_accrue({ - let shallow = Self::shallow(message)?; - let deep = Self::deep(message)?; - shallow.saturating_add(deep) - }); - }, - _ => {}, - } + for order in effects.iter_mut() { + extra.saturating_accrue(Self::deep_order(order)?); } extra }, @@ -163,3 +157,44 @@ where Ok(weight) } } + +impl FinalXcmWeight +where + W: XcmWeightInfo, + C: Decode + GetDispatchInfo, + Xcm: GetWeight, + Order: GetWeight, +{ + fn shallow_order(order: &mut Order) -> Result { + Ok(match order { + Order::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => { + // On success, execution of this will result in more weight being consumed but + // we don't count it here since this is only the *shallow*, non-negotiable weight + // spend and doesn't count weight placed behind a `BuyExecution` since it will not + // be definitely consumed from any existing weight credit if execution of the message + // is attempted. + W::order_buy_execution(fees, weight, debt, halt_on_error, orders, instructions) + }, + _ => 0, // TODO check + }) + } + fn deep_order(order: &mut Order) -> Result { + Ok(match order { + Order::BuyExecution { orders, instructions, .. } => { + let mut extra = 0; + for instruction in instructions.iter_mut() { + extra.saturating_accrue( + Self::shallow(instruction)?.saturating_add(Self::deep(instruction)?), + ); + } + for order in orders.iter_mut() { + extra.saturating_accrue( + Self::shallow_order(order)?.saturating_add(Self::deep_order(order)?), + ); + } + extra + }, + _ => 0, + }) + } +} From 9c33a40455438eeacdbb0e3201d1be3726930fcd Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 12:19:27 +0200 Subject: [PATCH 33/63] fix xcm-builder --- xcm/xcm-builder/src/barriers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcm/xcm-builder/src/barriers.rs b/xcm/xcm-builder/src/barriers.rs index c6175ab677d2..97c2d052e75a 100644 --- a/xcm/xcm-builder/src/barriers.rs +++ b/xcm/xcm-builder/src/barriers.rs @@ -113,7 +113,7 @@ impl ShouldExecute for AllowBenchmarks { fn should_execute( _: &MultiLocation, _: bool, - _: &xcm::v0::Xcm, + _: &xcm::latest::Xcm, _: Weight, _: &mut Weight, ) -> Result<(), ()> { From 4fddeae900f7768aed0030b4620503f837a18642 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 12:40:39 +0200 Subject: [PATCH 34/63] make benchmarks compile --- .../src/fungible/benchmarking.rs | 47 ++++++++++--------- .../src/fungible/mock.rs | 2 +- .../src/fungible/mock2.rs | 4 +- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 4 +- .../src/fungibles/benchmarking.rs | 27 ++++++----- .../src/fungibles/mock.rs | 4 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 25 ++++++---- xcm/pallet-xcm-benchmarks/src/mock.rs | 6 +-- .../src/xcm_generic/benchmarking.rs | 6 +-- .../src/xcm_generic/mock.rs | 4 +- xcm/xcm-executor/src/lib.rs | 6 +-- 11 files changed, 72 insertions(+), 63 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index d0298e67569b..04af624e74d6 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -26,7 +26,7 @@ use frame_support::{ }; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::v0::{Junction, MultiLocation, Order, Xcm}; +use xcm::latest::{Junction, MultiAssets, MultiLocation, Order, Xcm}; use xcm_executor::{ traits::{Convert, TransactAsset}, Assets, @@ -60,21 +60,22 @@ benchmarks_instance_pallet! { // generate the holding with a bunch of stuff.. let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset.clone()); + holding.subsume(asset.clone()); // our dest must have no balance initially. - let dest_location = T::ValidDestination::get(); - let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); - assert!(T::TransactAsset::balance(&dest_account).is_zero()); + let ben_location = T::ValidDestination::get(); + let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); + assert!(T::TransactAsset::balance(&ben_account).is_zero()); let order = Order::>::DepositAsset { - assets: vec![asset.clone()], - dest: dest_location, + assets: asset.into(), + max_assets: 1, + beneficiary: ben_location, }; }: { assert_ok!(execute_order::(origin, holding, order)); } verify { // dest should have received some asset. - assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + assert!(!T::TransactAsset::balance(&ben_account).is_zero()) } order_deposit_reserve_asset { @@ -86,7 +87,7 @@ benchmarks_instance_pallet! { // TODO: maybe update this api let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset.clone()); + holding.subsume(asset.clone()); // our dest must have no balance initially. let dest_location = T::ValidDestination::get(); let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); @@ -94,7 +95,8 @@ benchmarks_instance_pallet! { let effects = Vec::new(); // No effects to isolate the order let order = Order::>::DepositReserveAsset { - assets: vec![asset.clone()], + assets: asset.into(), + max_assets: 1, dest: dest_location, effects, }; @@ -112,11 +114,12 @@ benchmarks_instance_pallet! { // generate the holding with a bunch of stuff.. let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset.clone()); + holding.subsume(asset.clone()); let effects = Vec::new(); // No effects to isolate the order let order = Order::>::DepositReserveAsset { - assets: vec![asset.clone()], + assets: asset.into(), + max_assets: 1, dest: T::ValidDestination::get(), effects, }; @@ -134,11 +137,11 @@ benchmarks_instance_pallet! { // generate the holding with a bunch of stuff.. let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); // .. and the specific asset that we want to take out. - holding.saturating_subsume(asset.clone()); + holding.subsume(asset.clone()); let effects = Vec::new(); // No effects to isolate the order let order = Order::>::InitiateTeleport { - assets: vec![asset.clone()], + assets: asset.into(), dest: T::ValidDestination::get(), effects, }; @@ -175,7 +178,7 @@ benchmarks_instance_pallet! { // check the assets of origin. assert!(!T::TransactAsset::balance(&sender_account).is_zero()); // TODO: probably we can and should just use the opaque xcm/order types. - let xcm = Xcm::WithdrawAsset::> { assets: vec![asset], effects: vec![] }; + let xcm = Xcm::WithdrawAsset::> { assets: vec![asset].into(), effects: vec![] }; }: { assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); } verify { @@ -185,19 +188,19 @@ benchmarks_instance_pallet! { xcm_teleport_asset {}: {} verify {} xcm_transfer_asset { let (sender_account, sender_location) = account_and_location::(1); - let dest_location = T::ValidDestination::get(); - let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); + let ben_location = T::ValidDestination::get(); + let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); let asset = T::get_multi_asset(); >::deposit_asset(&asset, &sender_location).unwrap(); - let assets = vec![ asset ]; - assert!(T::TransactAsset::balance(&dest_account).is_zero()); - let xcm = Xcm::TransferAsset { assets, dest: dest_location }; + let assets: MultiAssets = vec![ asset ].into(); + assert!(T::TransactAsset::balance(&ben_account).is_zero()); + let xcm = Xcm::TransferAsset { assets, beneficiary: ben_location }; }: { assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); } verify { assert!(T::TransactAsset::balance(&sender_account).is_zero()); - assert!(!T::TransactAsset::balance(&dest_account).is_zero()); + assert!(!T::TransactAsset::balance(&ben_account).is_zero()); } xcm_transfer_reserve_asset { @@ -207,7 +210,7 @@ benchmarks_instance_pallet! { let asset = T::get_multi_asset(); >::deposit_asset(&asset, &sender_location).unwrap(); - let assets = vec![ asset ]; + let assets: MultiAssets = vec![ asset ].into(); assert!(T::TransactAsset::balance(&dest_account).is_zero()); let effects = Vec::new(); // No effects to isolate the xcm let xcm = Xcm::TransferReserveAsset { assets, dest: dest_location, effects }; diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index acbda2f32a7d..c83aee5df49e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -25,7 +25,7 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::v0::{Junction, MultiAsset, MultiLocation, NetworkId}; +use xcm::latest::{Junction, MultiAsset, MultiLocation, NetworkId}; use xcm_builder::{ AllowBenchmarks, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, IsChildSystemParachain, TakeWeightCredit, diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs index d01c6a7c426b..1b8ea2313ebb 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs @@ -26,7 +26,7 @@ use sp_runtime::{ BuildStorage, }; -use xcm::v0::{ +use xcm::latest::{ Junction::Parachain, MultiAsset::{self, AllConcreteFungible}, MultiLocation::{self, Null, X1}, @@ -142,7 +142,7 @@ impl frame_support::traits::Contains<(MultiLocation, Xcm)> for OnlyWithdrawTeleportForAccounts { fn contains((ref origin, ref msg): &(MultiLocation, Xcm)) -> bool { - use xcm::v0::{ + use xcm::latest::{ Junction::AccountId32, MultiAsset::{All, ConcreteFungible}, Order::{BuyExecution, DepositAsset, InitiateTeleport}, diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index ab7446087f3f..d59fd6e2ec4b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -9,7 +9,7 @@ mod mock; #[frame_support::pallet] pub mod pallet { use frame_support::pallet_prelude::Get; - use xcm::v0::{MultiAsset, MultiLocation}; + use xcm::latest::{MultiAsset, MultiLocation}; #[pallet::config] pub trait Config: frame_system::Config + crate::Config { @@ -25,7 +25,7 @@ pub mod pallet { type ValidDestination: Get; /// Give me a fungible asset that your asset transactor is going to accept. - fn get_multi_asset() -> xcm::v0::MultiAsset; + fn get_multi_asset() -> xcm::latest::MultiAsset; } #[pallet::pallet] diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 1d327d30d1a3..c27e0e95ffe9 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -28,9 +28,9 @@ use frame_support::{ }; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, - v0::{Error as XcmError, Order, Outcome, Xcm}, +use xcm::latest::{ + AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiAssets, MultiLocation, + NetworkId, Order, Outcome, Xcm, }; use xcm_executor::{traits::TransactAsset, Assets}; @@ -59,7 +59,7 @@ benchmarks! { // orders. order_noop { - let order = Order::>::Null; + let order = Order::>::Noop; let origin = MultiLocation::X1(account_id_junction::(1)); let holding = Assets::default(); }: { @@ -73,13 +73,14 @@ benchmarks! { let asset = T::get_multi_asset(asset_id); let order = Order::>::DepositAsset { - assets: vec![ asset.clone() ], - dest: MultiLocation::X1(account_id_junction::(2)), + assets: asset.clone().into(), + max_assets: 1, + beneficiary: MultiLocation::X1(account_id_junction::(2)), }; let amount: u128 = T::TransactAsset::minimum_balance(asset_id.into()).try_into().unwrap(); let mut holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); - holding.saturating_subsume(asset); + holding.subsume(asset); assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); }: { assert_ok!(execute_order::(origin, holding, order)); @@ -99,13 +100,13 @@ benchmarks! { let a in 1..MAX_ASSETS+1; let origin: MultiLocation = (account_id_junction::(1)).into(); - let assets = (1..=a).map(|i| { + let assets: MultiAssets = (1..=a).map(|i| { let asset = T::get_multi_asset(i); // give all of these assets to the origin. >::deposit_asset(&asset, &origin).unwrap(); asset }) - .collect::>(); + .collect::>().into(); // check just one of the asset ids, namely 1. assert!(!T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); let xcm = Xcm::WithdrawAsset::> { assets, effects: vec![] }; @@ -121,9 +122,9 @@ benchmarks! { let a in 1..MAX_ASSETS+1; let origin: MultiLocation = (account_id_junction::(1)).into(); - let dest = (account_id_junction::(2)).into(); + let beneficiary = (account_id_junction::(2)).into(); - let assets = (1..a).map(|asset_id| { + let assets: MultiAssets = (1..a).map(|asset_id| { let asset = T::get_multi_asset(asset_id); // Note that we deposit a new asset with twice the amount into the sender to prevent it // being dying. @@ -137,9 +138,9 @@ benchmarks! { // return asset asset }) - .collect::>(); + .collect::>().into(); - let xcm = Xcm::TransferAsset { assets, dest }; + let xcm = Xcm::TransferAsset { assets, beneficiary }; }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 453e52c0f942..832675317df9 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -28,8 +28,8 @@ use sp_runtime::{ BuildStorage, }; use xcm::{ - opaque::v0::{MultiAsset, MultiLocation}, - v0::Junction, + latest::Junction, + opaque::latest::{MultiAsset, MultiLocation}, }; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 29c2743becb1..38a96b949bd5 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -28,9 +28,14 @@ use frame_support::{ }, }; use sp_std::prelude::*; -use xcm::v0::{ - AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, - Order, Outcome, Xcm, +use xcm::latest::{ + AssetId::*, + AssetInstance, Error as XcmError, ExecuteXcm, + Fungibility::*, + Junction::{self, *}, + MultiAsset, + MultiLocation::{self, *}, + NetworkId, Order, Outcome, Xcm, }; use xcm_executor::{traits::Convert, Assets}; @@ -72,15 +77,15 @@ pub fn create_holding( ) -> Assets { (0..fungibles_count) .map(|i| { - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - amount: fungibles_amount * i as u128, + MultiAsset { + id: Concrete(X1(GeneralIndex { id: i as u128 })), + fun: Fungible(fungibles_amount * i as u128), } .into() }) - .chain((0..non_fungibles_count).map(|i| MultiAsset::ConcreteNonFungible { - class: MultiLocation::X1(Junction::GeneralIndex { id: i as u128 }), - instance: asset_instance_from(i), + .chain((0..non_fungibles_count).map(|i| MultiAsset { + id: Concrete(X1(GeneralIndex { id: i as u128 })), + fun: NonFungible(asset_instance_from(i)), })) .collect::>() .into() @@ -100,7 +105,7 @@ pub fn execute_order( mut holding: Assets, order: Order>, ) -> Result { - ExecutorOf::::do_execute_effects(&origin, &mut holding, order) + ExecutorOf::::do_execute_orders(&origin, &mut holding, order) } /// Execute an xcm. diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index a7a30473842d..3d1d8f270906 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -16,14 +16,14 @@ use crate::*; use frame_support::{parameter_types, weights::Weight}; -use xcm::opaque::v0::{prelude::XcmResult, Junction, MultiLocation, Response, Xcm}; +use xcm::opaque::latest::{prelude::XcmResult, Junction, MultiLocation, Response, Xcm}; pub struct YesItShould; impl xcm_executor::traits::ShouldExecute for YesItShould { fn should_execute( _: &MultiLocation, _: bool, - _: &xcm::v0::Xcm, + _: &xcm::latest::Xcm, _: Weight, _: &mut Weight, ) -> Result<(), ()> { @@ -33,7 +33,7 @@ impl xcm_executor::traits::ShouldExecute for YesItShould { // An xcm sender/receiver akin to > /dev/null pub struct DevNull; -impl xcm::opaque::v0::SendXcm for DevNull { +impl xcm::opaque::latest::SendXcm for DevNull { fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { Ok(()) } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 934e48504b32..55bb429f8624 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -22,8 +22,8 @@ use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, wei use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::{ - opaque::v0::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, - v0::{Error as XcmError, Order, Outcome, Xcm}, + latest::{Error as XcmError, Order, Outcome, Xcm}, + opaque::latest::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, }; use xcm_executor::{traits::TransactAsset, Assets}; @@ -37,7 +37,7 @@ const HOLDING_NON_FUNGIBLES: u32 = 99; benchmarks! { send_xcm {}: {} order_noop { - let order = Order::>::Null; + let order = Order::>::Noop; let origin = MultiLocation::X1(account_id_junction::(1)); let holding = Assets::default(); }: { diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 85c24cc7b4c3..e70babd6e5ed 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -28,8 +28,8 @@ use sp_runtime::{ BuildStorage, }; use xcm::{ - opaque::v0::{MultiAsset, MultiLocation}, - v0::Junction, + latest::Junction, + opaque::latest::{MultiAsset, MultiLocation}, }; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 887af359da08..bb9fbf88a914 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -347,12 +347,12 @@ impl XcmExecutor { } #[cfg(feature = "runtime-benchmarks")] - pub fn do_execute_effects( + pub fn do_execute_orders( origin: &MultiLocation, holding: &mut Assets, - effect: Order, + order: Order, ) -> Result { let mut trader = Config::Trader::new(); - Self::execute_effects(origin, holding, effect, &mut trader) + Self::execute_orders(origin, holding, order, &mut trader) } } From 6f29de0e37a0a899d58c71e0870a54c33579f1bb Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 14:31:57 +0200 Subject: [PATCH 35/63] make tests work --- .../src/fungible/mock.rs | 19 +++----------- .../src/fungibles/mock.rs | 26 ++++++++++--------- xcm/pallet-xcm-benchmarks/src/mock.rs | 2 +- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index c83aee5df49e..b0fb7a9e86c8 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -25,7 +25,7 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::latest::{Junction, MultiAsset, MultiLocation, NetworkId}; +use xcm::latest::{AssetId::*, Fungibility::*, Junction, MultiAsset, MultiLocation, NetworkId}; use xcm_builder::{ AllowBenchmarks, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, IsChildSystemParachain, TakeWeightCredit, @@ -107,7 +107,7 @@ impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { fn matches_fungible(m: &MultiAsset) -> Option { use sp_runtime::traits::SaturatedConversion; match m { - MultiAsset::ConcreteFungible { amount, .. } => Some((*amount).saturated_into::()), + MultiAsset { fun: Fungible(amount), .. } => Some((*amount).saturated_into::()), _ => None, } } @@ -122,17 +122,6 @@ pub type AssetTransactor = xcm_builder::CurrencyAdapter< CheckedAccount, >; -/// The barriers one of which must be passed for an XCM message to be executed. -pub type Barrier = ( - // Weight that is paid for may be consumed. - TakeWeightCredit, - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom>, - // Messages coming from system parachains need not pay for execution. - AllowUnpaidExecutionFrom>, - AllowBenchmarks, -); - pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -142,7 +131,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = Barrier; + type Barrier = YesItShould; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfConcreteFungible; type ResponseHandler = DevNull; @@ -169,7 +158,7 @@ impl xcm_balances_benchmark::Config for Test { fn get_multi_asset() -> MultiAsset { let amount = >::minimum_balance() as u128; - MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount } + MultiAsset { id: Concrete(MultiLocation::Here), fun: Fungible(amount) } } } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 832675317df9..08794ee76b0e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -29,12 +29,14 @@ use sp_runtime::{ }; use xcm::{ latest::Junction, - opaque::latest::{MultiAsset, MultiLocation}, + opaque::latest::{AssetId, MultiAsset, MultiLocation}, }; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; +type AccountId = u64; + // For testing the pallet, we construct a mock runtime. frame_support::construct_runtime!( pub enum Test where @@ -66,7 +68,7 @@ impl frame_system::Config for Test { type Hash = H256; type Call = Call; type Hashing = BlakeTwo256; - type AccountId = u64; + type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; type Event = Event; @@ -105,10 +107,12 @@ parameter_types! { pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); } +type AssetsAssetId = u32; + impl pallet_assets::Config for Test { type Event = Event; type Balance = u64; - type AssetId = u32; + type AssetId = AssetsAssetId; type Currency = Balances; type ForceOrigin = frame_system::EnsureRoot; type AssetDeposit = AssetDeposit; @@ -131,13 +135,11 @@ impl Contains for CheckAsset { pub struct MatchAnyFungibles; impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { fn matches_fungibles(m: &MultiAsset) -> Result<(u32, u64), xcm_executor::traits::Error> { - // ^^ TODO: this error is too out of scope. + // ^^ TODO: this error is too out of scope. use sp_runtime::traits::SaturatedConversion; match m { - MultiAsset::ConcreteFungible { - amount, - id: MultiLocation::X1(Junction::GeneralIndex { id }), - } => Ok(((*id).saturated_into(), (*amount).saturated_into::())), + MultiAsset { id: Concrete(X1(GeneralIndex { id })), fun: Fungible(amount) } => + Ok(((*id).saturated_into::(), (*amount).saturated_into::())), _ => Err(xcm_executor::traits::Error::AssetNotFound), } } @@ -151,7 +153,7 @@ pub type AssetTransactor = xcm_builder::FungiblesAdapter< Assets, MatchAnyFungibles, AccountIdConverter, - u64, + AccountId, CheckAsset, CheckedAccount, >; @@ -189,9 +191,9 @@ impl xcm_assets_benchmarks::Config for Test { } let amount = >::minimum_balance(id) as u128; - MultiAsset::ConcreteFungible { - id: MultiLocation::X1(Junction::GeneralIndex { id: id.into() }), - amount, + MultiAsset { + id: Concrete(X1(Junction::GeneralIndex { id: id.into() })), + fun: Fungible(amount), } } } diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 3d1d8f270906..74299476e3f2 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -66,5 +66,5 @@ impl xcm_executor::traits::Convert for AccountIdConverter { parameter_types! { pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); pub UnitWeightCost: Weight = 10; - pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Null, 1_000_000_000_000); + pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Here, 1_000_000_000_000); } From 768a92af3c71c2b057de495e440ba278c8d3a993 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 15:20:11 +0200 Subject: [PATCH 36/63] fix westend benchmarks build --- runtime/westend/src/lib.rs | 7 +- runtime/westend/src/xcm_weights/mod.rs | 76 +++++++++++++------ .../westend/src/xcm_weights/xcm_balances.rs | 4 +- .../westend/src/xcm_weights/xcm_generic.rs | 4 +- 4 files changed, 60 insertions(+), 31 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 56d4065df818..3d9af34a0c6d 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1459,7 +1459,7 @@ sp_api::impl_runtime_apis! { impl pallet_offences_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} - use xcm::v0::MultiAsset; + use xcm::latest::MultiAsset; impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; @@ -1473,7 +1473,10 @@ sp_api::impl_runtime_apis! { type ValidDestination = Westend; fn get_multi_asset() -> MultiAsset { - MultiAsset::ConcreteFungible { id: WndLocation::get(), amount: 1 * UNITS } + MultiAsset { + id: Concrete(WndLocation::get()), + fun: Fungible(1 * UNITS), + } } } diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index cff749226066..e2f2a59acbf7 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -2,12 +2,16 @@ mod xcm_balances; mod xcm_generic; use frame_support::weights::Weight; +use sp_runtime::traits::Saturating; use xcm_balances::WeightInfo as XcmBalancesWeight; use crate::{Runtime, WndLocation}; use sp_std::prelude::*; use xcm::{ - v0::{MultiAsset, MultiLocation, Order, OriginKind, Response, Xcm, XcmWeightInfo}, + latest::{ + AssetId::*, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, OriginKind, + Response, Xcm, XcmWeightInfo, + }, DoubleEncoded, }; use xcm_generic::WeightInfo as XcmGeneric; @@ -21,7 +25,7 @@ impl From<&MultiAsset> for AssetTypes { fn from(asset: &MultiAsset) -> Self { let wnd_location = WndLocation::get(); match asset { - MultiAsset::ConcreteFungible { id: wnd_location, .. } => AssetTypes::Balances, + MultiAsset { id: Concrete(wnd_location), .. } => AssetTypes::Balances, _ => AssetTypes::Unknown, } } @@ -32,48 +36,69 @@ trait WeighMultiAssets { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight; } -impl WeighMultiAssets for Vec { +// TODO wild case +impl WeighMultiAssets for MultiAssetFilter { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight { - self.into_iter() + match self { + Self::Definite(assets) => assets + .inner() + .into_iter() + .map(|m| >::from(m)) + .map(|t| match t { + AssetTypes::Balances => balances_weight, + AssetTypes::Unknown => Weight::MAX, + }) + .fold(0, |acc, x| acc.saturating_add(x)), + _ => Weight::MAX, + } + } +} + +impl WeighMultiAssets for MultiAssets { + fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight { + self.inner() + .into_iter() .map(|m| >::from(m)) .map(|t| match t { AssetTypes::Balances => balances_weight, AssetTypes::Unknown => Weight::MAX, }) - .sum() + .fold(0, |acc, x| acc.saturating_add(x)) } } pub struct WestendXcmWeight; impl XcmWeightInfo<()> for WestendXcmWeight { - fn send_xcm() -> Weight { - XcmGeneric::::send_xcm() - } - fn order_null() -> Weight { - XcmGeneric::::order_null() + fn order_noop() -> Weight { + XcmGeneric::::order_noop() } - fn order_deposit_asset(assets: &Vec, _dest: &MultiLocation) -> Weight { + fn order_deposit_asset( + assets: &MultiAssetFilter, + max_assets: &u32, + _dest: &MultiLocation, + ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_asset()) } fn order_deposit_reserved_asset( - assets: &Vec, + assets: &MultiAssetFilter, + max_assets: &u32, _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) } - fn order_exchange_asset(_give: &Vec, _receive: &Vec) -> Weight { + fn order_exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> Weight { Weight::MAX // todo fix } fn order_initiate_reserve_withdraw( - assets: &Vec, + assets: &MultiAssetFilter, _reserve: &MultiLocation, _effects: &Vec>, ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_initiate_reserve_withdraw()) } fn order_initiate_teleport( - assets: &Vec, + assets: &MultiAssetFilter, _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { @@ -82,7 +107,7 @@ impl XcmWeightInfo<()> for WestendXcmWeight { fn order_query_holding( _query_id: &u64, _dest: &MultiLocation, - _assets: &Vec, + _assets: &MultiAssetFilter, ) -> Weight { XcmGeneric::::order_query_holding() } @@ -91,28 +116,29 @@ impl XcmWeightInfo<()> for WestendXcmWeight { _weight: &u64, _debt: &u64, _halt_on_error: &bool, + _order: &Vec>, _xcm: &Vec>, ) -> Weight { XcmGeneric::::order_buy_execution() } - fn xcm_withdraw_asset(assets: &Vec, _effects: &Vec>) -> Weight { + fn xcm_withdraw_asset(assets: &MultiAssets, _effects: &Vec>) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::xcm_withdraw_asset()) } - fn xcm_reserve_asset_deposit(assets: &Vec, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_reserve_asset_deposit()) + fn xcm_reserve_asset_deposited(assets: &MultiAssets, _effects: &Vec>) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_reserve_asset_deposited()) } // TODO none of these need effects - fn xcm_teleport_asset(assets: &Vec, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_teleport_asset()) + fn xcm_receive_teleported_asset(assets: &MultiAssets, _effects: &Vec>) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::xcm_receive_teleported_asset()) } fn xcm_query_response(_query_id: &u64, _response: &Response) -> Weight { XcmGeneric::::xcm_query_response() } - fn xcm_transfer_asset(assets: &Vec, _dest: &MultiLocation) -> Weight { + fn xcm_transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_asset()) } fn xcm_transfer_reserve_asset( - assets: &Vec, + assets: &MultiAssets, _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { @@ -125,12 +151,12 @@ impl XcmWeightInfo<()> for WestendXcmWeight { ) -> Weight { XcmGeneric::::xcm_transact() } - fn xcm_hrmp_channel_open_request( + fn xcm_hrmp_new_channel_open_request( _sender: &u32, _max_message_size: &u32, _max_capacity: &u32, ) -> Weight { - XcmGeneric::::xcm_hrmp_channel_open_request() + XcmGeneric::::xcm_hrmp_new_channel_open_request() } fn xcm_hrmp_channel_accepted(_recipient: &u32) -> Weight { XcmGeneric::::xcm_hrmp_channel_accepted() diff --git a/runtime/westend/src/xcm_weights/xcm_balances.rs b/runtime/westend/src/xcm_weights/xcm_balances.rs index 7eb2a189ef41..fa1520e21481 100644 --- a/runtime/westend/src/xcm_weights/xcm_balances.rs +++ b/runtime/westend/src/xcm_weights/xcm_balances.rs @@ -20,10 +20,10 @@ impl WeightInfo { pub fn xcm_withdraw_asset() -> Weight { 10 } - pub fn xcm_reserve_asset_deposit() -> Weight { + pub fn xcm_reserve_asset_deposited() -> Weight { 10 } - pub fn xcm_teleport_asset() -> Weight { + pub fn xcm_receive_teleported_asset() -> Weight { 10 } pub fn xcm_transfer_asset() -> Weight { diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs index 1a459527e5a2..aa39dda063aa 100644 --- a/runtime/westend/src/xcm_weights/xcm_generic.rs +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -5,7 +5,7 @@ impl WeightInfo { pub fn send_xcm() -> Weight { 10 } - pub fn order_null() -> Weight { + pub fn order_noop() -> Weight { 10 } pub fn order_query_holding() -> Weight { @@ -17,7 +17,7 @@ impl WeightInfo { pub fn xcm_transact() -> Weight { 10 } - pub fn xcm_hrmp_channel_open_request() -> Weight { + pub fn xcm_hrmp_new_channel_open_request() -> Weight { 10 } pub fn xcm_hrmp_channel_accepted() -> Weight { From 3c578e4a7b350b8e55233246120dadb7368e9844 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 16:43:53 +0200 Subject: [PATCH 37/63] use generated weight in westend --- runtime/westend/src/xcm_weights/mod.rs | 6 +- .../westend/src/xcm_weights/xcm_balances.rs | 115 ++++++++++++++---- .../westend/src/xcm_weights/xcm_generic.rs | 6 +- .../src/fungible/benchmarking.rs | 4 +- .../src/fungibles/benchmarking.rs | 4 +- .../src/xcm_generic/benchmarking.rs | 3 +- xcm/pallet-xcm-benchmarks/template.hbs | 4 +- xcm/src/v1/order.rs | 2 +- xcm/src/v1/traits.rs | 2 +- 9 files changed, 107 insertions(+), 39 deletions(-) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index e2f2a59acbf7..79b5ae694809 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -79,13 +79,13 @@ impl XcmWeightInfo<()> for WestendXcmWeight { ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_asset()) } - fn order_deposit_reserved_asset( + fn order_deposit_reserve_asset( assets: &MultiAssetFilter, max_assets: &u32, _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserved_asset()) + assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserve_asset()) } fn order_exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> Weight { Weight::MAX // todo fix @@ -125,7 +125,7 @@ impl XcmWeightInfo<()> for WestendXcmWeight { assets.weigh_multi_assets(XcmBalancesWeight::::xcm_withdraw_asset()) } fn xcm_reserve_asset_deposited(assets: &MultiAssets, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_reserve_asset_deposited()) + assets.weigh_multi_assets(XcmGeneric::::xcm_reserve_asset_deposited()) } // TODO none of these need effects fn xcm_receive_teleported_asset(assets: &MultiAssets, _effects: &Vec>) -> Weight { diff --git a/runtime/westend/src/xcm_weights/xcm_balances.rs b/runtime/westend/src/xcm_weights/xcm_balances.rs index fa1520e21481..ae00056b4e66 100644 --- a/runtime/westend/src/xcm_weights/xcm_balances.rs +++ b/runtime/westend/src/xcm_weights/xcm_balances.rs @@ -1,35 +1,102 @@ -use frame_support::dispatch::Weight; +// Copyright 2017-2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. -pub struct WeightInfo(sp_std::marker::PhantomData); +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Autogenerated weights for pallet_xcm_benchmarks +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-08-07, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/polkadot +// benchmark +// --chain=westend-dev +// --pallet=pallet_xcm_benchmarks +// --extrinsic=* +// --steps=10 +// --repeat=10 +// --template=./xcm/pallet-xcm-benchmarks/template.hbs +// --output=./ + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weights for pallet_xcm_benchmarks using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); impl WeightInfo { - pub fn order_deposit_asset() -> Weight { - 10 - } - pub fn order_deposit_reserved_asset() -> Weight { - 10 - } - pub fn order_exchange_asset() -> Weight { - 10 + // Storage: System Account (r:1 w:1) + pub(crate) fn order_deposit_asset() -> Weight { + (40_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - pub fn order_initiate_reserve_withdraw() -> Weight { - 10 + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + // Storage: System Account (r:1 w:1) + pub(crate) fn order_deposit_reserve_asset() -> Weight { + (52_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - pub fn order_initiate_teleport() -> Weight { - 10 + // Storage: System Account (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + pub(crate) fn order_initiate_reserve_withdraw() -> Weight { + (51_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - pub fn xcm_withdraw_asset() -> Weight { - 10 + // Storage: System Account (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + pub(crate) fn order_initiate_teleport() -> Weight { + (49_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - pub fn xcm_reserve_asset_deposited() -> Weight { - 10 + // Storage: System Account (r:1 w:1) + pub(crate) fn xcm_withdraw_asset() -> Weight { + (21_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - pub fn xcm_receive_teleported_asset() -> Weight { - 10 + pub(crate) fn xcm_receive_teleported_asset() -> Weight { + (0 as Weight) } - pub fn xcm_transfer_asset() -> Weight { - 10 + // Storage: System Account (r:2 w:2) + pub(crate) fn xcm_transfer_asset() -> Weight { + (29_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } - pub fn xcm_transfer_reserve_asset() -> Weight { - 10 + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: System Account (r:2 w:2) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + pub(crate) fn xcm_transfer_reserve_asset() -> Weight { + (42_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) } } diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs index aa39dda063aa..b3e3b400566e 100644 --- a/runtime/westend/src/xcm_weights/xcm_generic.rs +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -2,9 +2,6 @@ use frame_support::dispatch::Weight; pub struct WeightInfo(sp_std::marker::PhantomData); impl WeightInfo { - pub fn send_xcm() -> Weight { - 10 - } pub fn order_noop() -> Weight { 10 } @@ -17,6 +14,9 @@ impl WeightInfo { pub fn xcm_transact() -> Weight { 10 } + pub fn xcm_reserve_asset_deposited() -> Weight { + 10 + } pub fn xcm_hrmp_new_channel_open_request() -> Weight { 10 } diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 04af624e74d6..b7d1f065a81b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -185,7 +185,9 @@ benchmarks_instance_pallet! { // check one of the assets of origin. assert!(T::TransactAsset::balance(&sender_account).is_zero()); } - xcm_teleport_asset {}: {} verify {} + xcm_receive_teleported_asset { + + }: {} verify {} xcm_transfer_asset { let (sender_account, sender_location) = account_and_location::(1); let ben_location = T::ValidDestination::get(); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index c27e0e95ffe9..d1a6ff8f71de 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -88,7 +88,7 @@ benchmarks! { assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) } - order_deposit_reserved_asset {}: {} verify {} + order_deposit_reserve_asset {}: {} verify {} order_exchange_asset {}: {} verify {} order_initiate_reserve_withdraw {}: {} verify {} order_initiate_teleport {}: {} verify {} @@ -117,7 +117,7 @@ benchmarks! { assert!(T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); } xcm_reserve_asset_deposit {}: {} verify {} - xcm_teleport_asset {}: {} verify {} + xcm_receive_teleported_asset {}: {} verify {} xcm_transfer_asset_per_asset { let a in 1..MAX_ASSETS+1; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 55bb429f8624..c79818b642e4 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -43,9 +43,8 @@ benchmarks! { }: { assert_ok!(execute_order::(origin, holding, order)); } - xcm_withdraw_asset {}: {} verify {} xcm_reserve_asset_deposit {}: {} verify {} - xcm_teleport_asset {}: {} verify {} + xcm_receive_teleported_asset {}: {} verify {} xcm_transfer_asset {}: {} verify {} xcm_transfer_reserve_asset {}: {} verify {} } diff --git a/xcm/pallet-xcm-benchmarks/template.hbs b/xcm/pallet-xcm-benchmarks/template.hbs index 130e811ba67b..e5cc6a71d3e7 100644 --- a/xcm/pallet-xcm-benchmarks/template.hbs +++ b/xcm/pallet-xcm-benchmarks/template.hbs @@ -34,12 +34,12 @@ use sp_std::marker::PhantomData; /// Weights for {{pallet}} using the Substrate node and recommended hardware. pub struct WeightInfo(PhantomData); -impl WeightInfo { +impl WeightInfo { {{~#each benchmarks as |benchmark|}} {{~#each benchmark.comments as |comment|}} // {{comment}} {{~/each}} - fn {{benchmark.name~}} + pub(crate) fn {{benchmark.name~}} ( {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} diff --git a/xcm/src/v1/order.rs b/xcm/src/v1/order.rs index f3f2e4eb6225..7cb6414ca884 100644 --- a/xcm/src/v1/order.rs +++ b/xcm/src/v1/order.rs @@ -250,7 +250,7 @@ impl> GetWeight for Order<()> { Order::DepositAsset { assets, max_assets, beneficiary } => W::order_deposit_asset(assets, max_assets, beneficiary), Order::DepositReserveAsset { assets, max_assets, dest, effects } => - W::order_deposit_reserved_asset(assets, max_assets, dest, effects), + W::order_deposit_reserve_asset(assets, max_assets, dest, effects), Order::ExchangeAsset { give, receive } => W::order_exchange_asset(give, receive), Order::InitiateReserveWithdraw { assets, reserve, effects } => W::order_initiate_reserve_withdraw(assets, reserve, effects), diff --git a/xcm/src/v1/traits.rs b/xcm/src/v1/traits.rs index 1e2bb98a66c2..7f34393bfcee 100644 --- a/xcm/src/v1/traits.rs +++ b/xcm/src/v1/traits.rs @@ -280,7 +280,7 @@ pub trait XcmWeightInfo { max_assets: &u32, dest: &MultiLocation, ) -> Weight; - fn order_deposit_reserved_asset( + fn order_deposit_reserve_asset( assets: &MultiAssetFilter, max_assets: &u32, dest: &MultiLocation, From be9cbb60cf11d83803b39895afb79d70200d6311 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 19:22:55 +0200 Subject: [PATCH 38/63] start fixing xcm_generic --- .../src/fungible/benchmarking.rs | 26 ++---- .../src/fungible/mock.rs | 2 +- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 3 - .../src/fungibles/benchmarking.rs | 10 +-- .../src/fungibles/mock.rs | 5 ++ xcm/pallet-xcm-benchmarks/src/lib.rs | 20 +++-- xcm/pallet-xcm-benchmarks/src/mock.rs | 2 +- .../src/xcm_generic/benchmarking.rs | 81 ++++++++++++++----- .../src/xcm_generic/mock.rs | 8 ++ 9 files changed, 102 insertions(+), 55 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index b7d1f065a81b..78cad53690c8 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -16,29 +16,19 @@ use super::*; use crate::{ - account_and_location, account_id_junction, create_holding, execute_order, execute_xcm, - AssetTransactorOf, OverArchingCallOf, XcmCallOf, + account_and_location, account_id_junction, execute_order, execute_xcm, worst_case_holding, + AssetTransactorOf, XcmCallOf, }; -use codec::Encode; use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; -use frame_support::{ - assert_ok, instances::Instance1, pallet_prelude::Get, traits::fungible::Inspect, -}; +use frame_support::{assert_ok, pallet_prelude::Get, traits::fungible::Inspect}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::latest::{Junction, MultiAssets, MultiLocation, Order, Xcm}; -use xcm_executor::{ - traits::{Convert, TransactAsset}, - Assets, -}; +use xcm_executor::traits::{Convert, TransactAsset}; // TODO: def. needs to be become a config, might also want to use bounded vec. const MAX_ASSETS: u32 = 25; -/// The number of fungible assets in the holding. -const HOLDING_FUNGIBLES: u32 = 99; -const HOLDING_NON_FUNGIBLES: u32 = 99; - benchmarks_instance_pallet! { where_clause { where < @@ -58,7 +48,7 @@ benchmarks_instance_pallet! { let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + let mut holding = worst_case_holding(); // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); // our dest must have no balance initially. @@ -85,7 +75,7 @@ benchmarks_instance_pallet! { let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. // TODO: maybe update this api - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + let mut holding = worst_case_holding(); // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); // our dest must have no balance initially. @@ -112,7 +102,7 @@ benchmarks_instance_pallet! { let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + let mut holding = worst_case_holding(); // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); @@ -135,7 +125,7 @@ benchmarks_instance_pallet! { let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. - let mut holding = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + let mut holding = worst_case_holding(); // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index b0fb7a9e86c8..b6204b9bd27d 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -140,6 +140,7 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; + type ValidDestination = ValidDestination; } parameter_types! { @@ -154,7 +155,6 @@ impl xcm_balances_benchmark::Config for Test { type TransactAsset = Balances; type CheckedAccount = CheckedAccount; - type ValidDestination = ValidDestination; fn get_multi_asset() -> MultiAsset { let amount = >::minimum_balance() as u128; diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index d59fd6e2ec4b..bf32e854fe78 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -21,9 +21,6 @@ pub mod pallet { /// Maybe I can get this in some better way? type CheckedAccount: Get>; - /// A valid destination location which can be used in benchmarks. - type ValidDestination: Get; - /// Give me a fungible asset that your asset transactor is going to accept. fn get_multi_asset() -> xcm::latest::MultiAsset; } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index d1a6ff8f71de..389a96944dba 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -16,8 +16,8 @@ use super::*; use crate::{ - account, account_id_junction, create_holding, execute_order, execute_xcm, AssetTransactorOf, - OverArchingCallOf, XcmCallOf, + account, account_id_junction, execute_order, execute_xcm, worst_case_holding, + AssetTransactorOf, OverArchingCallOf, XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; @@ -37,10 +37,6 @@ use xcm_executor::{traits::TransactAsset, Assets}; // TODO: def. needs to be become a config, might also want to use bounded vec. const MAX_ASSETS: u32 = 25; -/// The number of fungible assets in the holding. -const HOLDING_FUNGIBLES: u32 = 99; -const HOLDING_NON_FUNGIBLES: u32 = 99; - benchmarks! { where_clause { where >::AssetId: From, @@ -79,7 +75,7 @@ benchmarks! { }; let amount: u128 = T::TransactAsset::minimum_balance(asset_id.into()).try_into().unwrap(); - let mut holding: Assets = create_holding(HOLDING_FUNGIBLES, amount, HOLDING_NON_FUNGIBLES); + let mut holding: Assets = worst_case_holding(); holding.subsume(asset); assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); }: { diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 08794ee76b0e..b572f8c39ee5 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -147,6 +147,10 @@ impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { parameter_types! { pub const CheckedAccount: u64 = 100; + pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + network: NetworkId::Any, + id: [0u8; 32], + }); } pub type AssetTransactor = xcm_builder::FungiblesAdapter< @@ -176,6 +180,7 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; + type ValidDestination = ValidDestination; } impl xcm_assets_benchmarks::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 38a96b949bd5..6315175a210e 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -21,6 +21,7 @@ use codec::Encode; use frame_support::{ dispatch::Weight, + pallet_prelude::Get, traits::{ fungible::Inspect as FungibleInspect, fungibles::Inspect as FungiblesInspect, @@ -56,6 +57,9 @@ pub trait Config: frame_system::Config { // temp? type AccountIdConverter: Convert; + + /// A valid destination location which can be used in benchmarks. + type ValidDestination: Get; } const SEED: u32 = 0; @@ -70,12 +74,13 @@ pub type AssetTransactorOf = <::XcmConfig as xcm_executor::Confi /// The call type of executor's config. Should eventually resolve to the same overarching call type. pub type XcmCallOf = <::XcmConfig as xcm_executor::Config>::Call; -pub fn create_holding( - fungibles_count: u32, - fungibles_amount: u128, - non_fungibles_count: u32, -) -> Assets { - (0..fungibles_count) +/// The worst case number of assets in the holding. +const HOLDING_FUNGIBLES: u32 = 99; +const HOLDING_NON_FUNGIBLES: u32 = 99; + +pub fn worst_case_holding() -> Assets { + let fungibles_amount: u128 = 100; // TODO probably update + (0..HOLDING_FUNGIBLES) .map(|i| { MultiAsset { id: Concrete(X1(GeneralIndex { id: i as u128 })), @@ -83,7 +88,8 @@ pub fn create_holding( } .into() }) - .chain((0..non_fungibles_count).map(|i| MultiAsset { + .chain(core::iter::once(MultiAsset { id: Concrete(Here), fun: Fungible(u128::MAX) })) + .chain((0..HOLDING_NON_FUNGIBLES).map(|i| MultiAsset { id: Concrete(X1(GeneralIndex { id: i as u128 })), fun: NonFungible(asset_instance_from(i)), })) diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 74299476e3f2..6e4e8ba8fc39 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -66,5 +66,5 @@ impl xcm_executor::traits::Convert for AccountIdConverter { parameter_types! { pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); pub UnitWeightCost: Weight = 10; - pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Here, 1_000_000_000_000); + pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Here, 1_000_000); } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index c79818b642e4..2316218be6aa 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -15,38 +15,83 @@ // along with Polkadot. If not, see . use super::*; -use crate::{account_id_junction, execute_order, execute_xcm, OverArchingCallOf, XcmCallOf}; +use crate::{ + account_id_junction, execute_order, execute_xcm, worst_case_holding, OverArchingCallOf, + XcmCallOf, +}; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{assert_ok, traits::fungible::Inspect as FungibleInspect, weights::Weight}; +use frame_support::{ + assert_ok, pallet_prelude::Get, traits::fungible::Inspect as FungibleInspect, weights::Weight, +}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - latest::{Error as XcmError, Order, Outcome, Xcm}, - opaque::latest::{AssetInstance, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId}, +use xcm::latest::{ + AssetId::*, + AssetInstance, Error as XcmError, ExecuteXcm, Junction, + Junction::*, + MultiAsset, + MultiAssetFilter::*, + MultiLocation::{self, *}, + NetworkId, Order, Outcome, WildMultiAsset, Xcm, }; use xcm_executor::{traits::TransactAsset, Assets}; -// TODO: def. needs to be become a config, might also want to use bounded vec. -const MAX_ASSETS: u32 = 25; - -/// The number of fungible assets in the holding. -const HOLDING_FUNGIBLES: u32 = 99; -const HOLDING_NON_FUNGIBLES: u32 = 99; - benchmarks! { - send_xcm {}: {} order_noop { let order = Order::>::Noop; let origin = MultiLocation::X1(account_id_junction::(1)); - let holding = Assets::default(); + let holding = worst_case_holding(); }: { assert_ok!(execute_order::(origin, holding, order)); } - xcm_reserve_asset_deposit {}: {} verify {} - xcm_receive_teleported_asset {}: {} verify {} - xcm_transfer_asset {}: {} verify {} - xcm_transfer_reserve_asset {}: {} verify {} + + order_query_holding { + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = worst_case_holding(); + + let order = Order::>::QueryHolding { + query_id: Default::default(), + dest: T::ValidDestination::get(), + assets: Wild(WildMultiAsset::All), // TODO is worst case filter? + }; + + } : { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + // The assert above is enough to validate this is completed. + // todo maybe XCM sender peek + } + + // This benchmark does not use any additional orders or instructions. This should be managed + // by the `deep` and `shallow` implementation. + order_buy_execution { + let origin = MultiLocation::X1(account_id_junction::(1)); + let holding = worst_case_holding(); + + let fee_asset = Concrete(Here); + + let order = Order::>::BuyExecution { + fees: (fee_asset, 100_000_000).into(), // should be something inside of holding + weight: 100_000_000, // TODO think about sensible numbers + debt: 100_000_000, // TODO think about sensible numbers + halt_on_error: false, + orders: Default::default(), // no orders + instructions: Default::default(), // no instructions + }; + } : { + assert_ok!(execute_order::(origin, holding, order)); + } verify { + + } + xcm_reserve_asset_deposited {}: {} verify {} + xcm_query_response {}: {} verify {} + xcm_transact {}: {} verify {} + xcm_hrmp_new_channel_open_request {}: {} verify {} + xcm_hrmp_channel_accepted {}: {} verify {} + xcm_hrmp_channel_closing {}: {} verify {} + xcm_relayed_from {}: {} verify {} + } impl_benchmark_test_suite!( diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index e70babd6e5ed..baaac52c381c 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -105,9 +105,17 @@ impl xcm_executor::Config for XcmConfig { type ResponseHandler = DevNull; } +parameter_types! { + pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + network: NetworkId::Any, + id: [0u8; 32], + }); +} + impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = (); + type ValidDestination = ValidDestination; } impl xcm_generic_benchmarks::Config for Test {} From b782a31b5c7132c305eac2e9723ab98dbfb6f98f Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 7 Aug 2021 23:07:52 +0200 Subject: [PATCH 39/63] most of xcm generic --- runtime/westend/src/lib.rs | 15 ++- xcm/pallet-xcm-benchmarks/src/mock.rs | 12 +- .../src/xcm_generic/benchmarking.rs | 124 +++++++++++++++--- .../src/xcm_generic/mock.rs | 29 ++-- .../src/xcm_generic/mod.rs | 12 +- 5 files changed, 162 insertions(+), 30 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 3d9af34a0c6d..2aa4e924d43c 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1406,6 +1406,7 @@ sp_api::impl_runtime_apis! { use frame_system_benchmarking::Pallet as SystemBench; type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::xcm_generic::Pallet::; let mut list = Vec::::new(); @@ -1436,6 +1437,7 @@ sp_api::impl_runtime_apis! { // XCM Benchmarks list_benchmark!(list, extra, pallet_xcm_benchmarks, XcmBalances); + list_benchmark!(list, extra, pallet_xcm_benchmarks, XcmGeneric); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1464,13 +1466,22 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = LocationConverter; + type ValidDestination = Westend; + } + + impl pallet_xcm_benchmarks::xcm_generic::Config for Runtime { + type Call = Call; + + fn worst_case_response() -> (u64, Response) { + let assets: MultiAssets = (Concrete(WndLocation::get()), 1 * UNITS).into(); + (0, Response::Assets(assets)) + } } impl pallet_xcm_benchmarks::fungible::Config for Runtime { type TransactAsset = Balances; type CheckedAccount = CheckAccount; - type ValidDestination = Westend; fn get_multi_asset() -> MultiAsset { MultiAsset { @@ -1481,6 +1492,7 @@ sp_api::impl_runtime_apis! { } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; + type XcmGeneric = pallet_xcm_benchmarks::xcm_generic::Pallet::; let whitelist: Vec = vec![ // Block Number @@ -1527,6 +1539,7 @@ sp_api::impl_runtime_apis! { // XCM Benchmarks add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmBalances); + add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmGeneric); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 6e4e8ba8fc39..bc59e0e3977e 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -16,7 +16,8 @@ use crate::*; use frame_support::{parameter_types, weights::Weight}; -use xcm::opaque::latest::{prelude::XcmResult, Junction, MultiLocation, Response, Xcm}; +use xcm::latest::{prelude::XcmResult, Junction, MultiLocation, OriginKind, Response, Xcm}; +use xcm_executor::traits::FilterAssetLocation; pub struct YesItShould; impl xcm_executor::traits::ShouldExecute for YesItShould { @@ -34,7 +35,7 @@ impl xcm_executor::traits::ShouldExecute for YesItShould { // An xcm sender/receiver akin to > /dev/null pub struct DevNull; impl xcm::opaque::latest::SendXcm for DevNull { - fn send_xcm(_: MultiLocation, _: Xcm) -> XcmResult { + fn send_xcm(_: MultiLocation, _: Xcm<()>) -> XcmResult { Ok(()) } } @@ -68,3 +69,10 @@ parameter_types! { pub UnitWeightCost: Weight = 10; pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Here, 1_000_000); } + +pub struct AllAssetLocationsPass; +impl FilterAssetLocation for AllAssetLocationsPass { + fn filter_asset_location(_: &MultiAsset, _: &MultiLocation) -> bool { + true + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 2316218be6aa..570dd997fec6 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -16,25 +16,29 @@ use super::*; use crate::{ - account_id_junction, execute_order, execute_xcm, worst_case_holding, OverArchingCallOf, - XcmCallOf, + account_and_location, account_id_junction, execute_order, execute_xcm, worst_case_holding, + OverArchingCallOf, XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_support::{ - assert_ok, pallet_prelude::Get, traits::fungible::Inspect as FungibleInspect, weights::Weight, + assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Get, + traits::fungible::Inspect as FungibleInspect, weights::Weight, }; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::latest::{ - AssetId::*, - AssetInstance, Error as XcmError, ExecuteXcm, Junction, - Junction::*, - MultiAsset, - MultiAssetFilter::*, - MultiLocation::{self, *}, - NetworkId, Order, Outcome, WildMultiAsset, Xcm, +use xcm::{ + latest::prelude::{OriginKind::SovereignAccount, *}, + DoubleEncoded, }; +// AssetId::*, +// AssetInstance, Error as XcmError, ExecuteXcm, Junction, +// Junction::*, +// MultiAsset, +// MultiAssetFilter::*, +// MultiAssets, +// MultiLocation::{self, *}, +// NetworkId, Order, Outcome, WildMultiAsset, Xcm, use xcm_executor::{traits::TransactAsset, Assets}; benchmarks! { @@ -84,13 +88,97 @@ benchmarks! { } verify { } - xcm_reserve_asset_deposited {}: {} verify {} - xcm_query_response {}: {} verify {} - xcm_transact {}: {} verify {} - xcm_hrmp_new_channel_open_request {}: {} verify {} - xcm_hrmp_channel_accepted {}: {} verify {} - xcm_hrmp_channel_closing {}: {} verify {} - xcm_relayed_from {}: {} verify {} + + // Worst case scenario for this benchmark is a large number of assets to + // filter through the reserve. + xcm_reserve_asset_deposited { + let (sender_account, sender_location) = account_and_location::(1); + let assets: MultiAssets = (Concrete(Here), 100).into();// TODO worst case + + // no effects to isolate this benchmark + let effects: Vec> = Default::default(); + let xcm = Xcm::ReserveAssetDeposited { assets, effects }; + }: { + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + } verify { + // The assert above is enough to show this XCM succeeded + } + + xcm_query_response { + let (sender_account, sender_location) = account_and_location::(1); + let (query_id, response) = T::worst_case_response(); + let xcm = Xcm::QueryResponse { query_id, response }; + }: { + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + } verify { + // The assert above is enough to show this XCM succeeded + } + + // We don't care about the call itself, since that is accounted for in the weight parameter + // and included in the final weight calculation. So this is just the overhead of submitting + // a noop call. + xcm_transact { + let (sender_account, sender_location) = account_and_location::(1); + let noop_call: ::Call = frame_system::Call::remark_with_event(Default::default()).into(); + let double_encoded_noop_call: DoubleEncoded<_> = noop_call.encode().into(); + + let xcm = Xcm::Transact { + origin_type: SovereignAccount, + require_weight_at_most: noop_call.get_dispatch_info().weight, + call: double_encoded_noop_call, + }; + + let num_events = frame_system::Pallet::::events().len(); + }: { + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + } verify { + // TODO make better assertion? + let num_events2 = frame_system::Pallet::::events().len(); + assert_eq!(num_events + 1, num_events2); + } + + xcm_hrmp_new_channel_open_request { + let (sender_account, sender_location) = account_and_location::(1); + // Inputs here should not matter to weight. + // let xcm = Xcm::HrmpNewChannelOpenRequest { + // sender: Default::default(), + // max_message_size: Default::default(), + // max_capacity: Default::default(), + // }; + }: { + // assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + // currently unhandled + } verify { + + } + xcm_hrmp_channel_accepted {}: { + // currently unhandled + } verify {} + xcm_hrmp_channel_closing {}: { + // currently unhandled + } verify {} + + // We want to measure this benchmark with a noop XCM to isolate specifically + // the overhead of `RelayedFrom`. The weight of the inner XCM should be accounted + // for when calculating the total weight. + xcm_relayed_from { + let (sender_account, sender_location) = account_and_location::(1); + + // when these two inputs are empty, we basically noop + let noop_xcm = Xcm::ReserveAssetDeposited { + assets: Vec::::new().into(), + effects: Default::default(), + }; + + let xcm = Xcm::RelayedFrom { + who: Here, + message: Box::new(noop_xcm), + }; + }: { + assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + } verify { + // the assert above verifies the XCM completed successfully. + } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index baaac52c381c..b5b637799de5 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -27,10 +27,8 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup, Zero}, BuildStorage, }; -use xcm::{ - latest::Junction, - opaque::latest::{MultiAsset, MultiLocation}, -}; +use xcm::latest::prelude::*; +use xcm_executor::traits::ConvertOrigin; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -95,8 +93,8 @@ impl xcm_executor::Config for XcmConfig { type Call = Call; type XcmSender = DevNull; type AssetTransactor = NoAssetTransactor; - type OriginConverter = (); - type IsReserve = (); + type OriginConverter = AlwaysSignedByDefault; + type IsReserve = AllAssetLocationsPass; type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; type Barrier = YesItShould; @@ -114,13 +112,28 @@ parameter_types! { impl crate::Config for Test { type XcmConfig = XcmConfig; - type AccountIdConverter = (); + type AccountIdConverter = AccountIdConverter; type ValidDestination = ValidDestination; } -impl xcm_generic_benchmarks::Config for Test {} + +impl xcm_generic_benchmarks::Config for Test { + type Call = Call; + + fn worst_case_response() -> (u64, Response) { + let assets: MultiAssets = (Concrete(Here), 100).into(); + (0, Response::Assets(assets)) + } +} pub fn new_test_ext() -> sp_io::TestExternalities { let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); sp_tracing::try_init_simple(); t.into() } + +pub struct AlwaysSignedByDefault; +impl ConvertOrigin for AlwaysSignedByDefault { + fn convert_origin(_origin: MultiLocation, _kind: OriginKind) -> Result { + Ok(Origin::signed(Default::default())) + } +} diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs index 2054ddb0f225..e2ca46c45002 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mod.rs @@ -6,8 +6,18 @@ mod mock; #[frame_support::pallet] pub mod pallet { + use frame_support::{dispatch::Dispatchable, pallet_prelude::Encode, weights::GetDispatchInfo}; + use xcm::latest::Response; + #[pallet::config] - pub trait Config: frame_system::Config + crate::Config {} + pub trait Config: frame_system::Config + crate::Config { + type Call: Dispatchable + + GetDispatchInfo + + From> + + Encode; + + fn worst_case_response() -> (u64, Response); + } #[pallet::pallet] pub struct Pallet(_); From 3a263950b2128cd0a1be83563d8ebef89d052d3e Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:19:32 +0200 Subject: [PATCH 40/63] clean up --- .../src/fungible/benchmarking.rs | 5 +--- .../src/fungible/mock.rs | 14 ++++------- xcm/pallet-xcm-benchmarks/src/fungible/mod.rs | 2 -- .../src/fungibles/benchmarking.rs | 9 ++----- .../src/fungibles/mock.rs | 11 +++----- xcm/pallet-xcm-benchmarks/src/mock.rs | 17 ++----------- .../src/xcm_generic/benchmarking.rs | 25 +++---------------- .../src/xcm_generic/mock.rs | 12 ++++----- xcm/src/v1/mod.rs | 2 +- 9 files changed, 24 insertions(+), 73 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 78cad53690c8..53ba32c903da 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -23,12 +23,9 @@ use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; use frame_support::{assert_ok, pallet_prelude::Get, traits::fungible::Inspect}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::latest::{Junction, MultiAssets, MultiLocation, Order, Xcm}; +use xcm::latest::prelude::*; use xcm_executor::traits::{Convert, TransactAsset}; -// TODO: def. needs to be become a config, might also want to use bounded vec. -const MAX_ASSETS: u32 = 25; - benchmarks_instance_pallet! { where_clause { where < diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index b6204b9bd27d..a0fbaf089d0e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -18,18 +18,14 @@ use crate::{fungible as xcm_balances_benchmark, mock::*}; use frame_support::{parameter_types, traits::All}; -use polkadot_primitives::v1::Id as ParaId; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::latest::{AssetId::*, Fungibility::*, Junction, MultiAsset, MultiLocation, NetworkId}; -use xcm_builder::{ - AllowBenchmarks, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - IsChildSystemParachain, TakeWeightCredit, -}; +use xcm::latest::prelude::*; +use xcm_builder::AllowUnpaidExecutionFrom; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -131,9 +127,9 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = AllowUnpaidExecutionFrom>; type Weigher = xcm_builder::FixedWeightBounds; - type Trader = xcm_builder::FixedRateOfConcreteFungible; + type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; } @@ -145,7 +141,7 @@ impl crate::Config for Test { parameter_types! { pub const CheckedAccount: Option = Some(100); - pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + pub const ValidDestination: MultiLocation = X1(AccountId32 { network: NetworkId::Any, id: [0u8; 32], }); diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs index bf32e854fe78..fb10265e2c58 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -9,8 +9,6 @@ mod mock; #[frame_support::pallet] pub mod pallet { use frame_support::pallet_prelude::Get; - use xcm::latest::{MultiAsset, MultiLocation}; - #[pallet::config] pub trait Config: frame_system::Config + crate::Config { /// The type of `fungible` that is being used under the hood. diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 389a96944dba..454ecf9fb635 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -17,21 +17,16 @@ use super::*; use crate::{ account, account_id_junction, execute_order, execute_xcm, worst_case_holding, - AssetTransactorOf, OverArchingCallOf, XcmCallOf, + AssetTransactorOf, XcmCallOf, }; -use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_support::{ assert_ok, traits::fungibles::{Inspect, Mutate}, - weights::Weight, }; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::latest::{ - AssetInstance, Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiAssets, MultiLocation, - NetworkId, Order, Outcome, Xcm, -}; +use xcm::latest::prelude::*; use xcm_executor::{traits::TransactAsset, Assets}; // TODO: def. needs to be become a config, might also want to use bounded vec. diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index b572f8c39ee5..c5cc38620ab4 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -19,7 +19,7 @@ use crate::{fungibles as xcm_assets_benchmarks, mock::*, *}; use frame_support::{ parameter_types, - traits::{fungibles::Inspect, Contains}, + traits::{fungibles::Inspect, All, Contains}, }; use sp_core::H256; use sp_runtime::{ @@ -27,10 +27,7 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup, Zero}, BuildStorage, }; -use xcm::{ - latest::Junction, - opaque::latest::{AssetId, MultiAsset, MultiLocation}, -}; +use xcm_builder::AllowUnpaidExecutionFrom; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -171,9 +168,9 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); // no one can teleport. type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = AllowUnpaidExecutionFrom>; type Weigher = xcm_builder::FixedWeightBounds; - type Trader = xcm_builder::FixedRateOfConcreteFungible; + type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; } diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index bc59e0e3977e..5a4961213bc5 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -16,22 +16,9 @@ use crate::*; use frame_support::{parameter_types, weights::Weight}; -use xcm::latest::{prelude::XcmResult, Junction, MultiLocation, OriginKind, Response, Xcm}; +use xcm::latest::prelude::*; use xcm_executor::traits::FilterAssetLocation; -pub struct YesItShould; -impl xcm_executor::traits::ShouldExecute for YesItShould { - fn should_execute( - _: &MultiLocation, - _: bool, - _: &xcm::latest::Xcm, - _: Weight, - _: &mut Weight, - ) -> Result<(), ()> { - Ok(()) - } -} - // An xcm sender/receiver akin to > /dev/null pub struct DevNull; impl xcm::opaque::latest::SendXcm for DevNull { @@ -67,7 +54,7 @@ impl xcm_executor::traits::Convert for AccountIdConverter { parameter_types! { pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); pub UnitWeightCost: Weight = 10; - pub WeightPrice: (MultiLocation, u128) = (MultiLocation::Here, 1_000_000); + pub WeightPrice: (AssetId, u128) = (Concrete(Here), 1_000_000); } pub struct AllAssetLocationsPass; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 570dd997fec6..d69afe214cc7 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -17,29 +17,12 @@ use super::*; use crate::{ account_and_location, account_id_junction, execute_order, execute_xcm, worst_case_holding, - OverArchingCallOf, XcmCallOf, + XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{ - assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Get, - traits::fungible::Inspect as FungibleInspect, weights::Weight, -}; -use sp_runtime::traits::Zero; -use sp_std::{convert::TryInto, prelude::*, vec}; -use xcm::{ - latest::prelude::{OriginKind::SovereignAccount, *}, - DoubleEncoded, -}; -// AssetId::*, -// AssetInstance, Error as XcmError, ExecuteXcm, Junction, -// Junction::*, -// MultiAsset, -// MultiAssetFilter::*, -// MultiAssets, -// MultiLocation::{self, *}, -// NetworkId, Order, Outcome, WildMultiAsset, Xcm, -use xcm_executor::{traits::TransactAsset, Assets}; +use frame_support::{assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Get}; +use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { order_noop { @@ -123,7 +106,7 @@ benchmarks! { let double_encoded_noop_call: DoubleEncoded<_> = noop_call.encode().into(); let xcm = Xcm::Transact { - origin_type: SovereignAccount, + origin_type: OriginKind::SovereignAccount, require_weight_at_most: noop_call.get_dispatch_info().weight, call: double_encoded_noop_call, }; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index b5b637799de5..27e673a49bbe 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -17,17 +17,15 @@ //! A mock runtime for xcm benchmarking. use crate::{mock::*, xcm_generic as xcm_generic_benchmarks, *}; -use frame_support::{ - parameter_types, - traits::{fungibles::Inspect, Contains}, -}; +use frame_support::{parameter_types, traits::All}; use sp_core::H256; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, IdentityLookup, Zero}, + traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; use xcm::latest::prelude::*; +use xcm_builder::AllowUnpaidExecutionFrom; use xcm_executor::traits::ConvertOrigin; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -97,9 +95,9 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = AllAssetLocationsPass; type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = YesItShould; + type Barrier = AllowUnpaidExecutionFrom>; type Weigher = xcm_builder::FixedWeightBounds; - type Trader = xcm_builder::FixedRateOfConcreteFungible; + type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; } diff --git a/xcm/src/v1/mod.rs b/xcm/src/v1/mod.rs index 883746ccaa2a..e61cbf2f7f6f 100644 --- a/xcm/src/v1/mod.rs +++ b/xcm/src/v1/mod.rs @@ -47,7 +47,7 @@ pub mod prelude { pub use super::{ junction::{ BodyId, BodyPart, - Junction::*, + Junction::{self, *}, NetworkId::{self, *}, }, multiasset::{ From 3915381c0d4832719425bbe4623963a11de81a49 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:20:01 +0200 Subject: [PATCH 41/63] Update Cargo.lock --- Cargo.lock | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 362c551f8908..94713948a5b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4686,6 +4686,19 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#9d867b6b4dd099ecef7bed1a1ff5a3441f41d684" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" @@ -5451,6 +5464,30 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.2.4" @@ -12122,6 +12159,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -12280,6 +12318,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain", From fc00dc1e887111fb4f748eb8217de6825ecf784b Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:24:54 +0200 Subject: [PATCH 42/63] fix merge --- runtime/test-runtime/src/xcm_config.rs | 2 +- xcm/pallet-xcm-benchmarks/src/fungible/mock.rs | 6 +++--- xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs | 2 +- xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs | 6 +++--- xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs | 6 +++--- xcm/xcm-executor/src/lib.rs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/test-runtime/src/xcm_config.rs b/runtime/test-runtime/src/xcm_config.rs index deaaef47ed04..64030bb07ffc 100644 --- a/runtime/test-runtime/src/xcm_config.rs +++ b/runtime/test-runtime/src/xcm_config.rs @@ -43,7 +43,7 @@ impl SendXcm for DoNothingRouter { } } -pub type Barrier = AllowUnpaidExecutionFrom>; +pub type Barrier = AllowUnpaidExecutionFrom; pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index a0fbaf089d0e..e4d9fbab3ff2 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -17,7 +17,7 @@ //! A mock runtime for xcm benchmarking. use crate::{fungible as xcm_balances_benchmark, mock::*}; -use frame_support::{parameter_types, traits::All}; +use frame_support::{parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -49,7 +49,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(1024); } impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::AllowAll; + type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); @@ -127,7 +127,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = AllowUnpaidExecutionFrom>; + type Barrier = AllowUnpaidExecutionFrom; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs index 1b8ea2313ebb..32c9b255265d 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs @@ -233,7 +233,7 @@ pub type Barrier = ( // Weight that is paid for may be consumed. TakeWeightCredit, // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom>, + AllowTopLevelPaidExecutionFrom, // Messages coming from system parachains need not pay for execution. AllowUnpaidExecutionFrom>, ); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index c5cc38620ab4..b4525304e436 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -19,7 +19,7 @@ use crate::{fungibles as xcm_assets_benchmarks, mock::*, *}; use frame_support::{ parameter_types, - traits::{fungibles::Inspect, All, Contains}, + traits::{fungibles::Inspect, Contains, Everything}, }; use sp_core::H256; use sp_runtime::{ @@ -55,7 +55,7 @@ parameter_types! { } impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::AllowAll; + type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); @@ -168,7 +168,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = (); type IsTeleporter = (); // no one can teleport. type LocationInverter = xcm_builder::LocationInverter; - type Barrier = AllowUnpaidExecutionFrom>; + type Barrier = AllowUnpaidExecutionFrom; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 27e673a49bbe..55d1529a3493 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -17,7 +17,7 @@ //! A mock runtime for xcm benchmarking. use crate::{mock::*, xcm_generic as xcm_generic_benchmarks, *}; -use frame_support::{parameter_types, traits::All}; +use frame_support::{parameter_types, traits::Everything}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -49,7 +49,7 @@ parameter_types! { } impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::AllowAll; + type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); @@ -95,7 +95,7 @@ impl xcm_executor::Config for XcmConfig { type IsReserve = AllAssetLocationsPass; type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; - type Barrier = AllowUnpaidExecutionFrom>; + type Barrier = AllowUnpaidExecutionFrom; type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index ca6e36131872..7e0c0f3659f5 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -384,6 +384,6 @@ impl XcmExecutor { order: Order, ) -> Result { let mut trader = Config::Trader::new(); - Self::execute_orders(origin, holding, order, &mut trader) + Self::execute_orders(origin, holding, order, &mut trader, 0) } } From c7c0f2b88dde15435f81b395d1f956d778000164 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:34:16 +0200 Subject: [PATCH 43/63] more cleanup --- xcm/pallet-xcm-benchmarks/src/lib.rs | 10 +--------- xcm/pallet-xcm-benchmarks/src/mock.rs | 1 - .../src/xcm_generic/benchmarking.rs | 3 ++- xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 6315175a210e..e9142fddbf66 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -29,15 +29,7 @@ use frame_support::{ }, }; use sp_std::prelude::*; -use xcm::latest::{ - AssetId::*, - AssetInstance, Error as XcmError, ExecuteXcm, - Fungibility::*, - Junction::{self, *}, - MultiAsset, - MultiLocation::{self, *}, - NetworkId, Order, Outcome, Xcm, -}; +use xcm::latest::prelude::*; use xcm_executor::{traits::Convert, Assets}; pub mod fungible; diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 5a4961213bc5..454f76540093 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -16,7 +16,6 @@ use crate::*; use frame_support::{parameter_types, weights::Weight}; -use xcm::latest::prelude::*; use xcm_executor::traits::FilterAssetLocation; // An xcm sender/receiver akin to > /dev/null diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index d69afe214cc7..4819e5d3f004 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -22,6 +22,7 @@ use crate::{ use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_support::{assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Get}; +use sp_std::prelude::*; use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { @@ -155,7 +156,7 @@ benchmarks! { let xcm = Xcm::RelayedFrom { who: Here, - message: Box::new(noop_xcm), + message: sp_std::boxed::Box::new(noop_xcm), }; }: { assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 55d1529a3493..9c3dadf46f73 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -24,7 +24,6 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, BuildStorage, }; -use xcm::latest::prelude::*; use xcm_builder::AllowUnpaidExecutionFrom; use xcm_executor::traits::ConvertOrigin; From 62bb8ee5475cc587af67da9099632e650d920892 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:36:58 +0200 Subject: [PATCH 44/63] fix warnings --- runtime/westend/src/xcm_weights/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index 79b5ae694809..ab854128a3dd 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -2,7 +2,6 @@ mod xcm_balances; mod xcm_generic; use frame_support::weights::Weight; -use sp_runtime::traits::Saturating; use xcm_balances::WeightInfo as XcmBalancesWeight; use crate::{Runtime, WndLocation}; @@ -23,9 +22,8 @@ pub enum AssetTypes { impl From<&MultiAsset> for AssetTypes { fn from(asset: &MultiAsset) -> Self { - let wnd_location = WndLocation::get(); match asset { - MultiAsset { id: Concrete(wnd_location), .. } => AssetTypes::Balances, + MultiAsset { id: Concrete(Here), .. } => AssetTypes::Balances, _ => AssetTypes::Unknown, } } @@ -74,14 +72,14 @@ impl XcmWeightInfo<()> for WestendXcmWeight { } fn order_deposit_asset( assets: &MultiAssetFilter, - max_assets: &u32, + _max_assets: &u32, // TODO use max assets? _dest: &MultiLocation, ) -> Weight { assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_asset()) } fn order_deposit_reserve_asset( assets: &MultiAssetFilter, - max_assets: &u32, + _max_assets: &u32, // TODO use max assets? _dest: &MultiLocation, _effects: &Vec>, ) -> Weight { From de3247b7a7f01a12e332f9060fc94ed9d1ca137c Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 12:42:30 +0200 Subject: [PATCH 45/63] more cleanup --- runtime/westend/src/xcm_weights/mod.rs | 10 ++-------- xcm/src/v1/mod.rs | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index ab854128a3dd..b855c965e4d2 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -4,15 +4,9 @@ mod xcm_generic; use frame_support::weights::Weight; use xcm_balances::WeightInfo as XcmBalancesWeight; -use crate::{Runtime, WndLocation}; +use crate::Runtime; use sp_std::prelude::*; -use xcm::{ - latest::{ - AssetId::*, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, OriginKind, - Response, Xcm, XcmWeightInfo, - }, - DoubleEncoded, -}; +use xcm::{latest::prelude::*, DoubleEncoded}; use xcm_generic::WeightInfo as XcmGeneric; pub enum AssetTypes { diff --git a/xcm/src/v1/mod.rs b/xcm/src/v1/mod.rs index e61cbf2f7f6f..24e548f454a2 100644 --- a/xcm/src/v1/mod.rs +++ b/xcm/src/v1/mod.rs @@ -66,6 +66,7 @@ pub mod prelude { traits::{Error as XcmError, ExecuteXcm, Outcome, Result as XcmResult, SendXcm}, OriginKind, Response, Xcm::{self, *}, + XcmWeightInfo, }; } From 65a9df8f64eccdfa80ec081c1a9b4e8197f09601 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 13:05:56 +0200 Subject: [PATCH 46/63] point to separate modules --- runtime/westend/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index b280bfb80bb8..9e82db920239 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1436,8 +1436,9 @@ sp_api::impl_runtime_apis! { list_benchmark!(list, extra, pallet_vesting, Vesting); // XCM Benchmarks - list_benchmark!(list, extra, pallet_xcm_benchmarks, XcmBalances); - list_benchmark!(list, extra, pallet_xcm_benchmarks, XcmGeneric); + // NOTE: Make sure you point to the individual modules below. + list_benchmark!(list, extra, pallet_xcm_benchmarks::fungible, XcmBalances); + list_benchmark!(list, extra, pallet_xcm_benchmarks::xcm_generic, XcmGeneric); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1538,8 +1539,9 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, pallet_vesting, Vesting); // XCM Benchmarks - add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmBalances); - add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmGeneric); + // NOTE: Make sure you point to the individual modules below. + add_benchmark!(params, batches, pallet_xcm_benchmarks::fungible, XcmBalances); + add_benchmark!(params, batches, pallet_xcm_benchmarks::xcm_generic, XcmGeneric); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) From d62420ee4a2af38f31c11df282ed8d4550f3b9f4 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 8 Aug 2021 15:16:06 +0200 Subject: [PATCH 47/63] temp fix, use zero weight --- xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 4819e5d3f004..ff4d36088e07 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -61,8 +61,8 @@ benchmarks! { let order = Order::>::BuyExecution { fees: (fee_asset, 100_000_000).into(), // should be something inside of holding - weight: 100_000_000, // TODO think about sensible numbers - debt: 100_000_000, // TODO think about sensible numbers + weight: 0, // TODO think about sensible numbers + debt: 0, // TODO think about sensible numbers halt_on_error: false, orders: Default::default(), // no orders instructions: Default::default(), // no instructions From 3c08461e4fc8bef3d3ed430db0e6280ae83e1b1f Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 10 Aug 2021 14:42:50 +0200 Subject: [PATCH 48/63] fix pallet-xcm-benchmarks --- .../src/fungible/benchmarking.rs | 6 +++--- xcm/pallet-xcm-benchmarks/src/fungible/mock.rs | 4 ++-- .../src/fungibles/benchmarking.rs | 6 +++--- xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs | 15 +++++++-------- xcm/pallet-xcm-benchmarks/src/lib.rs | 8 ++++---- xcm/pallet-xcm-benchmarks/src/mock.rs | 6 +++--- .../src/xcm_generic/benchmarking.rs | 12 ++++++------ xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs | 6 +++--- 8 files changed, 31 insertions(+), 32 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 53ba32c903da..05db4fa1aee9 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -40,7 +40,7 @@ benchmarks_instance_pallet! { } order_deposit_asset { - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); @@ -66,7 +66,7 @@ benchmarks_instance_pallet! { } order_deposit_reserve_asset { - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); @@ -95,7 +95,7 @@ benchmarks_instance_pallet! { } order_initiate_reserve_withdraw { - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(); let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); // generate the holding with a bunch of stuff.. diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index e4d9fbab3ff2..ad44d2ab1c27 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -144,7 +144,7 @@ parameter_types! { pub const ValidDestination: MultiLocation = X1(AccountId32 { network: NetworkId::Any, id: [0u8; 32], - }); + }).into(); } impl xcm_balances_benchmark::Config for Test { @@ -154,7 +154,7 @@ impl xcm_balances_benchmark::Config for Test { fn get_multi_asset() -> MultiAsset { let amount = >::minimum_balance() as u128; - MultiAsset { id: Concrete(MultiLocation::Here), fun: Fungible(amount) } + MultiAsset { id: Concrete(Here.into()), fun: Fungible(amount) } } } diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 454ecf9fb635..4747dc868222 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -51,7 +51,7 @@ benchmarks! { // orders. order_noop { let order = Order::>::Noop; - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let holding = Assets::default(); }: { assert_ok!(execute_order::(origin, holding, order)); @@ -60,13 +60,13 @@ benchmarks! { order_deposit_asset_per_asset { // create one asset with our desired id. let asset_id = 9; - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(asset_id); let order = Order::>::DepositAsset { assets: asset.clone().into(), max_assets: 1, - beneficiary: MultiLocation::X1(account_id_junction::(2)), + beneficiary: account_id_junction::(2).into(), }; let amount: u128 = T::TransactAsset::minimum_balance(asset_id.into()).try_into().unwrap(); diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index b4525304e436..661e0a5b365a 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -135,8 +135,10 @@ impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { // ^^ TODO: this error is too out of scope. use sp_runtime::traits::SaturatedConversion; match m { - MultiAsset { id: Concrete(X1(GeneralIndex { id })), fun: Fungible(amount) } => - Ok(((*id).saturated_into::(), (*amount).saturated_into::())), + MultiAsset { + id: Concrete(MultiLocation { parents: 0, interior: X1(GeneralIndex(inner_id)) }), + fun: Fungible(amount), + } => Ok(((*inner_id).saturated_into::(), (*amount).saturated_into::())), _ => Err(xcm_executor::traits::Error::AssetNotFound), } } @@ -144,10 +146,10 @@ impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { parameter_types! { pub const CheckedAccount: u64 = 100; - pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + pub const ValidDestination: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: [0u8; 32], - }); + }.into(); } pub type AssetTransactor = xcm_builder::FungiblesAdapter< @@ -193,10 +195,7 @@ impl xcm_assets_benchmarks::Config for Test { } let amount = >::minimum_balance(id) as u128; - MultiAsset { - id: Concrete(X1(Junction::GeneralIndex { id: id.into() })), - fun: Fungible(amount), - } + MultiAsset { id: Concrete(GeneralIndex(id.into()).into()), fun: Fungible(amount) } } } diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index e9142fddbf66..67cef749e453 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -75,14 +75,14 @@ pub fn worst_case_holding() -> Assets { (0..HOLDING_FUNGIBLES) .map(|i| { MultiAsset { - id: Concrete(X1(GeneralIndex { id: i as u128 })), + id: Concrete(GeneralIndex(i as u128).into()), fun: Fungible(fungibles_amount * i as u128), } .into() }) - .chain(core::iter::once(MultiAsset { id: Concrete(Here), fun: Fungible(u128::MAX) })) + .chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) })) .chain((0..HOLDING_NON_FUNGIBLES).map(|i| MultiAsset { - id: Concrete(X1(GeneralIndex { id: i as u128 })), + id: Concrete(GeneralIndex(i as u128).into()), fun: NonFungible(asset_instance_from(i)), })) .collect::>() @@ -128,7 +128,7 @@ fn account_id_junction(index: u32) -> Junction { } pub fn account_and_location(index: u32) -> (T::AccountId, MultiLocation) { - let location = MultiLocation::X1(account_id_junction::(index)); + let location: MultiLocation = account_id_junction::(index).into(); let account = T::AccountIdConverter::convert(location.clone()).unwrap(); (account, location) diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 454f76540093..065e1e4ada39 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -39,7 +39,7 @@ pub struct AccountIdConverter; impl xcm_executor::traits::Convert for AccountIdConverter { fn convert(ml: MultiLocation) -> Result { match ml { - MultiLocation::X1(Junction::AccountId32 { id, .. }) => + MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { id, .. }) } => Ok(::decode(&mut &*id.to_vec()).unwrap()), _ => Err(ml), } @@ -51,9 +51,9 @@ impl xcm_executor::traits::Convert for AccountIdConverter { } parameter_types! { - pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain(101)); + pub Ancestry: MultiLocation = Junction::Parachain(101).into(); pub UnitWeightCost: Weight = 10; - pub WeightPrice: (AssetId, u128) = (Concrete(Here), 1_000_000); + pub WeightPrice: (AssetId, u128) = (Concrete(Here.into()), 1_000_000); } pub struct AllAssetLocationsPass; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index ff4d36088e07..2c6684e06e7e 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -28,14 +28,14 @@ use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { order_noop { let order = Order::>::Noop; - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); }: { assert_ok!(execute_order::(origin, holding, order)); } order_query_holding { - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); let order = Order::>::QueryHolding { @@ -54,10 +54,10 @@ benchmarks! { // This benchmark does not use any additional orders or instructions. This should be managed // by the `deep` and `shallow` implementation. order_buy_execution { - let origin = MultiLocation::X1(account_id_junction::(1)); + let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); - let fee_asset = Concrete(Here); + let fee_asset = Concrete(Here.into()); let order = Order::>::BuyExecution { fees: (fee_asset, 100_000_000).into(), // should be something inside of holding @@ -77,7 +77,7 @@ benchmarks! { // filter through the reserve. xcm_reserve_asset_deposited { let (sender_account, sender_location) = account_and_location::(1); - let assets: MultiAssets = (Concrete(Here), 100).into();// TODO worst case + let assets: MultiAssets = (Concrete(Here.into()), 100).into();// TODO worst case // no effects to isolate this benchmark let effects: Vec> = Default::default(); @@ -155,7 +155,7 @@ benchmarks! { }; let xcm = Xcm::RelayedFrom { - who: Here, + who: Here.into(), message: sp_std::boxed::Box::new(noop_xcm), }; }: { diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 9c3dadf46f73..dec953f95fa7 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -101,10 +101,10 @@ impl xcm_executor::Config for XcmConfig { } parameter_types! { - pub const ValidDestination: MultiLocation = MultiLocation::X1(Junction::AccountId32 { + pub const ValidDestination: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: [0u8; 32], - }); + }.into(); } impl crate::Config for Test { @@ -117,7 +117,7 @@ impl xcm_generic_benchmarks::Config for Test { type Call = Call; fn worst_case_response() -> (u64, Response) { - let assets: MultiAssets = (Concrete(Here), 100).into(); + let assets: MultiAssets = (Concrete(Here.into()), 100).into(); (0, Response::Assets(assets)) } } From 0be427c8825e883521293ce20d6753cab3557331 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 10 Aug 2021 14:54:27 +0200 Subject: [PATCH 49/63] fix westend benchmarks --- runtime/westend/src/lib.rs | 5 +++-- runtime/westend/src/xcm_weights/mod.rs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 035141b8a1b5..18b2388246c4 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -908,8 +908,9 @@ pub type XcmRouter = ( ); parameter_types! { + pub const Westmint: MultiLocation = Parachain(1000).into(); pub const WestendForWestmint: (MultiAssetFilter, MultiLocation) = - (Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }), Parachain(1000).into()); + (Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }), Westmint::get()); } pub type TrustedTeleporters = (xcm_builder::Case,); @@ -1466,7 +1467,7 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = LocationConverter; - type ValidDestination = Westend; + type ValidDestination = Westmint; } impl pallet_xcm_benchmarks::xcm_generic::Config for Runtime { diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index b855c965e4d2..bcb212e5052b 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -17,7 +17,8 @@ pub enum AssetTypes { impl From<&MultiAsset> for AssetTypes { fn from(asset: &MultiAsset) -> Self { match asset { - MultiAsset { id: Concrete(Here), .. } => AssetTypes::Balances, + MultiAsset { id: Concrete(MultiLocation { parents: 0, interior: Here }), .. } => + AssetTypes::Balances, _ => AssetTypes::Unknown, } } From c352a6ef7bb05ef2bb010aba4ebd64d41ef7f5d0 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Thu, 12 Aug 2021 12:08:43 +0200 Subject: [PATCH 50/63] Delete mock2.rs --- .../src/fungible/mock2.rs | 276 ------------------ 1 file changed, 276 deletions(-) delete mode 100644 xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs deleted file mode 100644 index 32c9b255265d..000000000000 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock2.rs +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. - -// Polkadot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Polkadot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Polkadot. If not, see . - -//! A mock runtime for xcm benchmarking. - -use crate::{fungible as xcm_balances_benchmark, mock::*, Weight}; -use frame_support::{parameter_types, traits::All}; -use polkadot_runtime_common::xcm_sender; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; - -use xcm::latest::{ - Junction::Parachain, - MultiAsset::{self, AllConcreteFungible}, - MultiLocation::{self, Null, X1}, - NetworkId, Xcm, -}; -use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, - CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete, - LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, - TakeWeightCredit, UsingComponents, -}; -use xcm_executor::XcmExecutor; - -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; - -// For testing the pallet, we construct a mock runtime. -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - XcmBalancesBenchmark: xcm_balances_benchmark::{Pallet}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - } -); - -type AccountId = u64; - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1024); -} -impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::AllowAll; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Call = Call; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 7; -} - -type Balance = u64; - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - type Balance = Balance; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); -} - -/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location -/// of this chain. -pub type LocalOriginToLocation = ( - // And a usual Signed origin to be used in XCM as a corresponding AccountId32 - SignedToAccountId32, -); - -impl pallet_xcm::Config for Test { - type Event = Event; - type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; - type XcmRouter = XcmRouter; - // Anyone can execute XCM messages locally... - type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; - // ...but they must match our filter, which requires them to be a simple withdraw + teleport. - type XcmExecuteFilter = OnlyWithdrawTeleportForAccounts; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = All<(MultiLocation, Vec)>; - type XcmReserveTransferFilter = All<(MultiLocation, Vec)>; - type Weigher = FixedWeightBounds; -} - -parameter_types! { - pub const WndLocation: MultiLocation = MultiLocation::Null; - pub const Ancestry: MultiLocation = MultiLocation::Null; - pub WestendNetwork: NetworkId = NetworkId::Named(b"Westend".to_vec()); - pub CheckAccount: AccountId = XcmPallet::check_account(); -} - -pub struct OnlyWithdrawTeleportForAccounts; -impl frame_support::traits::Contains<(MultiLocation, Xcm)> - for OnlyWithdrawTeleportForAccounts -{ - fn contains((ref origin, ref msg): &(MultiLocation, Xcm)) -> bool { - use xcm::latest::{ - Junction::AccountId32, - MultiAsset::{All, ConcreteFungible}, - Order::{BuyExecution, DepositAsset, InitiateTeleport}, - Xcm::WithdrawAsset, - }; - match origin { - // Root is allowed to execute anything. - Null => true, - X1(AccountId32 { .. }) => { - // An account ID trying to send a message. We ensure that it's sensible. - // This checks that it's of the form: - // WithdrawAsset { - // assets: [ ConcreteFungible { id: Null } ], - // effects: [ BuyExecution, InitiateTeleport { - // assets: All, - // dest: Parachain, - // effects: [ BuyExecution, DepositAssets { - // assets: All, - // dest: AccountId32, - // } ] - // } ] - // } - matches!(msg, WithdrawAsset { ref assets, ref effects } - if assets.len() == 1 - && matches!(assets[0], ConcreteFungible { id: Null, .. }) - && effects.len() == 2 - && matches!(effects[0], BuyExecution { .. }) - && matches!(effects[1], InitiateTeleport { ref assets, dest: X1(Parachain(..)), ref effects } - if assets.len() == 1 - && matches!(assets[0], All) - && effects.len() == 2 - && matches!(effects[0], BuyExecution { .. }) - && matches!(effects[1], DepositAsset { ref assets, dest: X1(AccountId32{..}) } - if assets.len() == 1 - && matches!(assets[0], All) - ) - ) - ) - }, - // Nobody else is allowed to execute anything. - _ => false, - } - } -} - -pub type LocationConverter = - (ChildParachainConvertsVia, AccountId32Aliases); - -pub type LocalAssetTransactor = XcmCurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // We can convert the MultiLocations with our converter above: - LocationConverter, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // It's a native asset so we keep track of the teleports to maintain total issuance. - CheckAccount, ->; - -type LocalOriginConverter = ( - SovereignSignedViaLocation, - //ChildParachainAsNative, - SignedAccountId32AsNative, - ChildSystemParachainAsSuperuser, -); - -parameter_types! { - pub const BaseXcmWeight: Weight = 10_000_000; -} - -/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our -/// individual routers. -pub type XcmRouter = ( - // Only one router so far - use DMP to communicate with child parachains. - xcm_sender::ChildParachainRouter, -); - -parameter_types! { - pub const WestendForWestmint: (MultiAsset, MultiLocation) = - (AllConcreteFungible { id: Null }, X1(Parachain(1000))); -} -pub type TrustedTeleporters = (xcm_builder::Case,); - -/// The barriers one of which must be passed for an XCM message to be executed. -pub type Barrier = ( - // Weight that is paid for may be consumed. - TakeWeightCredit, - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom, - // Messages coming from system parachains need not pay for execution. - AllowUnpaidExecutionFrom>, -); - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = LocalOriginConverter; - type IsReserve = (); - type IsTeleporter = TrustedTeleporters; - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - UsingComponents, WndLocation, AccountId, Balances, ToAuthor>; - type ResponseHandler = (); -} - -impl crate::Config for Test { - type XcmConfig = XcmConfig; - type AccountIdConverter = AccountIdConverter; -} - -impl xcm_balances_benchmark::Config for Test { - type TransactAsset = Balances; - type CheckedAccount = CheckedAccount; - fn get_multi_asset() -> MultiAsset { - let amount = - >::minimum_balance() as u128; - MultiAsset::ConcreteFungible { id: MultiLocation::Null, amount } - } -} - -pub fn new_test_ext() -> sp_io::TestExternalities { - let t = GenesisConfig { ..Default::default() }.build_storage().unwrap(); - sp_tracing::try_init_simple(); - t.into() -} From 8c0191a4e014a89a11921fe4b734b617636eeed3 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Thu, 19 Aug 2021 21:39:27 +0200 Subject: [PATCH 51/63] fix merge --- Cargo.lock | 349 ++++++++++-------- runtime/westend/src/xcm_weights/mod.rs | 2 +- .../src/xcm_generic/benchmarking.rs | 3 +- xcm/src/v1/order.rs | 7 +- xcm/src/v1/traits.rs | 7 +- xcm/xcm-executor/src/traits/weight.rs | 11 +- 6 files changed, 206 insertions(+), 173 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7048f9a87126..786ea8c6040d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,9 +572,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" @@ -1923,7 +1923,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", ] @@ -1941,7 +1941,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "Inflector", "chrono", @@ -1986,7 +1986,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -1999,7 +1999,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -2014,7 +2014,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "serde", @@ -2025,7 +2025,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "bitflags", "frame-metadata", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2063,7 +2063,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2075,7 +2075,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro2", "quote", @@ -2085,7 +2085,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-metadata", "frame-support", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "log", @@ -2132,7 +2132,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -2146,7 +2146,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-api", @@ -2155,7 +2155,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "sp-api", @@ -4551,10 +4551,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -4569,7 +4582,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -4583,7 +4596,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4606,7 +4619,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4661,7 +4674,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4739,7 +4752,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4755,7 +4768,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4770,7 +4783,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4793,7 +4806,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4810,7 +4823,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4824,7 +4837,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4846,7 +4859,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4861,7 +4874,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4880,7 +4893,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4896,7 +4909,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4911,7 +4924,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4928,7 +4941,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -4944,7 +4957,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4961,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4975,7 +4988,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -4988,7 +5001,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5004,7 +5017,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5026,7 +5039,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5040,7 +5053,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5053,7 +5066,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5068,7 +5081,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5088,7 +5101,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5104,7 +5117,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5117,7 +5130,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5139,7 +5152,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5150,7 +5163,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "sp-arithmetic", @@ -5159,7 +5172,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5172,7 +5185,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5189,7 +5202,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5204,7 +5217,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-support", "frame-system", @@ -5220,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5237,7 +5250,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5248,7 +5261,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5264,7 +5277,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5279,7 +5292,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5310,6 +5323,30 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.3.1" @@ -7812,7 +7849,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "env_logger 0.9.0", "jsonrpsee-proc-macros", @@ -8094,7 +8131,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "sp-core", @@ -8105,7 +8142,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "derive_more", @@ -8132,7 +8169,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8155,7 +8192,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8171,7 +8208,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8187,7 +8224,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8198,7 +8235,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "chrono", "fdlimit", @@ -8236,7 +8273,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "fnv", "futures 0.3.16", @@ -8264,7 +8301,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "hash-db", "kvdb", @@ -8289,7 +8326,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "futures 0.3.16", @@ -8313,7 +8350,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "derive_more", @@ -8356,7 +8393,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "derive_more", "futures 0.3.16", @@ -8380,7 +8417,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8393,7 +8430,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "assert_matches", "async-trait", @@ -8427,7 +8464,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "futures 0.3.16", @@ -8453,7 +8490,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "sc-client-api", "sp-authorship", @@ -8464,7 +8501,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "lazy_static", "libsecp256k1 0.6.0", @@ -8490,7 +8527,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "derive_more", "parity-scale-codec", @@ -8507,7 +8544,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "parity-scale-codec", @@ -8523,7 +8560,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8542,7 +8579,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "derive_more", @@ -8579,7 +8616,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "derive_more", "finality-grandpa", @@ -8603,7 +8640,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "ansi_term 0.12.1", "futures 0.3.16", @@ -8620,7 +8657,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "derive_more", @@ -8635,7 +8672,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "hash-db", "parity-scale-codec", @@ -8653,7 +8690,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-std", "async-trait", @@ -8704,7 +8741,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8720,7 +8757,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "bytes 1.0.1", "fnv", @@ -8747,7 +8784,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "libp2p", @@ -8760,7 +8797,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8769,7 +8806,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "hash-db", @@ -8800,7 +8837,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "derive_more", "futures 0.3.16", @@ -8825,7 +8862,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "jsonrpc-core", @@ -8841,7 +8878,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "directories", @@ -8905,7 +8942,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "parity-scale-codec", @@ -8919,7 +8956,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8941,7 +8978,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "chrono", "futures 0.3.16", @@ -8959,7 +8996,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8990,7 +9027,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9001,7 +9038,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "intervalier", @@ -9028,7 +9065,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "derive_more", "futures 0.3.16", @@ -9462,7 +9499,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "hash-db", "log", @@ -9479,7 +9516,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9491,7 +9528,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "serde", @@ -9503,7 +9540,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "integer-sqrt", "num-traits", @@ -9517,7 +9554,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-api", @@ -9529,7 +9566,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "parity-scale-codec", @@ -9541,7 +9578,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-api", @@ -9553,7 +9590,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "log", @@ -9571,7 +9608,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "futures 0.3.16", @@ -9590,7 +9627,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "merlin", @@ -9612,7 +9649,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9622,7 +9659,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9634,7 +9671,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "base58", "blake2-rfc", @@ -9678,7 +9715,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9687,7 +9724,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro2", "quote", @@ -9697,7 +9734,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "environmental", "parity-scale-codec", @@ -9708,7 +9745,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "finality-grandpa", "log", @@ -9725,7 +9762,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9739,7 +9776,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "hash-db", @@ -9764,7 +9801,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "lazy_static", "sp-core", @@ -9775,7 +9812,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "derive_more", @@ -9792,7 +9829,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "ruzstd", "zstd", @@ -9801,7 +9838,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "serde", @@ -9814,7 +9851,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9825,7 +9862,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "sp-api", "sp-core", @@ -9835,7 +9872,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "backtrace", ] @@ -9843,7 +9880,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "rustc-hash", "serde", @@ -9853,7 +9890,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "either", "hash256-std-hasher", @@ -9874,7 +9911,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9891,7 +9928,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9903,7 +9940,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "serde", "serde_json", @@ -9912,7 +9949,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-api", @@ -9925,7 +9962,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9935,7 +9972,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "hash-db", "log", @@ -9958,12 +9995,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9976,7 +10013,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "sp-core", @@ -9989,7 +10026,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -10005,7 +10042,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "erased-serde", "log", @@ -10023,7 +10060,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "sp-api", "sp-runtime", @@ -10032,7 +10069,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "log", @@ -10047,7 +10084,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "hash-db", "memory-db", @@ -10061,7 +10098,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -10072,7 +10109,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10087,7 +10124,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10098,7 +10135,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10293,7 +10330,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "platforms", ] @@ -10301,7 +10338,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.16", @@ -10323,7 +10360,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-std", "derive_more", @@ -10337,7 +10374,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "async-trait", "futures 0.3.16", @@ -10364,7 +10401,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "futures 0.3.16", "substrate-test-utils-derive", @@ -10374,7 +10411,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10384,7 +10421,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -10539,7 +10576,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "frame-system", "futures 0.3.16", @@ -10990,7 +11027,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#74e839b8690725873423885bef2e0af7d878fc6e" +source = "git+https://github.com/paritytech/substrate?branch=master#c6c912cfce1c759ffb64a991bb07974a98edd89f" dependencies = [ "log", "parity-scale-codec", @@ -11658,6 +11695,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -11806,6 +11844,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-balances", "pallet-transaction-payment", "pallet-xcm", diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index bcb212e5052b..eb91f526c19a 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -157,7 +157,7 @@ impl XcmWeightInfo<()> for WestendXcmWeight { fn xcm_hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { XcmGeneric::::xcm_hrmp_channel_closing() } - fn xcm_relayed_from(_who: &MultiLocation, _message: &Box>) -> Weight { + fn xcm_relayed_from(_who: &Junctions, _message: &Box>) -> Weight { XcmGeneric::::xcm_relayed_from() } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 2c6684e06e7e..be4c2a02839c 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -64,7 +64,6 @@ benchmarks! { weight: 0, // TODO think about sensible numbers debt: 0, // TODO think about sensible numbers halt_on_error: false, - orders: Default::default(), // no orders instructions: Default::default(), // no instructions }; } : { @@ -155,7 +154,7 @@ benchmarks! { }; let xcm = Xcm::RelayedFrom { - who: Here.into(), + who: Here, message: sp_std::boxed::Box::new(noop_xcm), }; }: { diff --git a/xcm/src/v1/order.rs b/xcm/src/v1/order.rs index 2fed44bc1efa..05a554bf8a9d 100644 --- a/xcm/src/v1/order.rs +++ b/xcm/src/v1/order.rs @@ -17,7 +17,8 @@ //! Version 1 of the Cross-Consensus Message format data structures. use super::{ - super::v0::Order as Order0, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Xcm, + super::v0::Order as Order0, GetWeight, MultiAsset, MultiAssetFilter, MultiAssets, + MultiLocation, Weight, Xcm, XcmWeightInfo, }; use alloc::vec::Vec; use core::{ @@ -249,8 +250,8 @@ impl> GetWeight for Order<()> { W::order_initiate_teleport(assets, dest, effects), Order::QueryHolding { query_id, dest, assets } => W::order_query_holding(query_id, dest, assets), - Order::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => - W::order_buy_execution(fees, weight, debt, halt_on_error, orders, instructions), + Order::BuyExecution { fees, weight, debt, halt_on_error, instructions } => + W::order_buy_execution(fees, weight, debt, halt_on_error, instructions), } } } diff --git a/xcm/src/v1/traits.rs b/xcm/src/v1/traits.rs index fd844f5a78af..9c2b6b577667 100644 --- a/xcm/src/v1/traits.rs +++ b/xcm/src/v1/traits.rs @@ -21,8 +21,8 @@ use core::result; use parity_scale_codec::{Decode, Encode}; use super::{ - DoubleEncoded, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, OriginKind, - Response, Xcm, + DoubleEncoded, Junctions, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, + OriginKind, Response, Xcm, }; #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug)] @@ -314,7 +314,6 @@ pub trait XcmWeightInfo { weight: &u64, debt: &u64, halt_on_error: &bool, - orders: &Vec>, instructions: &Vec>, ) -> Weight; fn xcm_withdraw_asset(assets: &MultiAssets, effects: &Vec>) -> Weight; @@ -340,5 +339,5 @@ pub trait XcmWeightInfo { ) -> Weight; fn xcm_hrmp_channel_accepted(recipient: &u32) -> Weight; fn xcm_hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; - fn xcm_relayed_from(who: &MultiLocation, message: &alloc::boxed::Box>) -> Weight; + fn xcm_relayed_from(who: &Junctions, message: &alloc::boxed::Box>) -> Weight; } diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index 9efab4bd4806..242833333c18 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -192,31 +192,26 @@ where { fn shallow_order(order: &mut Order) -> Result { Ok(match order { - Order::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => { + Order::BuyExecution { fees, weight, debt, halt_on_error, instructions } => { // On success, execution of this will result in more weight being consumed but // we don't count it here since this is only the *shallow*, non-negotiable weight // spend and doesn't count weight placed behind a `BuyExecution` since it will not // be definitely consumed from any existing weight credit if execution of the message // is attempted. - W::order_buy_execution(fees, weight, debt, halt_on_error, orders, instructions) + W::order_buy_execution(fees, weight, debt, halt_on_error, instructions) }, _ => 0, // TODO check }) } fn deep_order(order: &mut Order) -> Result { Ok(match order { - Order::BuyExecution { orders, instructions, .. } => { + Order::BuyExecution { instructions, .. } => { let mut extra = 0; for instruction in instructions.iter_mut() { extra.saturating_accrue( Self::shallow(instruction)?.saturating_add(Self::deep(instruction)?), ); } - for order in orders.iter_mut() { - extra.saturating_accrue( - Self::shallow_order(order)?.saturating_add(Self::deep_order(order)?), - ); - } extra }, _ => 0, From 91b2c138421265f1170839e33e8f0d992c41e096 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 02:10:02 -0400 Subject: [PATCH 52/63] update trait for v2 --- Cargo.lock | 463 +++++++++++++++++++++---------------------- xcm/src/lib.rs | 5 + xcm/src/v1/mod.rs | 28 +-- xcm/src/v1/order.rs | 21 -- xcm/src/v1/traits.rs | 75 +------ xcm/src/v2/mod.rs | 53 ++++- xcm/src/v2/traits.rs | 64 +++++- 7 files changed, 342 insertions(+), 367 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 595a731089ea..ceed886fa663 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1283,7 +1283,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools 0.10.1", + "itertools", "log", "serde", "smallvec", @@ -1920,7 +1920,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", ] @@ -1938,7 +1938,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -1957,7 +1957,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "Inflector", "chrono", @@ -1983,7 +1983,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -2011,7 +2011,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "serde", @@ -2022,7 +2022,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "bitflags", "frame-metadata", @@ -2048,7 +2048,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2060,7 +2060,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2072,7 +2072,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro2", "quote", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-metadata", "frame-support", @@ -2103,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -2113,7 +2113,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "log", @@ -2129,7 +2129,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -2143,7 +2143,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-api", @@ -2152,7 +2152,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "sp-api", @@ -2861,15 +2861,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.1" @@ -3379,8 +3370,8 @@ dependencies = [ "multistream-select", "parking_lot 0.11.1", "pin-project 1.0.8", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", @@ -3429,8 +3420,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.7.3", "smallvec", ] @@ -3451,8 +3442,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.7.3", "regex", "sha2 0.9.2", @@ -3471,8 +3462,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "smallvec", "wasm-timer", ] @@ -3492,8 +3483,8 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.7.3", "sha2 0.9.2", "smallvec", @@ -3554,8 +3545,8 @@ dependencies = [ "lazy_static", "libp2p-core", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.8.4", "sha2 0.9.2", "snow", @@ -3590,8 +3581,8 @@ dependencies = [ "futures 0.3.16", "libp2p-core", "log", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "unsigned-varint 0.7.0", "void", ] @@ -3624,8 +3615,8 @@ dependencies = [ "libp2p-swarm", "log", "pin-project 1.0.8", - "prost 0.8.0", - "prost-build 0.8.0", + "prost", + "prost-build", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.0", @@ -4536,10 +4527,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -4554,7 +4558,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -4568,7 +4572,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4591,7 +4595,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4646,7 +4650,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4724,7 +4728,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4740,7 +4744,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4755,7 +4759,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4778,7 +4782,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4795,7 +4799,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4809,7 +4813,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4831,7 +4835,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4846,7 +4850,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4865,7 +4869,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4881,7 +4885,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4896,7 +4900,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4913,7 +4917,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -4929,7 +4933,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4946,7 +4950,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -4960,7 +4964,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -4973,7 +4977,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -4989,7 +4993,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5011,7 +5015,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5025,7 +5029,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -5038,7 +5042,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5053,7 +5057,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -5073,7 +5077,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5089,7 +5093,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -5102,7 +5106,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5124,7 +5128,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5135,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "sp-arithmetic", @@ -5144,7 +5148,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -5157,7 +5161,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5174,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5189,7 +5193,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-support", "frame-system", @@ -5205,7 +5209,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5222,7 +5226,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5233,7 +5237,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5249,7 +5253,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5264,7 +5268,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-benchmarking", "frame-support", @@ -5296,6 +5300,30 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.3.1" @@ -6374,7 +6402,7 @@ dependencies = [ "derive_more", "env_logger 0.9.0", "futures 0.3.16", - "itertools 0.10.1", + "itertools", "log", "lru", "metered-channel", @@ -7246,16 +7274,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prost" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" -dependencies = [ - "bytes 1.0.1", - "prost-derive 0.7.0", -] - [[package]] name = "prost" version = "0.8.0" @@ -7263,25 +7281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ "bytes 1.0.1", - "prost-derive 0.8.0", -] - -[[package]] -name = "prost-build" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" -dependencies = [ - "bytes 1.0.1", - "heck", - "itertools 0.9.0", - "log", - "multimap", - "petgraph", - "prost 0.7.0", - "prost-types 0.7.0", - "tempfile", - "which", + "prost-derive", ] [[package]] @@ -7292,29 +7292,16 @@ checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" dependencies = [ "bytes 1.0.1", "heck", - "itertools 0.10.1", + "itertools", "log", "multimap", "petgraph", - "prost 0.8.0", - "prost-types 0.8.0", + "prost", + "prost-types", "tempfile", "which", ] -[[package]] -name = "prost-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" -dependencies = [ - "anyhow", - "itertools 0.9.0", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.8.0" @@ -7322,22 +7309,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" dependencies = [ "anyhow", - "itertools 0.10.1", + "itertools", "proc-macro2", "quote", "syn", ] -[[package]] -name = "prost-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" -dependencies = [ - "bytes 1.0.1", - "prost 0.7.0", -] - [[package]] name = "prost-types" version = "0.8.0" @@ -7345,7 +7322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ "bytes 1.0.1", - "prost 0.8.0", + "prost", ] [[package]] @@ -7624,7 +7601,7 @@ checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" dependencies = [ "derive_more", "fs-err", - "itertools 0.10.1", + "itertools", "static_init", "thiserror", ] @@ -7704,7 +7681,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "env_logger 0.9.0", "jsonrpsee-proc-macros", @@ -7973,7 +7950,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "sp-core", @@ -7984,7 +7961,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "derive_more", @@ -7994,8 +7971,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.8.0", - "prost-build 0.7.0", + "prost", + "prost-build", "rand 0.7.3", "sc-client-api", "sc-network", @@ -8011,7 +7988,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8034,7 +8011,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8050,7 +8027,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8066,7 +8043,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8077,7 +8054,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "chrono", "fdlimit", @@ -8115,7 +8092,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "fnv", "futures 0.3.16", @@ -8143,7 +8120,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "hash-db", "kvdb", @@ -8168,7 +8145,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "futures 0.3.16", @@ -8192,7 +8169,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "derive_more", @@ -8235,7 +8212,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "derive_more", "futures 0.3.16", @@ -8259,7 +8236,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8272,7 +8249,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "assert_matches", "async-trait", @@ -8306,7 +8283,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "futures 0.3.16", @@ -8332,7 +8309,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "sc-client-api", "sp-authorship", @@ -8343,7 +8320,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "lazy_static", "libsecp256k1 0.6.0", @@ -8369,7 +8346,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "derive_more", "parity-scale-codec", @@ -8386,7 +8363,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "parity-scale-codec", @@ -8402,7 +8379,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8421,7 +8398,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "derive_more", @@ -8458,7 +8435,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "derive_more", "finality-grandpa", @@ -8482,7 +8459,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "ansi_term 0.12.1", "futures 0.3.16", @@ -8499,7 +8476,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "derive_more", @@ -8514,7 +8491,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "hash-db", "parity-scale-codec", @@ -8532,7 +8509,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-std", "async-trait", @@ -8556,8 +8533,8 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", "pin-project 1.0.8", - "prost 0.8.0", - "prost-build 0.7.0", + "prost", + "prost-build", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -8583,7 +8560,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -8599,7 +8576,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "bytes 1.0.1", "fnv", @@ -8626,7 +8603,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "libp2p", @@ -8639,7 +8616,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8648,7 +8625,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "hash-db", @@ -8679,7 +8656,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "jsonrpc-core", @@ -8704,7 +8681,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "jsonrpc-core", @@ -8720,7 +8697,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "directories", @@ -8784,7 +8761,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "parity-scale-codec", @@ -8798,7 +8775,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8820,7 +8797,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "chrono", "futures 0.3.16", @@ -8838,7 +8815,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8867,7 +8844,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8878,7 +8855,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "intervalier", @@ -8905,7 +8882,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "derive_more", "futures 0.3.16", @@ -9339,7 +9316,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "hash-db", "log", @@ -9356,7 +9333,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9368,7 +9345,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "serde", @@ -9380,7 +9357,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "integer-sqrt", "num-traits", @@ -9394,7 +9371,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-api", @@ -9406,7 +9383,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "parity-scale-codec", @@ -9418,7 +9395,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-api", @@ -9430,7 +9407,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "log", @@ -9448,7 +9425,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "futures 0.3.16", @@ -9467,7 +9444,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "merlin", @@ -9489,7 +9466,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9499,7 +9476,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9511,7 +9488,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "base58", "blake2-rfc", @@ -9555,7 +9532,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9564,7 +9541,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro2", "quote", @@ -9574,7 +9551,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "environmental", "parity-scale-codec", @@ -9585,7 +9562,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "finality-grandpa", "log", @@ -9602,7 +9579,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9616,7 +9593,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "hash-db", @@ -9641,7 +9618,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "lazy_static", "sp-core", @@ -9652,7 +9629,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "derive_more", @@ -9669,7 +9646,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "ruzstd", "zstd", @@ -9678,7 +9655,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "serde", @@ -9691,7 +9668,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9702,7 +9679,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "sp-api", "sp-core", @@ -9712,7 +9689,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "backtrace", ] @@ -9720,7 +9697,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "rustc-hash", "serde", @@ -9730,7 +9707,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "either", "hash256-std-hasher", @@ -9751,7 +9728,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9768,7 +9745,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9780,7 +9757,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "serde", "serde_json", @@ -9789,7 +9766,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-api", @@ -9802,7 +9779,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9812,7 +9789,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "hash-db", "log", @@ -9835,12 +9812,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9853,7 +9830,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "sp-core", @@ -9866,7 +9843,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -9882,7 +9859,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "erased-serde", "log", @@ -9900,7 +9877,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "sp-api", "sp-runtime", @@ -9909,7 +9886,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "log", @@ -9924,7 +9901,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "hash-db", "memory-db", @@ -9938,7 +9915,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "futures-timer 3.0.2", @@ -9949,7 +9926,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9964,7 +9941,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9975,7 +9952,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10169,7 +10146,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "platforms", ] @@ -10177,7 +10154,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.16", @@ -10199,7 +10176,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-std", "derive_more", @@ -10213,7 +10190,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "async-trait", "futures 0.3.16", @@ -10240,7 +10217,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "futures 0.3.16", "substrate-test-utils-derive", @@ -10250,7 +10227,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -10261,7 +10238,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -10414,7 +10391,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "frame-system", "futures 0.3.16", @@ -10821,7 +10798,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#6d0c04d58fc614f61072f6dde1a1716fb8072a44" +source = "git+https://github.com/paritytech/substrate?branch=master#0f934e970501136c7370a3bbd234b96c81f59cba" dependencies = [ "log", "parity-scale-codec", @@ -11489,6 +11466,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -11635,6 +11613,7 @@ version = "0.9.9" dependencies = [ "frame-support", "frame-system", + "log", "pallet-balances", "pallet-transaction-payment", "pallet-xcm", diff --git a/xcm/src/lib.rs b/xcm/src/lib.rs index cfa5735559aa..e4a1b8b07ecd 100644 --- a/xcm/src/lib.rs +++ b/xcm/src/lib.rs @@ -474,3 +474,8 @@ pub mod opaque { /// The basic `VersionedXcm` type which just uses the `Vec` as an encoded call. pub type VersionedXcm = super::VersionedXcm<()>; } + +// A simple trait to get the weight of some object. +pub trait GetWeight { + fn weight(&self) -> latest::Weight; +} diff --git a/xcm/src/v1/mod.rs b/xcm/src/v1/mod.rs index 0b66dead4965..c26a6f0f2f17 100644 --- a/xcm/src/v1/mod.rs +++ b/xcm/src/v1/mod.rs @@ -45,7 +45,7 @@ pub use multilocation::{ Ancestor, AncestorThen, InteriorMultiLocation, Junctions, MultiLocation, Parent, ParentThen, }; pub use order::Order; -pub use traits::{Error, ExecuteXcm, GetWeight, Outcome, Result, SendXcm, Weight, XcmWeightInfo}; +pub use traits::{Error, ExecuteXcm, Outcome, Result, SendXcm, Weight}; // These parts of XCM v0 have been unchanged in XCM v1, and are re-imported here. pub use super::v0::{BodyId, BodyPart, NetworkId, OriginKind}; @@ -71,7 +71,6 @@ pub mod prelude { WildFungibility::{self, Fungible as WildFungible, NonFungible as WildNonFungible}, WildMultiAsset::{self, *}, Xcm::{self, *}, - XcmWeightInfo, }; } @@ -402,31 +401,6 @@ impl TryFrom> for Xcm { } } -impl> GetWeight for Xcm<()> { - fn weight(&self) -> Weight { - match self { - Xcm::WithdrawAsset { assets, effects } => W::xcm_withdraw_asset(assets, effects), - Xcm::ReserveAssetDeposited { assets, effects } => - W::xcm_reserve_asset_deposited(assets, effects), - Xcm::ReceiveTeleportedAsset { assets, effects } => - W::xcm_receive_teleported_asset(assets, effects), - Xcm::QueryResponse { query_id, response } => W::xcm_query_response(query_id, response), - Xcm::TransferAsset { assets, beneficiary } => - W::xcm_transfer_asset(assets, beneficiary), - Xcm::TransferReserveAsset { assets, dest, effects } => - W::xcm_transfer_reserve_asset(&assets, dest, effects), - Xcm::Transact { origin_type, require_weight_at_most, call } => - W::xcm_transact(origin_type, require_weight_at_most, call), - Xcm::HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => - W::xcm_hrmp_new_channel_open_request(sender, max_message_size, max_capacity), - Xcm::HrmpChannelAccepted { recipient } => W::xcm_hrmp_channel_accepted(recipient), - Xcm::HrmpChannelClosing { initiator, sender, recipient } => - W::xcm_hrmp_channel_closing(initiator, sender, recipient), - Xcm::RelayedFrom { who, message } => W::xcm_relayed_from(who, message), - } - } -} - impl TryFrom> for Xcm { type Error = (); fn try_from(old: NewXcm) -> result::Result, ()> { diff --git a/xcm/src/v1/order.rs b/xcm/src/v1/order.rs index f4a51146f4a1..9b8a7591f183 100644 --- a/xcm/src/v1/order.rs +++ b/xcm/src/v1/order.rs @@ -233,27 +233,6 @@ impl TryFrom> for Order { } } -impl> GetWeight for Order<()> { - fn weight(&self) -> Weight { - match self { - Order::Noop => W::order_noop(), - Order::DepositAsset { assets, max_assets, beneficiary } => - W::order_deposit_asset(assets, max_assets, beneficiary), - Order::DepositReserveAsset { assets, max_assets, dest, effects } => - W::order_deposit_reserve_asset(assets, max_assets, dest, effects), - Order::ExchangeAsset { give, receive } => W::order_exchange_asset(give, receive), - Order::InitiateReserveWithdraw { assets, reserve, effects } => - W::order_initiate_reserve_withdraw(assets, reserve, effects), - Order::InitiateTeleport { assets, dest, effects } => - W::order_initiate_teleport(assets, dest, effects), - Order::QueryHolding { query_id, dest, assets } => - W::order_query_holding(query_id, dest, assets), - Order::BuyExecution { fees, weight, debt, halt_on_error, instructions } => - W::order_buy_execution(fees, weight, debt, halt_on_error, instructions), - } - } -} - impl TryFrom> for Order { type Error = (); fn try_from(old: Instruction) -> result::Result, ()> { diff --git a/xcm/src/v1/traits.rs b/xcm/src/v1/traits.rs index 9c2b6b577667..892b6afea9f7 100644 --- a/xcm/src/v1/traits.rs +++ b/xcm/src/v1/traits.rs @@ -16,14 +16,10 @@ //! Cross-Consensus Message format data structures. -use alloc::vec::Vec; use core::result; use parity_scale_codec::{Decode, Encode}; -use super::{ - DoubleEncoded, Junctions, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Order, - OriginKind, Response, Xcm, -}; +use super::{MultiLocation, Xcm}; #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug)] pub enum Error { @@ -272,72 +268,3 @@ impl SendXcm for Tuple { Err(Error::CannotReachDestination(destination, message)) } } - -// A simple trait to get the weight of some object. -pub trait GetWeight { - fn weight(&self) -> Weight; -} - -// TODO: Macro to generate this -// The info needed to weight an XCM. -pub trait XcmWeightInfo { - fn order_noop() -> Weight; - fn order_deposit_asset( - assets: &MultiAssetFilter, - max_assets: &u32, - dest: &MultiLocation, - ) -> Weight; - fn order_deposit_reserve_asset( - assets: &MultiAssetFilter, - max_assets: &u32, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_exchange_asset(give: &MultiAssetFilter, receive: &MultiAssets) -> Weight; - fn order_initiate_reserve_withdraw( - assets: &MultiAssetFilter, - reserve: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_initiate_teleport( - assets: &MultiAssetFilter, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - fn order_query_holding( - query_id: &u64, - dest: &MultiLocation, - assets: &MultiAssetFilter, - ) -> Weight; - fn order_buy_execution( - fees: &MultiAsset, - weight: &u64, - debt: &u64, - halt_on_error: &bool, - instructions: &Vec>, - ) -> Weight; - fn xcm_withdraw_asset(assets: &MultiAssets, effects: &Vec>) -> Weight; - fn xcm_reserve_asset_deposited(assets: &MultiAssets, effects: &Vec>) -> Weight; - fn xcm_receive_teleported_asset(assets: &MultiAssets, effects: &Vec>) -> Weight; - fn xcm_query_response(query_id: &u64, response: &Response) -> Weight; - fn xcm_transfer_asset(assets: &MultiAssets, beneficiary: &MultiLocation) -> Weight; - fn xcm_transfer_reserve_asset( - assets: &MultiAssets, - dest: &MultiLocation, - effects: &Vec>, - ) -> Weight; - // TODO: &Maybe remove call - fn xcm_transact( - origin_type: &OriginKind, - require_weight_at_most: &u64, - call: &DoubleEncoded, - ) -> Weight; - fn xcm_hrmp_new_channel_open_request( - sender: &u32, - max_message_size: &u32, - max_capacity: &u32, - ) -> Weight; - fn xcm_hrmp_channel_accepted(recipient: &u32) -> Weight; - fn xcm_hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; - fn xcm_relayed_from(who: &Junctions, message: &alloc::boxed::Box>) -> Weight; -} diff --git a/xcm/src/v2/mod.rs b/xcm/src/v2/mod.rs index 533aef468701..b73c657a9de8 100644 --- a/xcm/src/v2/mod.rs +++ b/xcm/src/v2/mod.rs @@ -17,7 +17,7 @@ //! Version 1 of the Cross-Consensus Message format data structures. use super::v1::{Order as OldOrder, Response as OldResponse, Xcm as OldXcm}; -use crate::DoubleEncoded; +use crate::{DoubleEncoded, GetWeight}; use alloc::{vec, vec::Vec}; use core::{ convert::{TryFrom, TryInto}, @@ -29,7 +29,9 @@ use parity_scale_codec::{self, Decode, Encode}; mod traits; -pub use traits::{Error, ExecuteXcm, Outcome, Result, SendError, SendResult, SendXcm}; +pub use traits::{ + Error, ExecuteXcm, Outcome, Result, SendError, SendResult, SendXcm, Weight, XcmWeightInfo, +}; // These parts of XCM v1 have been unchanged in XCM v2, and are re-imported here. pub use super::v1::{ Ancestor, AncestorThen, AssetId, AssetInstance, BodyId, BodyPart, Fungibility, @@ -670,6 +672,53 @@ impl Instruction { } } +impl> GetWeight for Instruction<()> { + fn weight(&self) -> Weight { + use Instruction::*; + match self { + WithdrawAsset(assets) => W::withdraw_asset(assets), + ReserveAssetDeposited(assets) => W::reserve_asset_deposited(assets), + ReceiveTeleportedAsset(assets) => W::receive_teleported_asset(assets), + QueryResponse { query_id, response, max_weight } => + W::query_response(query_id, response, max_weight), + TransferAsset { assets, beneficiary } => W::transfer_asset(assets, beneficiary), + TransferReserveAsset { assets, dest, xcm } => + W::transfer_reserve_asset(&assets, dest, xcm), + Transact { origin_type, require_weight_at_most, call } => + W::transact(origin_type, require_weight_at_most, call), + HrmpNewChannelOpenRequest { sender, max_message_size, max_capacity } => + W::hrmp_new_channel_open_request(sender, max_message_size, max_capacity), + HrmpChannelAccepted { recipient } => W::hrmp_channel_accepted(recipient), + HrmpChannelClosing { initiator, sender, recipient } => + W::hrmp_channel_closing(initiator, sender, recipient), + ClearOrigin => W::clear_origin(), + DescendOrigin(who) => W::descend_origin(who), + ReportError { query_id, dest, max_response_weight } => + W::report_error(query_id, dest, max_response_weight), + DepositAsset { assets, max_assets, beneficiary } => + W::deposit_asset(assets, max_assets, beneficiary), + DepositReserveAsset { assets, max_assets, dest, xcm } => + W::deposit_reserve_asset(assets, max_assets, dest, xcm), + ExchangeAsset { give, receive } => W::exchange_asset(give, receive), + InitiateReserveWithdraw { assets, reserve, xcm } => + W::initiate_reserve_withdraw(assets, reserve, xcm), + InitiateTeleport { assets, dest, xcm } => W::initiate_teleport(assets, dest, xcm), + QueryHolding { query_id, dest, assets, max_response_weight } => + W::query_holding(query_id, dest, assets, max_response_weight), + BuyExecution { fees, weight_limit } => W::buy_execution(fees, weight_limit), + RefundSurplus => W::refund_surplus(), + SetErrorHandler(xcm) => W::set_error_handler(xcm), + SetAppendix(xcm) => W::set_appendix(xcm), + ClearError => W::clear_error(), + ClaimAsset { assets, ticket } => W::claim_asset(assets, ticket), + Trap(code) => W::trap(code), + SubscribeVersion { query_id, max_response_weight } => + W::subscribe_version(query_id, max_response_weight), + UnsubscribeVersion => W::unsubscribe_version(), + } + } +} + pub mod opaque { /// The basic concrete type of `Xcm`, which doesn't make any assumptions about the /// format of a call other than it is pre-encoded. diff --git a/xcm/src/v2/traits.rs b/xcm/src/v2/traits.rs index 0349a7de193f..e83ff0098260 100644 --- a/xcm/src/v2/traits.rs +++ b/xcm/src/v2/traits.rs @@ -19,7 +19,9 @@ use core::result; use parity_scale_codec::{Decode, Encode}; -use super::{MultiLocation, Xcm}; +use crate::latest::InteriorMultiLocation; + +use super::*; #[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, Debug)] pub enum Error { @@ -313,3 +315,63 @@ impl SendXcm for Tuple { Err(SendError::CannotReachDestination(destination, message)) } } + +// TODO: Macro to generate this +// The info needed to weight an XCM. +pub trait XcmWeightInfo { + fn withdraw_asset(assets: &MultiAssets) -> Weight; + fn reserve_asset_deposited(assets: &MultiAssets) -> Weight; + fn receive_teleported_asset(assets: &MultiAssets) -> Weight; + fn query_response(query_id: &u64, response: &Response, max_weight: &u64) -> Weight; + fn transfer_asset(assets: &MultiAssets, beneficiary: &MultiLocation) -> Weight; + fn transfer_reserve_asset(assets: &MultiAssets, dest: &MultiLocation, xcm: &Xcm<()>) -> Weight; + fn transact( + origin_type: &OriginKind, + require_weight_at_most: &u64, + call: &DoubleEncoded, + ) -> Weight; + fn hrmp_new_channel_open_request( + sender: &u32, + max_message_size: &u32, + max_capacity: &u32, + ) -> Weight; + fn hrmp_channel_accepted(recipient: &u32) -> Weight; + fn hrmp_channel_closing(initiator: &u32, sender: &u32, recipient: &u32) -> Weight; + fn clear_origin() -> Weight; + fn descend_origin(who: &InteriorMultiLocation) -> Weight; + fn report_error(query_id: &QueryId, dest: &MultiLocation, max_response_weight: &u64) -> Weight; + fn relayed_from(who: &Junctions, message: &alloc::boxed::Box>) -> Weight; + fn deposit_asset( + assets: &MultiAssetFilter, + max_assets: &u32, + beneficiary: &MultiLocation, + ) -> Weight; + fn deposit_reserve_asset( + assets: &MultiAssetFilter, + max_assets: &u32, + dest: &MultiLocation, + xcm: &Xcm<()>, + ) -> Weight; + fn exchange_asset(give: &MultiAssetFilter, receive: &MultiAssets) -> Weight; + fn initiate_reserve_withdraw( + assets: &MultiAssetFilter, + reserve: &MultiLocation, + xcm: &Xcm<()>, + ) -> Weight; + fn initiate_teleport(assets: &MultiAssetFilter, dest: &MultiLocation, xcm: &Xcm<()>) -> Weight; + fn query_holding( + query_id: &u64, + dest: &MultiLocation, + assets: &MultiAssetFilter, + max_response_weight: &u64, + ) -> Weight; + fn buy_execution(fees: &MultiAsset, weight_limit: &WeightLimit) -> Weight; + fn refund_surplus() -> Weight; + fn set_error_handler(xcm: &Xcm<()>) -> Weight; + fn set_appendix(xcm: &Xcm<()>) -> Weight; + fn clear_error() -> Weight; + fn claim_asset(assets: &MultiAssets, ticket: &MultiLocation) -> Weight; + fn trap(code: &u64) -> Weight; + fn subscribe_version(query_id: &QueryId, max_response_weight: &u64) -> Weight; + fn unsubscribe_version() -> Weight; +} From d1fbaefc9c7624546dec5a941bf3ddeb9782325a Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 02:48:27 -0400 Subject: [PATCH 53/63] basic final weight (maybe wrong) --- xcm/src/v2/mod.rs | 2 +- xcm/xcm-executor/src/traits/weight.rs | 104 +++----------------------- 2 files changed, 10 insertions(+), 96 deletions(-) diff --git a/xcm/src/v2/mod.rs b/xcm/src/v2/mod.rs index b73c657a9de8..4a3fdc0c44d4 100644 --- a/xcm/src/v2/mod.rs +++ b/xcm/src/v2/mod.rs @@ -129,7 +129,7 @@ pub mod prelude { WeightLimit::{self, *}, WildFungibility::{self, Fungible as WildFungible, NonFungible as WildNonFungible}, WildMultiAsset::{self, *}, - VERSION as XCM_VERSION, + XcmWeightInfo, VERSION as XCM_VERSION, }; } pub use super::{Instruction, Xcm}; diff --git a/xcm/xcm-executor/src/traits/weight.rs b/xcm/xcm-executor/src/traits/weight.rs index adb6fce3c000..6b4d9549a1c2 100644 --- a/xcm/xcm-executor/src/traits/weight.rs +++ b/xcm/xcm-executor/src/traits/weight.rs @@ -97,104 +97,18 @@ impl WeightBounds for FinalXcmWeight where W: XcmWeightInfo, C: Decode + GetDispatchInfo, - Xcm: GetWeight, - Order: GetWeight, + Instruction: xcm::GetWeight, { - fn shallow(message: &mut Xcm) -> Result { - let weight = match message { - Xcm::RelayedFrom { ref mut message, .. } => { - let relay_message_weight = Self::shallow(message.as_mut())?; - message.weight().saturating_add(relay_message_weight) - }, - // These XCM - Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposited { effects, .. } | - Xcm::ReceiveTeleportedAsset { effects, .. } => { - let mut extra = 0; - for order in effects.iter_mut() { - extra.saturating_accrue(Self::shallow_order(order)?); - } - extra.saturating_accrue(message.weight()); - extra - }, - // The shallow weight of `Transact` is the full weight of the message, thus there is no - // deeper weight. - Xcm::Transact { call, .. } => { - let call_weight = call.ensure_decoded()?.get_dispatch_info().weight; - message.weight().saturating_add(call_weight) - }, - // These - Xcm::QueryResponse { .. } | - Xcm::TransferAsset { .. } | - Xcm::TransferReserveAsset { .. } | - Xcm::HrmpNewChannelOpenRequest { .. } | - Xcm::HrmpChannelAccepted { .. } | - Xcm::HrmpChannelClosing { .. } => message.weight(), - }; - - Ok(weight) - } - - fn deep(message: &mut Xcm) -> Result { - let weight = match message { - // `RelayFrom` needs to account for the deep weight of the internal message. - Xcm::RelayedFrom { ref mut message, .. } => Self::deep(message.as_mut())?, - // These XCM have internal effects which are not accounted for in the `shallow` weight. - Xcm::WithdrawAsset { effects, .. } | - Xcm::ReserveAssetDeposited { effects, .. } | - Xcm::ReceiveTeleportedAsset { effects, .. } => { - let mut extra: Weight = 0; - for order in effects.iter_mut() { - extra.saturating_accrue(Self::deep_order(order)?); - } - extra - }, - // These XCM do not have any deeper weight. - Xcm::Transact { .. } | - Xcm::QueryResponse { .. } | - Xcm::TransferAsset { .. } | - Xcm::TransferReserveAsset { .. } | - Xcm::HrmpNewChannelOpenRequest { .. } | - Xcm::HrmpChannelAccepted { .. } | - Xcm::HrmpChannelClosing { .. } => 0, - }; - + fn weight(message: &mut Xcm) -> Result { + let mut weight: Weight = 0; + for m in message.0.iter() { + weight.saturating_accrue(Self::instr_weight(m)?); + } Ok(weight) } -} -impl FinalXcmWeight -where - W: XcmWeightInfo, - C: Decode + GetDispatchInfo, - Xcm: GetWeight, - Order: GetWeight, -{ - fn shallow_order(order: &mut Order) -> Result { - Ok(match order { - Order::BuyExecution { fees, weight, debt, halt_on_error, instructions } => { - // On success, execution of this will result in more weight being consumed but - // we don't count it here since this is only the *shallow*, non-negotiable weight - // spend and doesn't count weight placed behind a `BuyExecution` since it will not - // be definitely consumed from any existing weight credit if execution of the message - // is attempted. - W::order_buy_execution(fees, weight, debt, halt_on_error, instructions) - }, - _ => 0, // TODO check - }) - } - fn deep_order(order: &mut Order) -> Result { - Ok(match order { - Order::BuyExecution { instructions, .. } => { - let mut extra = 0; - for instruction in instructions.iter_mut() { - extra.saturating_accrue( - Self::shallow(instruction)?.saturating_add(Self::deep(instruction)?), - ); - } - extra - }, - _ => 0, - }) + fn instr_weight(message: &Instruction) -> Result { + use xcm::GetWeight; + Ok(message.weight()) } } From 45b5dd40a6fb8c12a2e2f85c79dd65079a723b22 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 02:51:18 -0400 Subject: [PATCH 54/63] fix barrier --- xcm/xcm-builder/src/barriers.rs | 3 +-- xcm/xcm-builder/src/weight.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xcm/xcm-builder/src/barriers.rs b/xcm/xcm-builder/src/barriers.rs index 09492c65bdb6..de5a0e54e407 100644 --- a/xcm/xcm-builder/src/barriers.rs +++ b/xcm/xcm-builder/src/barriers.rs @@ -131,8 +131,7 @@ pub struct AllowBenchmarks; impl ShouldExecute for AllowBenchmarks { fn should_execute( _: &MultiLocation, - _: bool, - _: &xcm::latest::Xcm, + _: &mut xcm::latest::Xcm, _: Weight, _: &mut Weight, ) -> Result<(), ()> { diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index c438ae4edbd4..bba45865214b 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -45,7 +45,7 @@ impl, C: Decode + GetDispatchInfo, M> FixedWeightBounds let mut r = 0; *instrs_limit = instrs_limit.checked_sub(message.0.len() as u32).ok_or(())?; for m in message.0.iter() { - r += Self::instr_weight_with_limit(m, instrs_limit)?; + r.saturating_accrue(Self::instr_weight_with_limit(m, instrs_limit)?); } Ok(r) } From e72000742a391635c9b42bbb58a00aa1a13008f0 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 16:25:18 -0400 Subject: [PATCH 55/63] start to clean up benchmarks --- .../src/fungible/benchmarking.rs | 300 +++++++++--------- .../src/fungibles/benchmarking.rs | 18 +- .../src/fungibles/mock.rs | 6 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 35 +- xcm/pallet-xcm-benchmarks/src/mock.rs | 4 +- .../src/xcm_generic/benchmarking.rs | 90 ++---- .../src/xcm_generic/mock.rs | 9 +- xcm/src/v2/mod.rs | 6 + xcm/xcm-executor/src/lib.rs | 16 +- 9 files changed, 244 insertions(+), 240 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 05db4fa1aee9..04d77daab601 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -16,8 +16,8 @@ use super::*; use crate::{ - account_and_location, account_id_junction, execute_order, execute_xcm, worst_case_holding, - AssetTransactorOf, XcmCallOf, + account_and_location, account_id_junction, execute_xcm, worst_case_holding, AssetTransactorOf, + XcmCallOf, }; use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; use frame_support::{assert_ok, pallet_prelude::Get, traits::fungible::Inspect}; @@ -39,7 +39,7 @@ benchmarks_instance_pallet! { >::Error: sp_std::fmt::Debug, } - order_deposit_asset { + deposit_asset { let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(); @@ -53,162 +53,164 @@ benchmarks_instance_pallet! { let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); assert!(T::TransactAsset::balance(&ben_account).is_zero()); - let order = Order::>::DepositAsset { + let instruction = Instruction::>::DepositAsset { assets: asset.into(), max_assets: 1, beneficiary: ben_location, }; + let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_order::(origin, holding, order)); + assert_ok!(execute_xcm::(origin, order)); } verify { // dest should have received some asset. assert!(!T::TransactAsset::balance(&ben_account).is_zero()) } - order_deposit_reserve_asset { - let origin: MultiLocation = account_id_junction::(1).into(); - - let asset = T::get_multi_asset(); - let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // generate the holding with a bunch of stuff.. - // TODO: maybe update this api - let mut holding = worst_case_holding(); - // .. and the specific asset that we want to take out. - holding.subsume(asset.clone()); - // our dest must have no balance initially. - let dest_location = T::ValidDestination::get(); - let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); - assert!(T::TransactAsset::balance(&dest_account).is_zero()); - - let effects = Vec::new(); // No effects to isolate the order - let order = Order::>::DepositReserveAsset { - assets: asset.into(), - max_assets: 1, - dest: dest_location, - effects, - }; - }: { - assert_ok!(execute_order::(origin, holding, order)); - } verify { - // dest should have received some asset. - assert!(!T::TransactAsset::balance(&dest_account).is_zero()) - } - - order_initiate_reserve_withdraw { - let origin: MultiLocation = account_id_junction::(1).into(); - let asset = T::get_multi_asset(); - let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // generate the holding with a bunch of stuff.. - let mut holding = worst_case_holding(); - // .. and the specific asset that we want to take out. - holding.subsume(asset.clone()); - - let effects = Vec::new(); // No effects to isolate the order - let order = Order::>::DepositReserveAsset { - assets: asset.into(), - max_assets: 1, - dest: T::ValidDestination::get(), - effects, - }; - }: { - assert_ok!(execute_order::(origin, holding, order)); - } verify { - // execute_order succeeding is enough to verify this completed. - // TODO: ideally we query DMP queue - } - - order_initiate_teleport { - let (sender_account, origin) = account_and_location::(1); - let asset = T::get_multi_asset(); - let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // generate the holding with a bunch of stuff.. - let mut holding = worst_case_holding(); - // .. and the specific asset that we want to take out. - holding.subsume(asset.clone()); - - let effects = Vec::new(); // No effects to isolate the order - let order = Order::>::InitiateTeleport { - assets: asset.into(), - dest: T::ValidDestination::get(), - effects, - }; - if let Some(checked_account) = T::CheckedAccount::get() { - // Checked account starts at zero - assert!(T::TransactAsset::balance(&checked_account).is_zero()); - } - }: { - assert_ok!(execute_order::(origin, holding, order)); - } verify { - if let Some(checked_account) = T::CheckedAccount::get() { - // teleport checked account should have received some asset. - assert!(!T::TransactAsset::balance(&checked_account).is_zero()); - } - } - - xcm_withdraw_asset { - let (sender_account, sender_location) = account_and_location::(1); - let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &sender_location).unwrap(); - - // TODO that this is sum-optimal. We should ideally populate the holding account, but we - // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log - // of n), and we can't really capture this yet. We could still make a wrapper for - // execute_xcm and hack around this. It will be like - // - // `fn execute_xcm_with_holding(xcm, holding)` - // - // and it will execute the xcm, assuming that the holding was already set. This only makes - // sense by our assumption of xcm's being weighed by each of their asset. If you have 3 - // assets, while benchmarking the third, you artificially set some values into the holding, - // which reflect the state of the holding after executing the previous two xcms. - - // check the assets of origin. - assert!(!T::TransactAsset::balance(&sender_account).is_zero()); - // TODO: probably we can and should just use the opaque xcm/order types. - let xcm = Xcm::WithdrawAsset::> { assets: vec![asset].into(), effects: vec![] }; - }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); - } verify { - // check one of the assets of origin. - assert!(T::TransactAsset::balance(&sender_account).is_zero()); - } - xcm_receive_teleported_asset { - - }: {} verify {} - xcm_transfer_asset { - let (sender_account, sender_location) = account_and_location::(1); - let ben_location = T::ValidDestination::get(); - let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); - - let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &sender_location).unwrap(); - let assets: MultiAssets = vec![ asset ].into(); - assert!(T::TransactAsset::balance(&ben_account).is_zero()); - let xcm = Xcm::TransferAsset { assets, beneficiary: ben_location }; - }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); - } verify { - assert!(T::TransactAsset::balance(&sender_account).is_zero()); - assert!(!T::TransactAsset::balance(&ben_account).is_zero()); - } - - xcm_transfer_reserve_asset { - let (sender_account, sender_location) = account_and_location::(1); - let dest_location = T::ValidDestination::get(); - let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); - - let asset = T::get_multi_asset(); - >::deposit_asset(&asset, &sender_location).unwrap(); - let assets: MultiAssets = vec![ asset ].into(); - assert!(T::TransactAsset::balance(&dest_account).is_zero()); - let effects = Vec::new(); // No effects to isolate the xcm - let xcm = Xcm::TransferReserveAsset { assets, dest: dest_location, effects }; - }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); - } verify { - assert!(T::TransactAsset::balance(&sender_account).is_zero()); - assert!(!T::TransactAsset::balance(&dest_account).is_zero()); - } + // deposit_reserve_asset { + // let origin: MultiLocation = account_id_junction::(1).into(); + + // let asset = T::get_multi_asset(); + // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // // generate the holding with a bunch of stuff.. + // // TODO: maybe update this api + // let mut holding = worst_case_holding(); + // // .. and the specific asset that we want to take out. + // holding.subsume(asset.clone()); + // // our dest must have no balance initially. + // let dest_location = T::ValidDestination::get(); + // let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); + // assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + // let effects = Vec::new(); // No effects to isolate the order + // let instruction = Instruction::>::DepositReserveAsset { + // assets: asset.into(), + // max_assets: 1, + // dest: dest_location, + // effects, + // }; + // }: { + // assert_ok!(execute_xcm::(origin, holding, order)); + // } verify { + // // dest should have received some asset. + // assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + // } + + // initiate_reserve_withdraw { + // let origin: MultiLocation = account_id_junction::(1).into(); + // let asset = T::get_multi_asset(); + // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // // generate the holding with a bunch of stuff.. + // let mut holding = worst_case_holding(); + // // .. and the specific asset that we want to take out. + // holding.subsume(asset.clone()); + + // let effects = Vec::new(); // No effects to isolate the order + // let instruction = Instruction::>::DepositReserveAsset { + // assets: asset.into(), + // max_assets: 1, + // dest: T::ValidDestination::get(), + // effects, + // }; + // }: { + // assert_ok!(execute_xcm::(origin, holding, order)); + // } verify { + // // execute_xcm succeeding is enough to verify this completed. + // // TODO: ideally we query DMP queue + // } + + // initiate_teleport { + // let (sender_account, origin) = account_and_location::(1); + // let asset = T::get_multi_asset(); + // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // // generate the holding with a bunch of stuff.. + // let mut holding = worst_case_holding(); + // // .. and the specific asset that we want to take out. + // holding.subsume(asset.clone()); + + // let effects = Vec::new(); // No effects to isolate the order + // let instruction = Instruction::>::InitiateTeleport { + // assets: asset.into(), + // dest: T::ValidDestination::get(), + // effects, + // }; + // if let Some(checked_account) = T::CheckedAccount::get() { + // // Checked account starts at zero + // assert!(T::TransactAsset::balance(&checked_account).is_zero()); + // } + // }: { + // assert_ok!(execute_xcm::(origin, holding, order)); + // } verify { + // if let Some(checked_account) = T::CheckedAccount::get() { + // // teleport checked account should have received some asset. + // assert!(!T::TransactAsset::balance(&checked_account).is_zero()); + // } + // } + + // withdraw_asset { + // let (sender_account, sender_location) = account_and_location::(1); + // let asset = T::get_multi_asset(); + // >::deposit_asset(&asset, &sender_location).unwrap(); + + // // TODO that this is sum-optimal. We should ideally populate the holding account, but we + // // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log + // // of n), and we can't really capture this yet. We could still make a wrapper for + // // execute_xcm and hack around this. It will be like + // // + // // `fn execute_xcm_with_holding(xcm, holding)` + // // + // // and it will execute the xcm, assuming that the holding was already set. This only makes + // // sense by our assumption of xcm's being weighed by each of their asset. If you have 3 + // // assets, while benchmarking the third, you artificially set some values into the holding, + // // which reflect the state of the holding after executing the previous two xcms. + + // // check the assets of origin. + // assert!(!T::TransactAsset::balance(&sender_account).is_zero()); + // // TODO: probably we can and should just use the opaque xcm/order types. + // let instruction = Instruction::WithdrawAsset::> { assets: vec![asset].into(), effects: vec![] }; + // }: { + // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); + // } verify { + // // check one of the assets of origin. + // assert!(T::TransactAsset::balance(&sender_account).is_zero()); + // } + // receive_teleported_asset { + + // }: {} verify {} + // transfer_asset { + // let (sender_account, sender_location) = account_and_location::(1); + // let ben_location = T::ValidDestination::get(); + // let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); + + // let asset = T::get_multi_asset(); + // >::deposit_asset(&asset, &sender_location).unwrap(); + // let assets: MultiAssets = vec![ asset ].into(); + // assert!(T::TransactAsset::balance(&ben_account).is_zero()); + // let instruction = Instruction::TransferAsset { assets, beneficiary: ben_location }; + // let xcm = Xcm(vec![instruction]); + // }: { + // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); + // } verify { + // assert!(T::TransactAsset::balance(&sender_account).is_zero()); + // assert!(!T::TransactAsset::balance(&ben_account).is_zero()); + // } + + // transfer_reserve_asset { + // let (sender_account, sender_location) = account_and_location::(1); + // let dest_location = T::ValidDestination::get(); + // let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); + + // let asset = T::get_multi_asset(); + // >::deposit_asset(&asset, &sender_location).unwrap(); + // let assets: MultiAssets = vec![ asset ].into(); + // assert!(T::TransactAsset::balance(&dest_account).is_zero()); + // let effects = Vec::new(); // No effects to isolate the xcm + // let instruction = Instruction::TransferReserveAsset { assets, dest: dest_location, effects }; + // }: { + // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); + // } verify { + // assert!(T::TransactAsset::balance(&sender_account).is_zero()); + // assert!(!T::TransactAsset::balance(&dest_account).is_zero()); + // } } // TODO: this macro cannot be called alone, fix it in substrate. diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 4747dc868222..857cb32f6817 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -16,8 +16,7 @@ use super::*; use crate::{ - account, account_id_junction, execute_order, execute_xcm, worst_case_holding, - AssetTransactorOf, XcmCallOf, + account, account_id_junction, execute_xcm, worst_case_holding, AssetTransactorOf, XcmCallOf, }; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_support::{ @@ -50,11 +49,11 @@ benchmarks! { // orders. order_noop { - let order = Order::>::Noop; let origin: MultiLocation = account_id_junction::(1).into(); let holding = Assets::default(); + let xcm = Xcm::>::new(); }: { - assert_ok!(execute_order::(origin, holding, order)); + assert_ok!(execute_xcm::(origin, holding, xcm).ensure_complete()); } order_deposit_asset_per_asset { @@ -63,18 +62,19 @@ benchmarks! { let origin: MultiLocation = account_id_junction::(1).into(); let asset = T::get_multi_asset(asset_id); - let order = Order::>::DepositAsset { + let instruction = Instruction::>::DepositAsset { assets: asset.clone().into(), max_assets: 1, beneficiary: account_id_junction::(2).into(), }; + let xcm = Xcm(vec![instruction]); let amount: u128 = T::TransactAsset::minimum_balance(asset_id.into()).try_into().unwrap(); let mut holding: Assets = worst_case_holding(); holding.subsume(asset); assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); }: { - assert_ok!(execute_order::(origin, holding, order)); + assert_ok!(execute_xcm::(origin, holding, xcm).ensure_complete()); } verify { assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) } @@ -100,7 +100,8 @@ benchmarks! { .collect::>().into(); // check just one of the asset ids, namely 1. assert!(!T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); - let xcm = Xcm::WithdrawAsset::> { assets, effects: vec![] }; + let instruction = Instruction::>::WithdrawAsset(assets); + let xcm = instruction.into(); }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { @@ -131,7 +132,8 @@ benchmarks! { }) .collect::>().into(); - let xcm = Xcm::TransferAsset { assets, beneficiary }; + let instruction = Instruction::TransferAsset { assets, beneficiary }; + let xcm = instruction.into(); }: { assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); } verify { diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 661e0a5b365a..2790d31e9f6e 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -161,6 +161,10 @@ pub type AssetTransactor = xcm_builder::FungiblesAdapter< CheckedAccount, >; +parameter_types! { + pub const MaxInstructions: u32 = 100; +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -171,7 +175,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // no one can teleport. type LocationInverter = xcm_builder::LocationInverter; type Barrier = AllowUnpaidExecutionFrom; - type Weigher = xcm_builder::FixedWeightBounds; + type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; } diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 67cef749e453..8dd9e3c4ddcb 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -32,8 +32,8 @@ use sp_std::prelude::*; use xcm::latest::prelude::*; use xcm_executor::{traits::Convert, Assets}; -pub mod fungible; -pub mod fungibles; +// pub mod fungible; +// pub mod fungibles; pub mod xcm_generic; #[cfg(test)] @@ -96,20 +96,27 @@ pub fn asset_instance_from(x: u32) -> AssetInstance { AssetInstance::Array4(instance) } -/// wrapper to execute single order. Can be any hack, for now we just do a noop-xcm with a single -/// order. -pub fn execute_order( - origin: MultiLocation, - mut holding: Assets, - order: Order>, -) -> Result { - ExecutorOf::::do_execute_orders(&origin, &mut holding, order) -} - /// Execute an xcm. -pub fn execute_xcm(origin: MultiLocation, xcm: Xcm>) -> Outcome { +/// TODO: This skips all the barriers and traders, etc... maybe need to add back. +pub fn execute_xcm( + origin: MultiLocation, + holding: Assets, + xcm: Xcm>, +) -> sp_runtime::DispatchResult { // TODO: very large weight to ensure all benchmarks execute, sensible? - ExecutorOf::::execute_xcm(origin, xcm, MAX_WEIGHT) + let mut executor = ExecutorOf::::new(origin); + executor.set_holding(holding); + let result = executor.execute(xcm); + + match result { + Ok(()) => Ok(()), + // TODO: #2841 #REALWEIGHT We should deduct the cost of any instructions following + // the error which didn't end up being executed. + Err((index, error, weight)) => { + println!("XCM ERROR :: Index: {:?}, Error: {:?}, Weight: {:?}", index, error, weight); + Err(sp_runtime::DispatchError::Other("execute xcm error")) + }, + } } // TODO probably delete and use converter diff --git a/xcm/pallet-xcm-benchmarks/src/mock.rs b/xcm/pallet-xcm-benchmarks/src/mock.rs index 065e1e4ada39..2b1cb31f1580 100644 --- a/xcm/pallet-xcm-benchmarks/src/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/mock.rs @@ -21,7 +21,7 @@ use xcm_executor::traits::FilterAssetLocation; // An xcm sender/receiver akin to > /dev/null pub struct DevNull; impl xcm::opaque::latest::SendXcm for DevNull { - fn send_xcm(_: MultiLocation, _: Xcm<()>) -> XcmResult { + fn send_xcm(_: MultiLocation, _: Xcm<()>) -> SendResult { Ok(()) } } @@ -30,7 +30,7 @@ impl xcm_executor::traits::OnResponse for DevNull { fn expecting_response(_: &MultiLocation, _: u64) -> bool { false } - fn on_response(_: MultiLocation, _: u64, _: Response) -> Weight { + fn on_response(_: &MultiLocation, _: u64, _: Response, _: Weight) -> Weight { 0 } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index be4c2a02839c..3a1cc31ca14d 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -16,36 +16,37 @@ use super::*; use crate::{ - account_and_location, account_id_junction, execute_order, execute_xcm, worst_case_holding, - XcmCallOf, + account_and_location, account_id_junction, execute_xcm, worst_case_holding, XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; -use frame_support::{assert_ok, dispatch::GetDispatchInfo, pallet_prelude::Get}; -use sp_std::prelude::*; +use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::Get}; use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { - order_noop { - let order = Order::>::Noop; + noop { + let xcm = Xcm::>::new(); let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); }: { - assert_ok!(execute_order::(origin, holding, order)); + execute_xcm::(origin, holding, xcm)?; } - order_query_holding { + query_holding { let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); - let order = Order::>::QueryHolding { + let instruction = Instruction::>::QueryHolding { query_id: Default::default(), dest: T::ValidDestination::get(), assets: Wild(WildMultiAsset::All), // TODO is worst case filter? + max_response_weight: u64::MAX, }; + let xcm = Xcm(vec![instruction]); + } : { - assert_ok!(execute_order::(origin, holding, order)); + execute_xcm::(origin, holding, xcm)?; } verify { // The assert above is enough to validate this is completed. // todo maybe XCM sender peek @@ -53,46 +54,46 @@ benchmarks! { // This benchmark does not use any additional orders or instructions. This should be managed // by the `deep` and `shallow` implementation. - order_buy_execution { + buy_execution { let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); let fee_asset = Concrete(Here.into()); - let order = Order::>::BuyExecution { + let instruction = Instruction::>::BuyExecution { fees: (fee_asset, 100_000_000).into(), // should be something inside of holding - weight: 0, // TODO think about sensible numbers - debt: 0, // TODO think about sensible numbers - halt_on_error: false, - instructions: Default::default(), // no instructions + weight_limit: WeightLimit::Unlimited, }; + + let xcm = Xcm(vec![instruction]); } : { - assert_ok!(execute_order::(origin, holding, order)); + execute_xcm::(origin, holding, xcm)?; } verify { } // Worst case scenario for this benchmark is a large number of assets to // filter through the reserve. - xcm_reserve_asset_deposited { + reserve_asset_deposited { let (sender_account, sender_location) = account_and_location::(1); let assets: MultiAssets = (Concrete(Here.into()), 100).into();// TODO worst case - // no effects to isolate this benchmark - let effects: Vec> = Default::default(); - let xcm = Xcm::ReserveAssetDeposited { assets, effects }; + let instruction = Instruction::ReserveAssetDeposited(assets); + let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + execute_xcm::(sender_location, Default::default(), xcm)?; } verify { // The assert above is enough to show this XCM succeeded } - xcm_query_response { + query_response { let (sender_account, sender_location) = account_and_location::(1); let (query_id, response) = T::worst_case_response(); - let xcm = Xcm::QueryResponse { query_id, response }; + let max_weight = u64::MAX; + let instruction = Instruction::QueryResponse { query_id, response, max_weight }; + let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + execute_xcm::(sender_location, Default::default(), xcm); } verify { // The assert above is enough to show this XCM succeeded } @@ -100,69 +101,48 @@ benchmarks! { // We don't care about the call itself, since that is accounted for in the weight parameter // and included in the final weight calculation. So this is just the overhead of submitting // a noop call. - xcm_transact { + transact { let (sender_account, sender_location) = account_and_location::(1); let noop_call: ::Call = frame_system::Call::remark_with_event(Default::default()).into(); let double_encoded_noop_call: DoubleEncoded<_> = noop_call.encode().into(); - let xcm = Xcm::Transact { + let instruction = Instruction::Transact { origin_type: OriginKind::SovereignAccount, require_weight_at_most: noop_call.get_dispatch_info().weight, call: double_encoded_noop_call, }; + let xcm = Xcm(vec![instruction]); let num_events = frame_system::Pallet::::events().len(); }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + execute_xcm::(sender_location, Default::default(), xcm)?; } verify { // TODO make better assertion? let num_events2 = frame_system::Pallet::::events().len(); assert_eq!(num_events + 1, num_events2); } - xcm_hrmp_new_channel_open_request { + hrmp_new_channel_open_request { let (sender_account, sender_location) = account_and_location::(1); // Inputs here should not matter to weight. - // let xcm = Xcm::HrmpNewChannelOpenRequest { + // let instruction = Instruction::HrmpNewChannelOpenRequest { // sender: Default::default(), // max_message_size: Default::default(), // max_capacity: Default::default(), // }; }: { - // assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); + // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); // currently unhandled } verify { } - xcm_hrmp_channel_accepted {}: { + hrmp_channel_accepted {}: { // currently unhandled } verify {} - xcm_hrmp_channel_closing {}: { + hrmp_channel_closing {}: { // currently unhandled } verify {} - // We want to measure this benchmark with a noop XCM to isolate specifically - // the overhead of `RelayedFrom`. The weight of the inner XCM should be accounted - // for when calculating the total weight. - xcm_relayed_from { - let (sender_account, sender_location) = account_and_location::(1); - - // when these two inputs are empty, we basically noop - let noop_xcm = Xcm::ReserveAssetDeposited { - assets: Vec::::new().into(), - effects: Default::default(), - }; - - let xcm = Xcm::RelayedFrom { - who: Here, - message: sp_std::boxed::Box::new(noop_xcm), - }; - }: { - assert_ok!(execute_xcm::(sender_location, xcm).ensure_complete()); - } verify { - // the assert above verifies the XCM completed successfully. - } - } impl_benchmark_test_suite!( diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index dec953f95fa7..3fcda9be00a2 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -85,6 +85,10 @@ impl xcm_executor::traits::TransactAsset for NoAssetTransactor { } } +parameter_types! { + pub const MaxInstructions: u32 = 100; +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -95,9 +99,12 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; type Barrier = AllowUnpaidExecutionFrom; - type Weigher = xcm_builder::FixedWeightBounds; + type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; + type AssetTrap = (); + type AssetClaims = (); + type SubscriptionService = (); } parameter_types! { diff --git a/xcm/src/v2/mod.rs b/xcm/src/v2/mod.rs index 4a3fdc0c44d4..e51dadd748f0 100644 --- a/xcm/src/v2/mod.rs +++ b/xcm/src/v2/mod.rs @@ -613,6 +613,12 @@ pub enum Instruction { UnsubscribeVersion, } +impl From> for Xcm { + fn from(instruction: Instruction) -> Self { + Self(vec![instruction]) + } +} + impl Xcm { pub fn into(self) -> Xcm { Xcm::from(self) diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 5254a3d4a631..f6afaca8caf0 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -129,7 +129,7 @@ impl ExecuteXcm for XcmExecutor { } impl XcmExecutor { - fn new(origin: MultiLocation) -> Self { + pub fn new(origin: MultiLocation) -> Self { Self { holding: Assets::new(), origin: Some(origin.clone()), @@ -148,7 +148,7 @@ impl XcmExecutor { /// Execute the XCM program fragment and report back the error and which instruction caused it, /// or `Ok` if there was no error. - fn execute(&mut self, xcm: Xcm) -> Result<(), (u32, XcmError, u64)> { + pub fn execute(&mut self, xcm: Xcm) -> Result<(), (u32, XcmError, u64)> { log::trace!( target: "xcm::execute", "origin: {:?}, total_surplus/refunded: {:?}/{:?}, error_handler_weight: {:?}", @@ -444,13 +444,9 @@ impl XcmExecutor { Ok(assets.into_assets_iter().collect::>().into()) } - #[cfg(feature = "runtime-benchmarks")] - pub fn do_execute_orders( - origin: &MultiLocation, - holding: &mut Assets, - order: Order, - ) -> Result { - let mut trader = Config::Trader::new(); - Self::execute_orders(origin, holding, order, &mut trader, 0) + /// Set the holding registrar of the executor. Only used for tests and benchmarking. + #[cfg(any(test, feature = "runtime-benchmarks", feature = "std"))] + pub fn set_holding(&mut self, assets: Assets) { + self.holding = assets; } } From 12bfc2b54a8bded2a13c70ae5e612249f8465730 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 16:40:23 -0400 Subject: [PATCH 56/63] more fixes --- .../src/fungible/benchmarking.rs | 301 +++++++++--------- .../src/fungible/mock.rs | 11 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 2 +- .../src/xcm_generic/benchmarking.rs | 2 +- 4 files changed, 166 insertions(+), 150 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index 04d77daab601..ce1c598c600b 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -20,7 +20,7 @@ use crate::{ XcmCallOf, }; use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite}; -use frame_support::{assert_ok, pallet_prelude::Get, traits::fungible::Inspect}; +use frame_support::{pallet_prelude::Get, traits::fungible::Inspect}; use sp_runtime::traits::Zero; use sp_std::{convert::TryInto, prelude::*, vec}; use xcm::latest::prelude::*; @@ -60,157 +60,164 @@ benchmarks_instance_pallet! { }; let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_xcm::(origin, order)); + execute_xcm::(origin, holding, xcm)?; } verify { // dest should have received some asset. assert!(!T::TransactAsset::balance(&ben_account).is_zero()) } - // deposit_reserve_asset { - // let origin: MultiLocation = account_id_junction::(1).into(); - - // let asset = T::get_multi_asset(); - // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // // generate the holding with a bunch of stuff.. - // // TODO: maybe update this api - // let mut holding = worst_case_holding(); - // // .. and the specific asset that we want to take out. - // holding.subsume(asset.clone()); - // // our dest must have no balance initially. - // let dest_location = T::ValidDestination::get(); - // let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); - // assert!(T::TransactAsset::balance(&dest_account).is_zero()); - - // let effects = Vec::new(); // No effects to isolate the order - // let instruction = Instruction::>::DepositReserveAsset { - // assets: asset.into(), - // max_assets: 1, - // dest: dest_location, - // effects, - // }; - // }: { - // assert_ok!(execute_xcm::(origin, holding, order)); - // } verify { - // // dest should have received some asset. - // assert!(!T::TransactAsset::balance(&dest_account).is_zero()) - // } - - // initiate_reserve_withdraw { - // let origin: MultiLocation = account_id_junction::(1).into(); - // let asset = T::get_multi_asset(); - // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // // generate the holding with a bunch of stuff.. - // let mut holding = worst_case_holding(); - // // .. and the specific asset that we want to take out. - // holding.subsume(asset.clone()); - - // let effects = Vec::new(); // No effects to isolate the order - // let instruction = Instruction::>::DepositReserveAsset { - // assets: asset.into(), - // max_assets: 1, - // dest: T::ValidDestination::get(), - // effects, - // }; - // }: { - // assert_ok!(execute_xcm::(origin, holding, order)); - // } verify { - // // execute_xcm succeeding is enough to verify this completed. - // // TODO: ideally we query DMP queue - // } - - // initiate_teleport { - // let (sender_account, origin) = account_and_location::(1); - // let asset = T::get_multi_asset(); - // let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); - // // generate the holding with a bunch of stuff.. - // let mut holding = worst_case_holding(); - // // .. and the specific asset that we want to take out. - // holding.subsume(asset.clone()); - - // let effects = Vec::new(); // No effects to isolate the order - // let instruction = Instruction::>::InitiateTeleport { - // assets: asset.into(), - // dest: T::ValidDestination::get(), - // effects, - // }; - // if let Some(checked_account) = T::CheckedAccount::get() { - // // Checked account starts at zero - // assert!(T::TransactAsset::balance(&checked_account).is_zero()); - // } - // }: { - // assert_ok!(execute_xcm::(origin, holding, order)); - // } verify { - // if let Some(checked_account) = T::CheckedAccount::get() { - // // teleport checked account should have received some asset. - // assert!(!T::TransactAsset::balance(&checked_account).is_zero()); - // } - // } - - // withdraw_asset { - // let (sender_account, sender_location) = account_and_location::(1); - // let asset = T::get_multi_asset(); - // >::deposit_asset(&asset, &sender_location).unwrap(); - - // // TODO that this is sum-optimal. We should ideally populate the holding account, but we - // // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log - // // of n), and we can't really capture this yet. We could still make a wrapper for - // // execute_xcm and hack around this. It will be like - // // - // // `fn execute_xcm_with_holding(xcm, holding)` - // // - // // and it will execute the xcm, assuming that the holding was already set. This only makes - // // sense by our assumption of xcm's being weighed by each of their asset. If you have 3 - // // assets, while benchmarking the third, you artificially set some values into the holding, - // // which reflect the state of the holding after executing the previous two xcms. - - // // check the assets of origin. - // assert!(!T::TransactAsset::balance(&sender_account).is_zero()); - // // TODO: probably we can and should just use the opaque xcm/order types. - // let instruction = Instruction::WithdrawAsset::> { assets: vec![asset].into(), effects: vec![] }; - // }: { - // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); - // } verify { - // // check one of the assets of origin. - // assert!(T::TransactAsset::balance(&sender_account).is_zero()); - // } - // receive_teleported_asset { - - // }: {} verify {} - // transfer_asset { - // let (sender_account, sender_location) = account_and_location::(1); - // let ben_location = T::ValidDestination::get(); - // let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); - - // let asset = T::get_multi_asset(); - // >::deposit_asset(&asset, &sender_location).unwrap(); - // let assets: MultiAssets = vec![ asset ].into(); - // assert!(T::TransactAsset::balance(&ben_account).is_zero()); - // let instruction = Instruction::TransferAsset { assets, beneficiary: ben_location }; - // let xcm = Xcm(vec![instruction]); - // }: { - // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); - // } verify { - // assert!(T::TransactAsset::balance(&sender_account).is_zero()); - // assert!(!T::TransactAsset::balance(&ben_account).is_zero()); - // } - - // transfer_reserve_asset { - // let (sender_account, sender_location) = account_and_location::(1); - // let dest_location = T::ValidDestination::get(); - // let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); - - // let asset = T::get_multi_asset(); - // >::deposit_asset(&asset, &sender_location).unwrap(); - // let assets: MultiAssets = vec![ asset ].into(); - // assert!(T::TransactAsset::balance(&dest_account).is_zero()); - // let effects = Vec::new(); // No effects to isolate the xcm - // let instruction = Instruction::TransferReserveAsset { assets, dest: dest_location, effects }; - // }: { - // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); - // } verify { - // assert!(T::TransactAsset::balance(&sender_account).is_zero()); - // assert!(!T::TransactAsset::balance(&dest_account).is_zero()); - // } + deposit_reserve_asset { + let origin: MultiLocation = account_id_junction::(1).into(); + + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + // TODO: maybe update this api + let mut holding = worst_case_holding(); + // .. and the specific asset that we want to take out. + holding.subsume(asset.clone()); + // our dest must have no balance initially. + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let instruction = Instruction::>::DepositReserveAsset { + assets: asset.into(), + max_assets: 1, + dest: dest_location, + xcm: Xcm::new(), + }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm::(origin, holding, xcm)?; + } verify { + // dest should have received some asset. + assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + } + + initiate_reserve_withdraw { + let origin: MultiLocation = account_id_junction::(1).into(); + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = worst_case_holding(); + // .. and the specific asset that we want to take out. + holding.subsume(asset.clone()); + + let instruction = Instruction::>::DepositReserveAsset { + assets: asset.into(), + max_assets: 1, + dest: T::ValidDestination::get(), + xcm: Xcm::new(), + }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm::(origin, holding, xcm)?; + } verify { + // execute_xcm succeeding is enough to verify this completed. + // TODO: ideally we query DMP queue + } + + initiate_teleport { + let (sender_account, origin) = account_and_location::(1); + let asset = T::get_multi_asset(); + let amount: u128 = T::TransactAsset::minimum_balance().try_into().unwrap(); + // generate the holding with a bunch of stuff.. + let mut holding = worst_case_holding(); + // .. and the specific asset that we want to take out. + holding.subsume(asset.clone()); + + let instruction = Instruction::>::InitiateTeleport { + assets: asset.into(), + dest: T::ValidDestination::get(), + xcm: Xcm::new(), + }; + let xcm = Xcm(vec![instruction]); + if let Some(checked_account) = T::CheckedAccount::get() { + // Checked account starts at zero + assert!(T::TransactAsset::balance(&checked_account).is_zero()); + } + }: { + execute_xcm::(origin, holding, xcm)?; + } verify { + if let Some(checked_account) = T::CheckedAccount::get() { + // teleport checked account should have received some asset. + assert!(!T::TransactAsset::balance(&checked_account).is_zero()); + } + } + + withdraw_asset { + let (sender_account, sender_location) = account_and_location::(1); + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &sender_location).unwrap(); + + // TODO that this is sum-optimal. We should ideally populate the holding account, but we + // can't, nor does it make sense. Insertion of assets into holding gets worse over time (log + // of n), and we can't really capture this yet. We could still make a wrapper for + // execute_xcm and hack around this. It will be like + // + // `fn execute_xcm_with_holding(xcm, holding)` + // + // and it will execute the xcm, assuming that the holding was already set. This only makes + // sense by our assumption of xcm's being weighed by each of their asset. If you have 3 + // assets, while benchmarking the third, you artificially set some values into the holding, + // which reflect the state of the holding after executing the previous two xcms. + + // check the assets of origin. + assert!(!T::TransactAsset::balance(&sender_account).is_zero()); + // TODO: probably we can and should just use the opaque xcm/order types. + let instruction = Instruction::>::WithdrawAsset(vec![asset].into()); + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm::(sender_location, Default::default(), xcm)?; + } verify { + // check one of the assets of origin. + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + } + + receive_teleported_asset { + + }: {} verify {} + + transfer_asset { + let (sender_account, sender_location) = account_and_location::(1); + let ben_location = T::ValidDestination::get(); + let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); + + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &sender_location).unwrap(); + let assets: MultiAssets = vec![ asset ].into(); + assert!(T::TransactAsset::balance(&ben_account).is_zero()); + let instruction = Instruction::TransferAsset { assets, beneficiary: ben_location }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm::(sender_location, Default::default(), xcm)?; + } verify { + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&ben_account).is_zero()); + } + + transfer_reserve_asset { + let (sender_account, sender_location) = account_and_location::(1); + let dest_location = T::ValidDestination::get(); + let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); + + let asset = T::get_multi_asset(); + >::deposit_asset(&asset, &sender_location).unwrap(); + let assets: MultiAssets = vec![ asset ].into(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + let instruction = Instruction::TransferReserveAsset { + assets, + dest: dest_location, + xcm: Xcm::new() + }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm::(sender_location, Default::default(), xcm)?; + } verify { + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&dest_account).is_zero()); + } } // TODO: this macro cannot be called alone, fix it in substrate. diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index ad44d2ab1c27..46924c139b90 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -118,6 +118,12 @@ pub type AssetTransactor = xcm_builder::CurrencyAdapter< CheckedAccount, >; +parameter_types! { + /// Maximum number of instructions in a single XCM fragment. A sanity check against weight + /// calculations getting too crazy. + pub const MaxInstructions: u32 = 100; +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -128,9 +134,12 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); type LocationInverter = xcm_builder::LocationInverter; type Barrier = AllowUnpaidExecutionFrom; - type Weigher = xcm_builder::FixedWeightBounds; + type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; + type AssetTrap = (); + type AssetClaims = (); + type SubscriptionService = (); } impl crate::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 8dd9e3c4ddcb..139b44b43968 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -32,7 +32,7 @@ use sp_std::prelude::*; use xcm::latest::prelude::*; use xcm_executor::{traits::Convert, Assets}; -// pub mod fungible; +pub mod fungible; // pub mod fungibles; pub mod xcm_generic; diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 3a1cc31ca14d..8063faa36e55 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -93,7 +93,7 @@ benchmarks! { let instruction = Instruction::QueryResponse { query_id, response, max_weight }; let xcm = Xcm(vec![instruction]); }: { - execute_xcm::(sender_location, Default::default(), xcm); + execute_xcm::(sender_location, Default::default(), xcm)?; } verify { // The assert above is enough to show this XCM succeeded } From 9ed8a4c6d05933960fb47aeda66538ae88549b48 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 16:46:47 -0400 Subject: [PATCH 57/63] fix more --- .../src/fungibles/benchmarking.rs | 38 +++++++++---------- .../src/fungibles/mock.rs | 3 ++ xcm/pallet-xcm-benchmarks/src/lib.rs | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs index 857cb32f6817..1f1e31ef100c 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/benchmarking.rs @@ -48,15 +48,15 @@ benchmarks! { send_xcm {}: {} // orders. - order_noop { + noop { let origin: MultiLocation = account_id_junction::(1).into(); let holding = Assets::default(); let xcm = Xcm::>::new(); }: { - assert_ok!(execute_xcm::(origin, holding, xcm).ensure_complete()); + execute_xcm::(origin, holding, xcm)?; } - order_deposit_asset_per_asset { + deposit_asset_per_asset { // create one asset with our desired id. let asset_id = 9; let origin: MultiLocation = account_id_junction::(1).into(); @@ -74,19 +74,19 @@ benchmarks! { holding.subsume(asset); assert!(T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); }: { - assert_ok!(execute_xcm::(origin, holding, xcm).ensure_complete()); + execute_xcm::(origin, holding, xcm)?; } verify { assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()) } - order_deposit_reserve_asset {}: {} verify {} - order_exchange_asset {}: {} verify {} - order_initiate_reserve_withdraw {}: {} verify {} - order_initiate_teleport {}: {} verify {} - order_query_holding {}: {} verify {} - order_buy_execution {}: {} verify {} + deposit_reserve_asset {}: {} verify {} + exchange_asset {}: {} verify {} + initiate_reserve_withdraw {}: {} verify {} + initiate_teleport {}: {} verify {} + query_holding {}: {} verify {} + buy_execution {}: {} verify {} - xcm_withdraw_asset_per_asset { + withdraw_asset_per_asset { // number of fungible assets. let a in 1..MAX_ASSETS+1; @@ -101,16 +101,16 @@ benchmarks! { // check just one of the asset ids, namely 1. assert!(!T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); let instruction = Instruction::>::WithdrawAsset(assets); - let xcm = instruction.into(); + let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + execute_xcm::(origin, Default::default(), xcm)?; } verify { // check one of the assets of origin. All assets must have been withdrawn. assert!(T::TransactAsset::balance(1u32.into(), &account::(1)).is_zero()); } - xcm_reserve_asset_deposit {}: {} verify {} - xcm_receive_teleported_asset {}: {} verify {} - xcm_transfer_asset_per_asset { + reserve_asset_deposit {}: {} verify {} + receive_teleported_asset {}: {} verify {} + transfer_asset_per_asset { let a in 1..MAX_ASSETS+1; let origin: MultiLocation = (account_id_junction::(1)).into(); @@ -133,15 +133,15 @@ benchmarks! { .collect::>().into(); let instruction = Instruction::TransferAsset { assets, beneficiary }; - let xcm = instruction.into(); + let xcm = Xcm(vec![instruction]); }: { - assert_ok!(execute_xcm::(origin, xcm).ensure_complete()); + execute_xcm::(origin, Default::default(), xcm)?; } verify { for asset_id in 1..a { assert!(!T::TransactAsset::balance(asset_id.into(), &account::(2)).is_zero()); } } - xcm_transfer_reserve_asset {}: {} verify {} + transfer_reserve_asset {}: {} verify {} } impl_benchmark_test_suite!( diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 2790d31e9f6e..6fab0626f0ac 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -178,6 +178,9 @@ impl xcm_executor::Config for XcmConfig { type Weigher = xcm_builder::FixedWeightBounds; type Trader = xcm_builder::FixedRateOfFungible; type ResponseHandler = DevNull; + type AssetTrap = (); + type AssetClaims = (); + type SubscriptionService = (); } impl crate::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 139b44b43968..7282ce13e8c7 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -33,7 +33,7 @@ use xcm::latest::prelude::*; use xcm_executor::{traits::Convert, Assets}; pub mod fungible; -// pub mod fungibles; +pub mod fungibles; pub mod xcm_generic; #[cfg(test)] From ec16d4474cce25354af40676ed54bc1e758713cf Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 5 Sep 2021 22:21:15 -0400 Subject: [PATCH 58/63] update xcm_weight --- Cargo.lock | 39 +++++ runtime/westend/src/lib.rs | 6 +- runtime/westend/src/xcm_weights/mod.rs | 155 +++++++++++------- .../westend/src/xcm_weights/xcm_balances.rs | 16 +- .../westend/src/xcm_weights/xcm_generic.rs | 52 ++++-- xcm/pallet-xcm-benchmarks/Cargo.toml | 2 +- .../src/fungible/benchmarking.rs | 12 +- .../src/fungible/mock.rs | 11 +- .../src/fungibles/mock.rs | 11 +- xcm/pallet-xcm-benchmarks/src/lib.rs | 27 +-- .../src/xcm_generic/benchmarking.rs | 12 +- .../src/xcm_generic/mock.rs | 14 +- xcm/pallet-xcm/src/lib.rs | 15 +- xcm/src/lib.rs | 2 +- 14 files changed, 245 insertions(+), 129 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab75fc06d334..9a0abed339dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4527,6 +4527,19 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" @@ -5287,6 +5300,30 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "parity-db" version = "0.3.1" @@ -11429,6 +11466,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -11575,6 +11613,7 @@ version = "0.9.9" dependencies = [ "frame-support", "frame-system", + "log", "pallet-balances", "pallet-transaction-payment", "pallet-xcm", diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index a6e71b004161..f51d8750c73a 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1476,7 +1476,11 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = LocationConverter; - type ValidDestination = Westmint; + fn valid_destination() -> Result { + let valid_destination = Westmint::get(); + XcmPallet::set_xcm_version(&valid_destination, xcm::latest::VERSION); + Ok(valid_destination) + } } impl pallet_xcm_benchmarks::xcm_generic::Config for Runtime { diff --git a/runtime/westend/src/xcm_weights/mod.rs b/runtime/westend/src/xcm_weights/mod.rs index eb91f526c19a..22053bee62e3 100644 --- a/runtime/westend/src/xcm_weights/mod.rs +++ b/runtime/westend/src/xcm_weights/mod.rs @@ -62,102 +62,131 @@ impl WeighMultiAssets for MultiAssets { pub struct WestendXcmWeight; impl XcmWeightInfo<()> for WestendXcmWeight { - fn order_noop() -> Weight { - XcmGeneric::::order_noop() + fn withdraw_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::withdraw_asset()) } - fn order_deposit_asset( + fn reserve_asset_deposited(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::reserve_asset_deposited()) + } + // TODO none of these need effects + fn receive_teleported_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::receive_teleported_asset()) + } + fn query_response(_query_id: &u64, _response: &Response, max_weight: &u64) -> Weight { + *max_weight + } + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::transfer_asset()) + } + fn transfer_reserve_asset( + assets: &MultiAssets, + _dest: &MultiLocation, + _xcm: &Xcm<()>, + ) -> Weight { + assets.weigh_multi_assets(XcmBalancesWeight::::transfer_reserve_asset()) + } + fn transact( + _origin_type: &OriginKind, + _require_weight_at_most: &u64, + _call: &DoubleEncoded<()>, + ) -> Weight { + XcmGeneric::::transact() + } + fn hrmp_new_channel_open_request( + _sender: &u32, + _max_message_size: &u32, + _max_capacity: &u32, + ) -> Weight { + XcmGeneric::::hrmp_new_channel_open_request() + } + fn hrmp_channel_accepted(_recipient: &u32) -> Weight { + XcmGeneric::::hrmp_channel_accepted() + } + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { + XcmGeneric::::hrmp_channel_closing() + } + fn clear_origin() -> Weight { + XcmGeneric::::clear_origin() + } + fn descend_origin(who: &InteriorMultiLocation) -> Weight { + XcmGeneric::::descend_origin(who) + } + fn report_error( + _query_id: &QueryId, + _dest: &MultiLocation, + max_response_weight: &u64, + ) -> Weight { + *max_response_weight + } + fn relayed_from(_who: &Junctions, _message: &Box>) -> Weight { + XcmGeneric::::relayed_from() + } + + fn deposit_asset( assets: &MultiAssetFilter, _max_assets: &u32, // TODO use max assets? _dest: &MultiLocation, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_asset()) + assets.weigh_multi_assets(XcmBalancesWeight::::deposit_asset()) } - fn order_deposit_reserve_asset( + fn deposit_reserve_asset( assets: &MultiAssetFilter, _max_assets: &u32, // TODO use max assets? _dest: &MultiLocation, - _effects: &Vec>, + _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::order_deposit_reserve_asset()) + assets.weigh_multi_assets(XcmBalancesWeight::::deposit_reserve_asset()) } - fn order_exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> Weight { + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> Weight { Weight::MAX // todo fix } - fn order_initiate_reserve_withdraw( + fn initiate_reserve_withdraw( assets: &MultiAssetFilter, _reserve: &MultiLocation, - _effects: &Vec>, + _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::order_initiate_reserve_withdraw()) + assets.weigh_multi_assets(XcmBalancesWeight::::initiate_reserve_withdraw()) } - fn order_initiate_teleport( + fn initiate_teleport( assets: &MultiAssetFilter, _dest: &MultiLocation, - _effects: &Vec>, + _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::order_initiate_teleport()) + assets.weigh_multi_assets(XcmBalancesWeight::::initiate_teleport()) } - fn order_query_holding( + fn query_holding( _query_id: &u64, _dest: &MultiLocation, _assets: &MultiAssetFilter, + _max_response_weight: &u64, ) -> Weight { - XcmGeneric::::order_query_holding() - } - fn order_buy_execution( - _fees: &MultiAsset, - _weight: &u64, - _debt: &u64, - _halt_on_error: &bool, - _order: &Vec>, - _xcm: &Vec>, - ) -> Weight { - XcmGeneric::::order_buy_execution() + XcmGeneric::::query_holding() } - fn xcm_withdraw_asset(assets: &MultiAssets, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_withdraw_asset()) + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> Weight { + XcmGeneric::::buy_execution() } - fn xcm_reserve_asset_deposited(assets: &MultiAssets, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmGeneric::::xcm_reserve_asset_deposited()) + fn refund_surplus() -> Weight { + XcmGeneric::::refund_surplus() } - // TODO none of these need effects - fn xcm_receive_teleported_asset(assets: &MultiAssets, _effects: &Vec>) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_receive_teleported_asset()) + fn set_error_handler(_xcm: &Xcm<()>) -> Weight { + XcmGeneric::::set_error_handler() } - fn xcm_query_response(_query_id: &u64, _response: &Response) -> Weight { - XcmGeneric::::xcm_query_response() + fn set_appendix(_xcm: &Xcm<()>) -> Weight { + XcmGeneric::::set_appendix() } - fn xcm_transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_asset()) + fn clear_error() -> Weight { + XcmGeneric::::clear_error() } - fn xcm_transfer_reserve_asset( - assets: &MultiAssets, - _dest: &MultiLocation, - _effects: &Vec>, - ) -> Weight { - assets.weigh_multi_assets(XcmBalancesWeight::::xcm_transfer_reserve_asset()) - } - fn xcm_transact( - _origin_type: &OriginKind, - _require_weight_at_most: &u64, - _call: &DoubleEncoded<()>, - ) -> Weight { - XcmGeneric::::xcm_transact() - } - fn xcm_hrmp_new_channel_open_request( - _sender: &u32, - _max_message_size: &u32, - _max_capacity: &u32, - ) -> Weight { - XcmGeneric::::xcm_hrmp_new_channel_open_request() + fn claim_asset(assets: &MultiAssets, _ticket: &MultiLocation) -> Weight { + XcmGeneric::::claim_asset(assets) } - fn xcm_hrmp_channel_accepted(_recipient: &u32) -> Weight { - XcmGeneric::::xcm_hrmp_channel_accepted() + fn trap(code: &u64) -> Weight { + XcmGeneric::::trap(code) } - fn xcm_hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { - XcmGeneric::::xcm_hrmp_channel_closing() + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> Weight { + XcmGeneric::::subscribe_version() } - fn xcm_relayed_from(_who: &Junctions, _message: &Box>) -> Weight { - XcmGeneric::::xcm_relayed_from() + fn unsubscribe_version() -> Weight { + XcmGeneric::::unsubscribe_version() } } diff --git a/runtime/westend/src/xcm_weights/xcm_balances.rs b/runtime/westend/src/xcm_weights/xcm_balances.rs index ae00056b4e66..6fcffb58df9d 100644 --- a/runtime/westend/src/xcm_weights/xcm_balances.rs +++ b/runtime/westend/src/xcm_weights/xcm_balances.rs @@ -43,7 +43,7 @@ use sp_std::marker::PhantomData; pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) - pub(crate) fn order_deposit_asset() -> Weight { + pub(crate) fn deposit_asset() -> Weight { (40_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -52,7 +52,7 @@ impl WeightInfo { // Storage: Dmp DownwardMessageQueues (r:1 w:1) // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: System Account (r:1 w:1) - pub(crate) fn order_deposit_reserve_asset() -> Weight { + pub(crate) fn deposit_reserve_asset() -> Weight { (52_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -61,7 +61,7 @@ impl WeightInfo { // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - pub(crate) fn order_initiate_reserve_withdraw() -> Weight { + pub(crate) fn initiate_reserve_withdraw() -> Weight { (51_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -70,22 +70,22 @@ impl WeightInfo { // Storage: Configuration ActiveConfig (r:1 w:0) // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) - pub(crate) fn order_initiate_teleport() -> Weight { + pub(crate) fn initiate_teleport() -> Weight { (49_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: System Account (r:1 w:1) - pub(crate) fn xcm_withdraw_asset() -> Weight { + pub(crate) fn withdraw_asset() -> Weight { (21_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - pub(crate) fn xcm_receive_teleported_asset() -> Weight { + pub(crate) fn receive_teleported_asset() -> Weight { (0 as Weight) } // Storage: System Account (r:2 w:2) - pub(crate) fn xcm_transfer_asset() -> Weight { + pub(crate) fn transfer_asset() -> Weight { (29_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -94,7 +94,7 @@ impl WeightInfo { // Storage: Dmp DownwardMessageQueues (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) - pub(crate) fn xcm_transfer_reserve_asset() -> Weight { + pub(crate) fn transfer_reserve_asset() -> Weight { (42_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs index b3e3b400566e..928e9ee2703e 100644 --- a/runtime/westend/src/xcm_weights/xcm_generic.rs +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -2,34 +2,66 @@ use frame_support::dispatch::Weight; pub struct WeightInfo(sp_std::marker::PhantomData); impl WeightInfo { - pub fn order_noop() -> Weight { + pub fn query_holding() -> Weight { 10 } - pub fn order_query_holding() -> Weight { + pub fn buy_execution() -> Weight { 10 } - pub fn order_buy_execution() -> Weight { + pub fn transact() -> Weight { 10 } - pub fn xcm_transact() -> Weight { + pub fn reserve_asset_deposited() -> Weight { 10 } - pub fn xcm_reserve_asset_deposited() -> Weight { + pub fn hrmp_new_channel_open_request() -> Weight { 10 } - pub fn xcm_hrmp_new_channel_open_request() -> Weight { + pub fn hrmp_channel_accepted() -> Weight { 10 } - pub fn xcm_hrmp_channel_accepted() -> Weight { + pub fn hrmp_channel_closing() -> Weight { 10 } - pub fn xcm_hrmp_channel_closing() -> Weight { + pub fn relayed_from() -> Weight { 10 } - pub fn xcm_relayed_from() -> Weight { + pub fn query_response() -> Weight { 10 } - pub fn xcm_query_response() -> Weight { + pub fn refund_surplus() -> Weight { + 10 + } + + pub fn set_error_handler() -> Weight { + 10 + } + pub fn set_appendix() -> Weight { + 10 + } + pub fn clear_error() -> Weight { + 10 + } + pub fn claim_asset(_assets: &crate::MultiAssets) -> Weight { + 10 + } + pub fn trap(_code: &u64) -> Weight { + 10 + } + + pub fn subscribe_version() -> Weight { + 10 + } + + pub fn unsubscribe_version() -> Weight { + 10 + } + + pub fn clear_origin() -> Weight { + 10 + } + + pub fn descend_origin(_who: &crate::InteriorMultiLocation) -> Weight { 10 } } diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index 8b95523c1ffa..2b1074097c33 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -16,6 +16,7 @@ sp-std = { version = "4.0.0-dev", default-features = false, branch = "master", g xcm-executor = { path = "../xcm-executor", default-features = false, features = ["runtime-benchmarks"] } frame-benchmarking = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" } xcm = { path = "..", default-features = false, features = ["runtime-benchmarks"] } +log = "0.4.0" [dev-dependencies] pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } @@ -25,7 +26,6 @@ sp-io = { version = "4.0.0-dev", branch = "master", git = "https://github.com/pa sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" } xcm-builder = { path = "../xcm-builder" } xcm = { path = ".." } -log = "0.4.0" # temp pallet-xcm = { path = "../pallet-xcm" } polkadot-runtime-common = { path = "../../runtime/common" } diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs index ce1c598c600b..1db35e8c00ce 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -49,7 +49,7 @@ benchmarks_instance_pallet! { // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); // our dest must have no balance initially. - let ben_location = T::ValidDestination::get(); + let ben_location = T::valid_destination()?; let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); assert!(T::TransactAsset::balance(&ben_account).is_zero()); @@ -77,7 +77,7 @@ benchmarks_instance_pallet! { // .. and the specific asset that we want to take out. holding.subsume(asset.clone()); // our dest must have no balance initially. - let dest_location = T::ValidDestination::get(); + let dest_location = T::valid_destination()?; let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); assert!(T::TransactAsset::balance(&dest_account).is_zero()); @@ -107,7 +107,7 @@ benchmarks_instance_pallet! { let instruction = Instruction::>::DepositReserveAsset { assets: asset.into(), max_assets: 1, - dest: T::ValidDestination::get(), + dest: T::valid_destination()?, xcm: Xcm::new(), }; let xcm = Xcm(vec![instruction]); @@ -129,7 +129,7 @@ benchmarks_instance_pallet! { let instruction = Instruction::>::InitiateTeleport { assets: asset.into(), - dest: T::ValidDestination::get(), + dest: T::valid_destination()?, xcm: Xcm::new(), }; let xcm = Xcm(vec![instruction]); @@ -181,7 +181,7 @@ benchmarks_instance_pallet! { transfer_asset { let (sender_account, sender_location) = account_and_location::(1); - let ben_location = T::ValidDestination::get(); + let ben_location = T::valid_destination()?; let ben_account = T::AccountIdConverter::convert(ben_location.clone()).unwrap(); let asset = T::get_multi_asset(); @@ -199,7 +199,7 @@ benchmarks_instance_pallet! { transfer_reserve_asset { let (sender_account, sender_location) = account_and_location::(1); - let dest_location = T::ValidDestination::get(); + let dest_location = T::valid_destination()?; let dest_account = T::AccountIdConverter::convert(dest_location.clone()).unwrap(); let asset = T::get_multi_asset(); diff --git a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index 46924c139b90..a505c54065c4 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -145,15 +145,16 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; - type ValidDestination = ValidDestination; + fn valid_destination() -> Result { + let valid_destination: MultiLocation = + X1(AccountId32 { network: NetworkId::Any, id: [0u8; 32] }).into(); + + Ok(valid_destination) + } } parameter_types! { pub const CheckedAccount: Option = Some(100); - pub const ValidDestination: MultiLocation = X1(AccountId32 { - network: NetworkId::Any, - id: [0u8; 32], - }).into(); } impl xcm_balances_benchmark::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs index 6fab0626f0ac..5de5f92e5229 100644 --- a/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/fungibles/mock.rs @@ -146,10 +146,6 @@ impl xcm_executor::traits::MatchesFungibles for MatchAnyFungibles { parameter_types! { pub const CheckedAccount: u64 = 100; - pub const ValidDestination: MultiLocation = Junction::AccountId32 { - network: NetworkId::Any, - id: [0u8; 32], - }.into(); } pub type AssetTransactor = xcm_builder::FungiblesAdapter< @@ -186,7 +182,12 @@ impl xcm_executor::Config for XcmConfig { impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; - type ValidDestination = ValidDestination; + fn valid_destination() -> Result { + let valid_destination: MultiLocation = + Junction::AccountId32 { network: NetworkId::Any, id: [0u8; 32] }.into(); + + Ok(valid_destination) + } } impl xcm_assets_benchmarks::Config for Test { diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index 7282ce13e8c7..c4efbf12ca01 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -19,14 +19,10 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::Encode; -use frame_support::{ - dispatch::Weight, - pallet_prelude::Get, - traits::{ - fungible::Inspect as FungibleInspect, - fungibles::Inspect as FungiblesInspect, - tokens::{DepositConsequence, WithdrawConsequence}, - }, +use frame_support::traits::{ + fungible::Inspect as FungibleInspect, + fungibles::Inspect as FungiblesInspect, + tokens::{DepositConsequence, WithdrawConsequence}, }; use sp_std::prelude::*; use xcm::latest::prelude::*; @@ -50,12 +46,12 @@ pub trait Config: frame_system::Config { // temp? type AccountIdConverter: Convert; - /// A valid destination location which can be used in benchmarks. - type ValidDestination: Get; + /// Does any necessary setup to create a valid destination for XCM messages. + /// Returns that destination's multi-location to be used in benchmarks. + fn valid_destination() -> Result; } const SEED: u32 = 0; -const MAX_WEIGHT: Weight = 999_999_999_999; /// The xcm executor to use for doing stuff. pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; @@ -113,8 +109,13 @@ pub fn execute_xcm( // TODO: #2841 #REALWEIGHT We should deduct the cost of any instructions following // the error which didn't end up being executed. Err((index, error, weight)) => { - println!("XCM ERROR :: Index: {:?}, Error: {:?}, Weight: {:?}", index, error, weight); - Err(sp_runtime::DispatchError::Other("execute xcm error")) + log::error!( + "XCM ERROR >> Index: {:?}, Error: {:?}, Weight: {:?}", + index, + error, + weight + ); + Err(sp_runtime::DispatchError::Other("execute xcm error: see error logs")) }, } } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 8063faa36e55..10060c5e7270 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -19,8 +19,9 @@ use crate::{ account_and_location, account_id_junction, execute_xcm, worst_case_holding, XcmCallOf, }; use codec::Encode; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, BenchmarkError, BenchmarkResult}; use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::Get}; +use sp_std::vec; use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { @@ -38,7 +39,7 @@ benchmarks! { let instruction = Instruction::>::QueryHolding { query_id: Default::default(), - dest: T::ValidDestination::get(), + dest: T::valid_destination()?, assets: Wild(WildMultiAsset::All), // TODO is worst case filter? max_response_weight: u64::MAX, }; @@ -46,7 +47,12 @@ benchmarks! { let xcm = Xcm(vec![instruction]); } : { - execute_xcm::(origin, holding, xcm)?; + execute_xcm::(origin, holding, xcm) + .map_err(|_| + BenchmarkError::Override( + BenchmarkResult::from_weight(T::BlockWeights::get().max_block) + ) + )?; } verify { // The assert above is enough to validate this is completed. // todo maybe XCM sender peek diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs index 3fcda9be00a2..47434d26acae 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/mock.rs @@ -107,17 +107,15 @@ impl xcm_executor::Config for XcmConfig { type SubscriptionService = (); } -parameter_types! { - pub const ValidDestination: MultiLocation = Junction::AccountId32 { - network: NetworkId::Any, - id: [0u8; 32], - }.into(); -} - impl crate::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; - type ValidDestination = ValidDestination; + fn valid_destination() -> Result { + let valid_destination: MultiLocation = + Junction::AccountId32 { network: NetworkId::Any, id: [0u8; 32] }.into(); + + Ok(valid_destination) + } } impl xcm_generic_benchmarks::Config for Test { diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 314a929803cd..5669497b5b7a 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -653,11 +653,7 @@ pub mod pallet { ) -> DispatchResult { ensure_root(origin)?; let location = *location; - SupportedVersion::::insert( - XCM_VERSION, - LatestVersionedMultiLocation(&location), - xcm_version, - ); + Self::set_xcm_version(&location, xcm_version); Self::deposit_event(Event::SupportedVersionChanged(location, xcm_version)); Ok(()) } @@ -1037,6 +1033,15 @@ pub mod pallet { } }); } + + /// Set the xcm version for a specific multi-location. + pub fn set_xcm_version(location: &MultiLocation, xcm_version: XcmVersion) { + SupportedVersion::::insert( + XCM_VERSION, + LatestVersionedMultiLocation(&location), + xcm_version, + ); + } } impl WrapVersion for Pallet { diff --git a/xcm/src/lib.rs b/xcm/src/lib.rs index e4a1b8b07ecd..ff5f0cd4eba2 100644 --- a/xcm/src/lib.rs +++ b/xcm/src/lib.rs @@ -422,7 +422,7 @@ impl WrapVersion for AlwaysV1 { } } -/// `WrapVersion` implementation which attempts to always convert the XCM to version 1 before wrapping it. +/// `WrapVersion` implementation which attempts to always convert the XCM to version 2 before wrapping it. pub struct AlwaysV2; impl WrapVersion for AlwaysV2 { fn wrap_version( From fe27083328914b4b6c7c0297f330268994fe43db Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 6 Sep 2021 13:03:31 -0400 Subject: [PATCH 59/63] executor error and pub --- Cargo.lock | 1 + .../westend/src/xcm_weights/xcm_generic.rs | 4 -- xcm/pallet-xcm-benchmarks/src/lib.rs | 26 +++----- .../src/xcm_generic/benchmarking.rs | 46 +++++++++++--- xcm/xcm-executor/Cargo.toml | 5 +- xcm/xcm-executor/src/lib.rs | 62 ++++++++++++------- 6 files changed, 88 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a0abed339dd..ca0338d422d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11633,6 +11633,7 @@ dependencies = [ name = "xcm-executor" version = "0.9.9" dependencies = [ + "frame-benchmarking", "frame-support", "impl-trait-for-tuples", "log", diff --git a/runtime/westend/src/xcm_weights/xcm_generic.rs b/runtime/westend/src/xcm_weights/xcm_generic.rs index 928e9ee2703e..d50e022760b4 100644 --- a/runtime/westend/src/xcm_weights/xcm_generic.rs +++ b/runtime/westend/src/xcm_weights/xcm_generic.rs @@ -26,13 +26,9 @@ impl WeightInfo { pub fn relayed_from() -> Weight { 10 } - pub fn query_response() -> Weight { - 10 - } pub fn refund_surplus() -> Weight { 10 } - pub fn set_error_handler() -> Weight { 10 } diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index c4efbf12ca01..a97e01853e0b 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -98,26 +98,16 @@ pub fn execute_xcm( origin: MultiLocation, holding: Assets, xcm: Xcm>, -) -> sp_runtime::DispatchResult { +) -> Result<(), frame_benchmarking::BenchmarkError> { // TODO: very large weight to ensure all benchmarks execute, sensible? let mut executor = ExecutorOf::::new(origin); - executor.set_holding(holding); - let result = executor.execute(xcm); - - match result { - Ok(()) => Ok(()), - // TODO: #2841 #REALWEIGHT We should deduct the cost of any instructions following - // the error which didn't end up being executed. - Err((index, error, weight)) => { - log::error!( - "XCM ERROR >> Index: {:?}, Error: {:?}, Weight: {:?}", - index, - error, - weight - ); - Err(sp_runtime::DispatchError::Other("execute xcm error: see error logs")) - }, - } + executor.holding = holding; + executor.execute(xcm)?; + Ok(()) +} + +pub fn new_executor(origin: MultiLocation) -> ExecutorOf { + ExecutorOf::::new(origin) } // TODO probably delete and use converter diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 10060c5e7270..1f4094a36a3d 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -16,7 +16,8 @@ use super::*; use crate::{ - account_and_location, account_id_junction, execute_xcm, worst_case_holding, XcmCallOf, + account_and_location, account_id_junction, execute_xcm, new_executor, worst_case_holding, + XcmCallOf, }; use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, BenchmarkError, BenchmarkResult}; @@ -25,14 +26,6 @@ use sp_std::vec; use xcm::{latest::prelude::*, DoubleEncoded}; benchmarks! { - noop { - let xcm = Xcm::>::new(); - let origin: MultiLocation = account_id_junction::(1).into(); - let holding = worst_case_holding(); - }: { - execute_xcm::(origin, holding, xcm)?; - } - query_holding { let origin: MultiLocation = account_id_junction::(1).into(); let holding = worst_case_holding(); @@ -149,6 +142,41 @@ benchmarks! { // currently unhandled } verify {} + refund_surplus { + let (sender_account, sender_location) = account_and_location::(1); + let mut executor = new_executor::(sender_location); + executor.total_surplus = 1337; + executor.total_refunded = 0; + + let instruction = Instruction::>::RefundSurplus; + let xcm = Xcm(vec![instruction]); + } : { + let result = executor.execute(xcm)?; + + println!("result {:?}", result); + } verify { + assert_eq!(executor.total_surplus, 1337); + assert_eq!(executor.total_refunded, 1337); + } + + set_error_handler {} : {} verify {} + + set_appendix {} : {} verify {} + + clear_error {} : {} verify {} + + claim_asset {} : {} verify {} + + trap {} : {} verify {} + + subscribe_version {} : {} verify {} + + unsubscribe_version {} : {} verify {} + + clear_origin {} : {} verify {} + + descend_origin {} : {} verify {} + } impl_benchmark_test_suite!( diff --git a/xcm/xcm-executor/Cargo.toml b/xcm/xcm-executor/Cargo.toml index e7a46b591c9b..daf507e54743 100644 --- a/xcm/xcm-executor/Cargo.toml +++ b/xcm/xcm-executor/Cargo.toml @@ -16,6 +16,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } log = { version = "0.4.14", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false, optional = true } [features] default = ["std"] @@ -30,4 +31,6 @@ std = [ "frame-support/std", "log/std", ] -runtime-benchmarks = [] +runtime-benchmarks = [ + "frame-benchmarking", +] diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index f6afaca8caf0..94a936c9eb0e 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -42,23 +42,23 @@ pub use config::Config; /// The XCM executor. pub struct XcmExecutor { - holding: Assets, - origin: Option, - original_origin: MultiLocation, - trader: Config::Trader, + pub holding: Assets, + pub origin: Option, + pub original_origin: MultiLocation, + pub trader: Config::Trader, /// The most recent error result and instruction index into the fragment in which it occurred, /// if any. - error: Option<(u32, XcmError)>, + pub error: Option<(u32, XcmError)>, /// The surplus weight, defined as the amount by which `max_weight` is /// an over-estimate of the actual weight consumed. We do it this way to avoid needing the /// execution engine to keep track of all instructions' weights (it only needs to care about /// the weight of dynamically determined instructions such as `Transact`). - total_surplus: u64, - total_refunded: u64, - error_handler: Xcm, - error_handler_weight: u64, - appendix: Xcm, - appendix_weight: u64, + pub total_surplus: u64, + pub total_refunded: u64, + pub error_handler: Xcm, + pub error_handler_weight: u64, + pub appendix: Xcm, + pub appendix_weight: u64, _config: PhantomData, } @@ -99,9 +99,9 @@ impl ExecuteXcm for XcmExecutor { while !message.0.is_empty() { let result = vm.execute(message); log::trace!(target: "xcm::execute_xcm_in_credit", "result: {:?}", result); - message = if let Err((i, e, w)) = result { - vm.total_surplus.saturating_accrue(w); - vm.error = Some((i, e)); + message = if let Err(error) = result { + vm.total_surplus.saturating_accrue(error.weight); + vm.error = Some((error.index, error.xcm_error)); vm.take_error_handler().or_else(|| vm.take_appendix()) } else { vm.drop_error_handler(); @@ -128,6 +128,26 @@ impl ExecuteXcm for XcmExecutor { } } +#[derive(Debug)] +pub struct ExecutorError { + index: u32, + xcm_error: XcmError, + weight: u64, +} + +#[cfg(feature = "runtime-benchmarks")] +impl From for frame_benchmarking::BenchmarkError { + fn from(error: ExecutorError) -> Self { + log::error!( + "XCM ERROR >> Index: {:?}, Error: {:?}, Weight: {:?}", + error.index, + error.xcm_error, + error.weight + ); + Self::Stop("xcm executor error: see error logs") + } +} + impl XcmExecutor { pub fn new(origin: MultiLocation) -> Self { Self { @@ -148,7 +168,7 @@ impl XcmExecutor { /// Execute the XCM program fragment and report back the error and which instruction caused it, /// or `Ok` if there was no error. - pub fn execute(&mut self, xcm: Xcm) -> Result<(), (u32, XcmError, u64)> { + pub fn execute(&mut self, xcm: Xcm) -> Result<(), ExecutorError> { log::trace!( target: "xcm::execute", "origin: {:?}, total_surplus/refunded: {:?}/{:?}, error_handler_weight: {:?}", @@ -162,11 +182,11 @@ impl XcmExecutor { match &mut result { r @ Ok(()) => if let Err(e) = self.process_instruction(instr) { - *r = Err((i as u32, e, 0)); + *r = Err(ExecutorError { index: i as u32, xcm_error: e, weight: 0 }); }, - Err((_, _, ref mut w)) => + Err(ref mut error) => if let Ok(x) = Config::Weigher::instr_weight(&instr) { - w.saturating_accrue(x) + error.weight.saturating_accrue(x) }, } } @@ -443,10 +463,4 @@ impl XcmExecutor { assets.prepend_location(&inv_dest); Ok(assets.into_assets_iter().collect::>().into()) } - - /// Set the holding registrar of the executor. Only used for tests and benchmarking. - #[cfg(any(test, feature = "runtime-benchmarks", feature = "std"))] - pub fn set_holding(&mut self, assets: Assets) { - self.holding = assets; - } } From 1d0f6f681f0075ae480e070e89699bccc1240167 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 6 Sep 2021 15:46:13 -0400 Subject: [PATCH 60/63] more benchmarks --- .../src/xcm_generic/benchmarking.rs | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index 1f4094a36a3d..a52bd6f6e53f 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -143,8 +143,7 @@ benchmarks! { } verify {} refund_surplus { - let (sender_account, sender_location) = account_and_location::(1); - let mut executor = new_executor::(sender_location); + let mut executor = new_executor::(Default::default()); executor.total_surplus = 1337; executor.total_refunded = 0; @@ -152,18 +151,36 @@ benchmarks! { let xcm = Xcm(vec![instruction]); } : { let result = executor.execute(xcm)?; - - println!("result {:?}", result); } verify { assert_eq!(executor.total_surplus, 1337); assert_eq!(executor.total_refunded, 1337); } - set_error_handler {} : {} verify {} + set_error_handler { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::>::SetErrorHandler(Xcm(vec![])); + let xcm = Xcm(vec![instruction]); + } : { + executor.execute(xcm)?; + } verify { + assert_eq!(executor.error_handler, Xcm(vec![])); + } - set_appendix {} : {} verify {} + set_appendix { + } : { - clear_error {} : {} verify {} + } verify {} + + clear_error { + let mut executor = new_executor::(Default::default()); + executor.error = Some((5u32, XcmError::Undefined)); + let instruction = Instruction::>::ClearError; + let xcm = Xcm(vec![instruction]); + } : { + executor.execute(xcm)?; + } verify { + assert!(executor.error.is_none()) + } claim_asset {} : {} verify {} From b18a7e99e076203b172b900cd270ac19717067d4 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 6 Sep 2021 20:35:21 -0400 Subject: [PATCH 61/63] Update Cargo.lock --- Cargo.lock | 308 ++++++++++++++++++++++++++--------------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7a461d75364..915391bcd4fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1920,7 +1920,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", ] @@ -1938,7 +1938,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -1957,7 +1957,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "Inflector", "chrono", @@ -1983,7 +1983,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -2011,7 +2011,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "serde", @@ -2022,7 +2022,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "bitflags", "frame-metadata", @@ -2048,7 +2048,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2060,7 +2060,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2072,7 +2072,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro2", "quote", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-metadata", "frame-support", @@ -2103,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -2113,7 +2113,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "log", @@ -2129,7 +2129,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -2143,7 +2143,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-api", @@ -2152,7 +2152,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "sp-api", @@ -4530,7 +4530,7 @@ checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4543,7 +4543,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -4558,7 +4558,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -4572,7 +4572,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4595,7 +4595,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4650,7 +4650,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4728,7 +4728,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4744,7 +4744,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4759,7 +4759,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4782,7 +4782,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4799,7 +4799,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4813,7 +4813,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4835,7 +4835,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4850,7 +4850,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4869,7 +4869,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4885,7 +4885,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4900,7 +4900,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4917,7 +4917,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -4933,7 +4933,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4950,7 +4950,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -4964,7 +4964,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -4977,7 +4977,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -4993,7 +4993,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5015,7 +5015,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5029,7 +5029,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -5042,7 +5042,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5057,7 +5057,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -5077,7 +5077,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5093,7 +5093,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -5106,7 +5106,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5128,7 +5128,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5139,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "sp-arithmetic", @@ -5148,7 +5148,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -5161,7 +5161,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5178,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5193,7 +5193,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-support", "frame-system", @@ -5209,7 +5209,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5226,7 +5226,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5237,7 +5237,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5253,7 +5253,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -5268,7 +5268,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-benchmarking", "frame-support", @@ -7682,7 +7682,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "env_logger 0.9.0", "jsonrpsee-proc-macros", @@ -7951,7 +7951,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "sp-core", @@ -7962,7 +7962,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "derive_more", @@ -7989,7 +7989,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -8012,7 +8012,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8028,7 +8028,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8044,7 +8044,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8055,7 +8055,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "chrono", "fdlimit", @@ -8093,7 +8093,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "fnv", "futures 0.3.17", @@ -8121,7 +8121,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "hash-db", "kvdb", @@ -8146,7 +8146,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "futures 0.3.17", @@ -8170,7 +8170,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "derive_more", @@ -8213,7 +8213,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "derive_more", "futures 0.3.17", @@ -8237,7 +8237,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8250,7 +8250,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "assert_matches", "async-trait", @@ -8284,7 +8284,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "futures 0.3.17", @@ -8310,7 +8310,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "sc-client-api", "sp-authorship", @@ -8321,7 +8321,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "lazy_static", "libsecp256k1 0.6.0", @@ -8347,7 +8347,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "derive_more", "parity-scale-codec", @@ -8364,7 +8364,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "parity-scale-codec", @@ -8380,7 +8380,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8399,7 +8399,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "derive_more", @@ -8436,7 +8436,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "derive_more", "finality-grandpa", @@ -8460,7 +8460,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "ansi_term 0.12.1", "futures 0.3.17", @@ -8477,7 +8477,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "derive_more", @@ -8492,7 +8492,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "hash-db", "parity-scale-codec", @@ -8510,7 +8510,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-std", "async-trait", @@ -8561,7 +8561,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -8577,7 +8577,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "bytes 1.0.1", "fnv", @@ -8604,7 +8604,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "libp2p", @@ -8617,7 +8617,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8626,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "hash-db", @@ -8657,7 +8657,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -8682,7 +8682,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -8698,7 +8698,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "directories", @@ -8762,7 +8762,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "parity-scale-codec", @@ -8776,7 +8776,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8798,7 +8798,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "chrono", "futures 0.3.17", @@ -8816,7 +8816,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8845,7 +8845,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8856,7 +8856,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "intervalier", @@ -8883,7 +8883,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "derive_more", "futures 0.3.17", @@ -8897,7 +8897,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -9328,7 +9328,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "hash-db", "log", @@ -9345,7 +9345,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9357,7 +9357,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "serde", @@ -9369,7 +9369,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "integer-sqrt", "num-traits", @@ -9383,7 +9383,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-api", @@ -9395,7 +9395,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "parity-scale-codec", @@ -9407,7 +9407,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-api", @@ -9419,7 +9419,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "log", @@ -9437,7 +9437,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "futures 0.3.17", @@ -9456,7 +9456,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "merlin", @@ -9478,7 +9478,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9488,7 +9488,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9500,7 +9500,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "base58", "blake2-rfc", @@ -9544,7 +9544,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9553,7 +9553,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro2", "quote", @@ -9563,7 +9563,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "environmental", "parity-scale-codec", @@ -9574,7 +9574,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "finality-grandpa", "log", @@ -9591,7 +9591,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9605,7 +9605,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "hash-db", @@ -9630,7 +9630,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "lazy_static", "sp-core", @@ -9641,7 +9641,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "derive_more", @@ -9658,7 +9658,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "ruzstd", "zstd", @@ -9667,7 +9667,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "serde", @@ -9680,7 +9680,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9691,7 +9691,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "sp-api", "sp-core", @@ -9701,7 +9701,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "backtrace", ] @@ -9709,7 +9709,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "rustc-hash", "serde", @@ -9719,7 +9719,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "either", "hash256-std-hasher", @@ -9740,7 +9740,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9757,7 +9757,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9769,7 +9769,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "serde", "serde_json", @@ -9778,7 +9778,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-api", @@ -9791,7 +9791,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9801,7 +9801,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "hash-db", "log", @@ -9824,12 +9824,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9842,7 +9842,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "sp-core", @@ -9855,7 +9855,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -9871,7 +9871,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "erased-serde", "log", @@ -9889,7 +9889,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "sp-api", "sp-runtime", @@ -9898,7 +9898,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "log", @@ -9913,7 +9913,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "hash-db", "memory-db", @@ -9927,7 +9927,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9942,7 +9942,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9953,7 +9953,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10147,7 +10147,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "platforms", ] @@ -10155,7 +10155,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.17", @@ -10177,7 +10177,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-std", "derive_more", @@ -10191,7 +10191,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "async-trait", "futures 0.3.17", @@ -10218,7 +10218,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "futures 0.3.17", "substrate-test-utils-derive", @@ -10228,7 +10228,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -10239,7 +10239,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -10392,7 +10392,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "frame-system", "futures 0.3.17", @@ -10799,7 +10799,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#d73c37ecc16f4895c5f6ed5126d72af8cf87d9b3" +source = "git+https://github.com/paritytech/substrate?branch=master#5e93ac7ea550a68b37eeea0b5c7bb3825fcaf8da" dependencies = [ "log", "parity-scale-codec", From 402282c385ff4950dd3c3c7142c293eae7be8e86 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Mon, 6 Sep 2021 22:52:07 -0400 Subject: [PATCH 62/63] more --- xcm/pallet-xcm-benchmarks/src/lib.rs | 23 +++- .../src/xcm_generic/benchmarking.rs | 105 +++++++++++++----- 2 files changed, 93 insertions(+), 35 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/lib.rs b/xcm/pallet-xcm-benchmarks/src/lib.rs index a97e01853e0b..99ce77cdc4c3 100644 --- a/xcm/pallet-xcm-benchmarks/src/lib.rs +++ b/xcm/pallet-xcm-benchmarks/src/lib.rs @@ -19,10 +19,14 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::Encode; -use frame_support::traits::{ - fungible::Inspect as FungibleInspect, - fungibles::Inspect as FungiblesInspect, - tokens::{DepositConsequence, WithdrawConsequence}, +use frame_benchmarking::{BenchmarkError, BenchmarkResult}; +use frame_support::{ + traits::{ + fungible::Inspect as FungibleInspect, + fungibles::Inspect as FungiblesInspect, + tokens::{DepositConsequence, WithdrawConsequence}, + }, + weights::Weight, }; use sp_std::prelude::*; use xcm::latest::prelude::*; @@ -98,7 +102,7 @@ pub fn execute_xcm( origin: MultiLocation, holding: Assets, xcm: Xcm>, -) -> Result<(), frame_benchmarking::BenchmarkError> { +) -> Result<(), BenchmarkError> { // TODO: very large weight to ensure all benchmarks execute, sensible? let mut executor = ExecutorOf::::new(origin); executor.holding = holding; @@ -106,6 +110,15 @@ pub fn execute_xcm( Ok(()) } +pub fn execute_xcm_override_error( + origin: MultiLocation, + holding: Assets, + xcm: Xcm>, +) -> Result<(), BenchmarkError> { + execute_xcm::(origin, holding, xcm) + .map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))) +} + pub fn new_executor(origin: MultiLocation) -> ExecutorOf { ExecutorOf::::new(origin) } diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index a52bd6f6e53f..ac50fc253313 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -16,12 +16,12 @@ use super::*; use crate::{ - account_and_location, account_id_junction, execute_xcm, new_executor, worst_case_holding, - XcmCallOf, + account_and_location, account_id_junction, execute_xcm, execute_xcm_override_error, + new_executor, worst_case_holding, XcmCallOf, }; use codec::Encode; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, BenchmarkError, BenchmarkResult}; -use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::Get}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_support::dispatch::GetDispatchInfo; use sp_std::vec; use xcm::{latest::prelude::*, DoubleEncoded}; @@ -40,12 +40,7 @@ benchmarks! { let xcm = Xcm(vec![instruction]); } : { - execute_xcm::(origin, holding, xcm) - .map_err(|_| - BenchmarkError::Override( - BenchmarkResult::from_weight(T::BlockWeights::get().max_block) - ) - )?; + execute_xcm_override_error::(origin, holding, xcm)?; } verify { // The assert above is enough to validate this is completed. // todo maybe XCM sender peek @@ -80,7 +75,7 @@ benchmarks! { let instruction = Instruction::ReserveAssetDeposited(assets); let xcm = Xcm(vec![instruction]); }: { - execute_xcm::(sender_location, Default::default(), xcm)?; + execute_xcm_override_error::(sender_location, Default::default(), xcm)?; } verify { // The assert above is enough to show this XCM succeeded } @@ -123,24 +118,48 @@ benchmarks! { hrmp_new_channel_open_request { let (sender_account, sender_location) = account_and_location::(1); - // Inputs here should not matter to weight. - // let instruction = Instruction::HrmpNewChannelOpenRequest { - // sender: Default::default(), - // max_message_size: Default::default(), - // max_capacity: Default::default(), - // }; + let instruction = Instruction::HrmpNewChannelOpenRequest { + sender: 1, + max_message_size: 100, + max_capacity: 100 + }; + + let xcm = Xcm(vec![instruction]); }: { - // assert_ok!(execute_xcm::(sender_location, Default::default(), xcm).ensure_complete()); - // currently unhandled + execute_xcm_override_error::(sender_location, Default::default(), xcm)?; } verify { + // TODO: query pallet + } + hrmp_channel_accepted { + let (sender_account, sender_location) = account_and_location::(1); + // TODO open channel request first. + + let instruction = Instruction::HrmpChannelAccepted { + recipient: 1, + }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm_override_error::(sender_location, Default::default(), xcm)?; + } verify { + // TODO: query pallet + } + + hrmp_channel_closing { + let (sender_account, sender_location) = account_and_location::(1); + // TODO open channel first. + + let instruction = Instruction::HrmpChannelClosing { + initiator: 1, + sender: 1, + recipient: 2, + }; + let xcm = Xcm(vec![instruction]); + }: { + execute_xcm_override_error::(sender_location, Default::default(), xcm)?; + } verify { + // TODO: query pallet } - hrmp_channel_accepted {}: { - // currently unhandled - } verify {} - hrmp_channel_closing {}: { - // currently unhandled - } verify {} refund_surplus { let mut executor = new_executor::(Default::default()); @@ -167,6 +186,7 @@ benchmarks! { } set_appendix { + } : { } verify {} @@ -182,7 +202,36 @@ benchmarks! { assert!(executor.error.is_none()) } - claim_asset {} : {} verify {} + descend_origin { + let mut executor = new_executor::(Default::default()); + let who = X2(OnlyChild, OnlyChild); + let instruction = Instruction::DescendOrigin(who.clone()); + let xcm = Xcm(vec![instruction]); + } : { + executor.execute(xcm)?; + } verify { + assert_eq!( + executor.origin, + Some(MultiLocation { + parents: 0, + interior: who, + }), + ); + } + + clear_origin { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::ClearOrigin; + let xcm = Xcm(vec![instruction]); + } : { + executor.execute(xcm)?; + } verify { + assert_eq!(executor.origin, None); + } + + claim_asset { + + } : {} verify {} trap {} : {} verify {} @@ -190,10 +239,6 @@ benchmarks! { unsubscribe_version {} : {} verify {} - clear_origin {} : {} verify {} - - descend_origin {} : {} verify {} - } impl_benchmark_test_suite!( From e091c29a383b98dccbb553a49a765f1b9b290558 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Tue, 7 Sep 2021 00:16:33 -0400 Subject: [PATCH 63/63] more --- .../src/xcm_generic/benchmarking.rs | 35 +++++++++++++++---- xcm/xcm-executor/src/lib.rs | 6 ++-- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs index ac50fc253313..2194aea935f3 100644 --- a/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs +++ b/xcm/pallet-xcm-benchmarks/src/xcm_generic/benchmarking.rs @@ -20,11 +20,13 @@ use crate::{ new_executor, worst_case_holding, XcmCallOf, }; use codec::Encode; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, BenchmarkError}; use frame_support::dispatch::GetDispatchInfo; use sp_std::vec; use xcm::{latest::prelude::*, DoubleEncoded}; +const MAX_ASSETS: u32 = 100; + benchmarks! { query_holding { let origin: MultiLocation = account_id_junction::(1).into(); @@ -69,15 +71,21 @@ benchmarks! { // Worst case scenario for this benchmark is a large number of assets to // filter through the reserve. reserve_asset_deposited { - let (sender_account, sender_location) = account_and_location::(1); - let assets: MultiAssets = (Concrete(Here.into()), 100).into();// TODO worst case + let mut executor = new_executor::(Default::default()); + // TODO real max assets + let assets = (0..MAX_ASSETS).map(|i| MultiAsset { + id: Abstract(i.encode()), + fun: Fungible(i as u128), + + }).collect::>(); + let multiassets: MultiAssets = assets.into(); - let instruction = Instruction::ReserveAssetDeposited(assets); + let instruction = Instruction::ReserveAssetDeposited(multiassets.clone()); let xcm = Xcm(vec![instruction]); }: { - execute_xcm_override_error::(sender_location, Default::default(), xcm)?; + executor.execute(xcm)?; } verify { - // The assert above is enough to show this XCM succeeded + assert_eq!(executor.holding, multiassets.into()); } query_response { @@ -233,7 +241,20 @@ benchmarks! { } : {} verify {} - trap {} : {} verify {} + trap { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::Trap(10); + let xcm = Xcm(vec![instruction]); + } : { + match executor.execute(xcm) { + Err(error) if error.xcm_error == XcmError::Trap(10) => { + // This is the success condition + }, + _ => return Err(BenchmarkError::Stop("xcm trap did not return the expected error")) + }; + } verify { + // Verification is done above. + } subscribe_version {} : {} verify {} diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 94a936c9eb0e..6e4611b14eac 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -130,9 +130,9 @@ impl ExecuteXcm for XcmExecutor { #[derive(Debug)] pub struct ExecutorError { - index: u32, - xcm_error: XcmError, - weight: u64, + pub index: u32, + pub xcm_error: XcmError, + pub weight: u64, } #[cfg(feature = "runtime-benchmarks")]