XCM: Implement a blocking barrier (#7098)

* Move XCM matcher to xcm-builder

* Use ProcessMessageError as the error type in MatchXcm and ShouldExecute

* Implement a blocking barrier

* Fixes

* Add benchmarking for force_suspension

* ".git/.scripts/commands/bench/bench.sh" runtime westend pallet_xcm

* ".git/.scripts/commands/bench/bench.sh" runtime rococo pallet_xcm

* ".git/.scripts/commands/bench/bench.sh" runtime kusama pallet_xcm

* ".git/.scripts/commands/bench/bench.sh" runtime polkadot pallet_xcm

* ".git/.scripts/commands/bench/bench.sh" runtime westend pallet_xcm

* ".git/.scripts/commands/bench/bench.sh" runtime rococo pallet_xcm

---------

Co-authored-by: command-bot <>
This commit is contained in:
Keith Yeung
2023-04-27 18:22:39 +08:00
committed by GitHub
parent 1125655024
commit d20e3c1145
18 changed files with 644 additions and 444 deletions
@@ -13,25 +13,28 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-03-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-04-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// target/production/polkadot
// benchmark
// pallet
// --chain=westend-dev
// --steps=50
// --repeat=20
// --pallet=pallet_xcm
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_xcm
// --chain=westend-dev
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/
@@ -40,7 +43,7 @@
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
use core::marker::PhantomData;
/// Weight functions for `pallet_xcm`.
pub struct WeightInfo<T>(PhantomData<T>);
@@ -58,10 +61,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn send() -> Weight {
// Proof Size summary in bytes:
// Measured: `169`
// Estimated: `14210`
// Minimum execution time: 30_377_000 picoseconds.
Weight::from_parts(30_906_000, 0)
.saturating_add(Weight::from_parts(0, 14210))
// Estimated: `3634`
// Minimum execution time: 30_115_000 picoseconds.
Weight::from_parts(30_754_000, 0)
.saturating_add(Weight::from_parts(0, 3634))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
}
@@ -69,16 +72,16 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 20_605_000 picoseconds.
Weight::from_parts(20_951_000, 0)
// Minimum execution time: 21_511_000 picoseconds.
Weight::from_parts(21_766_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn reserve_transfer_assets() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 20_055_000 picoseconds.
Weight::from_parts(20_427_000, 0)
// Minimum execution time: 20_678_000 picoseconds.
Weight::from_parts(21_141_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: Benchmark Override (r:0 w:0)
@@ -97,8 +100,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_682_000 picoseconds.
Weight::from_parts(10_137_000, 0)
// Minimum execution time: 10_345_000 picoseconds.
Weight::from_parts(10_700_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -108,8 +111,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_064_000 picoseconds.
Weight::from_parts(3_201_000, 0)
// Minimum execution time: 3_317_000 picoseconds.
Weight::from_parts(3_432_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -132,10 +135,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn force_subscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `169`
// Estimated: `19667`
// Minimum execution time: 35_049_000 picoseconds.
Weight::from_parts(35_549_000, 0)
.saturating_add(Weight::from_parts(0, 19667))
// Estimated: `3634`
// Minimum execution time: 34_794_000 picoseconds.
Weight::from_parts(35_424_000, 0)
.saturating_add(Weight::from_parts(0, 3634))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
@@ -156,21 +159,32 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn force_unsubscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `326`
// Estimated: `19112`
// Minimum execution time: 35_083_000 picoseconds.
Weight::from_parts(35_580_000, 0)
.saturating_add(Weight::from_parts(0, 19112))
// Estimated: `3791`
// Minimum execution time: 35_678_000 picoseconds.
Weight::from_parts(36_056_000, 0)
.saturating_add(Weight::from_parts(0, 3791))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: XcmPallet XcmExecutionSuspended (r:0 w:1)
/// Proof Skipped: XcmPallet XcmExecutionSuspended (max_values: Some(1), max_size: None, mode: Measured)
fn force_suspension() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_271_000 picoseconds.
Weight::from_parts(3_404_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: XcmPallet SupportedVersion (r:4 w:2)
/// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
fn migrate_supported_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `229`
// Estimated: `11119`
// Minimum execution time: 16_113_000 picoseconds.
Weight::from_parts(16_592_000, 0)
// Minimum execution time: 16_601_000 picoseconds.
Weight::from_parts(16_888_000, 0)
.saturating_add(Weight::from_parts(0, 11119))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
@@ -181,8 +195,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `233`
// Estimated: `11123`
// Minimum execution time: 18_071_000 picoseconds.
Weight::from_parts(18_527_000, 0)
// Minimum execution time: 16_714_000 picoseconds.
Weight::from_parts(17_048_000, 0)
.saturating_add(Weight::from_parts(0, 11123))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
@@ -193,8 +207,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `243`
// Estimated: `13608`
// Minimum execution time: 18_498_000 picoseconds.
Weight::from_parts(19_091_000, 0)
// Minimum execution time: 17_552_000 picoseconds.
Weight::from_parts(17_860_000, 0)
.saturating_add(Weight::from_parts(0, 13608))
.saturating_add(T::DbWeight::get().reads(5))
}
@@ -213,10 +227,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn notify_current_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `239`
// Estimated: `20739`
// Minimum execution time: 31_568_000 picoseconds.
Weight::from_parts(32_163_000, 0)
.saturating_add(Weight::from_parts(0, 20739))
// Estimated: `6179`
// Minimum execution time: 31_655_000 picoseconds.
Weight::from_parts(32_201_000, 0)
.saturating_add(Weight::from_parts(0, 6179))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -226,8 +240,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `272`
// Estimated: `8687`
// Minimum execution time: 9_139_000 picoseconds.
Weight::from_parts(9_619_000, 0)
// Minimum execution time: 8_969_000 picoseconds.
Weight::from_parts(9_314_000, 0)
.saturating_add(Weight::from_parts(0, 8687))
.saturating_add(T::DbWeight::get().reads(3))
}
@@ -237,8 +251,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `240`
// Estimated: `11130`
// Minimum execution time: 16_944_000 picoseconds.
Weight::from_parts(17_505_000, 0)
// Minimum execution time: 17_142_000 picoseconds.
Weight::from_parts(17_694_000, 0)
.saturating_add(Weight::from_parts(0, 11130))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
@@ -258,10 +272,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn migrate_and_notify_old_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `243`
// Estimated: `25713`
// Minimum execution time: 38_715_000 picoseconds.
Weight::from_parts(39_473_000, 0)
.saturating_add(Weight::from_parts(0, 25713))
// Estimated: `11133`
// Minimum execution time: 38_257_000 picoseconds.
Weight::from_parts(39_042_000, 0)
.saturating_add(Weight::from_parts(0, 11133))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5))
}