Skip to content

Commit

Permalink
XCM: Implement a blocking barrier (paritytech#7098)
Browse files Browse the repository at this point in the history
* 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 <>
  • Loading branch information
KiChjang authored and librelois committed May 11, 2023
1 parent a5f731a commit 9210c42
Show file tree
Hide file tree
Showing 18 changed files with 644 additions and 444 deletions.
106 changes: 60 additions & 46 deletions runtime/kusama/src/weights/pallet_xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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-16, 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: `bm5`, 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("kusama-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// target/production/polkadot
// benchmark
// pallet
// --chain=kusama-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=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/

Expand All @@ -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>);
Expand All @@ -58,35 +61,35 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn send() -> Weight {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `14420`
// Minimum execution time: 32_211_000 picoseconds.
Weight::from_parts(32_864_000, 0)
.saturating_add(Weight::from_parts(0, 14420))
// Estimated: `3676`
// Minimum execution time: 32_058_000 picoseconds.
Weight::from_parts(32_630_000, 0)
.saturating_add(Weight::from_parts(0, 3676))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
}
fn teleport_assets() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 21_186_000 picoseconds.
Weight::from_parts(21_501_000, 0)
// Minimum execution time: 21_569_000 picoseconds.
Weight::from_parts(21_969_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_009_000 picoseconds.
Weight::from_parts(20_431_000, 0)
// Minimum execution time: 20_667_000 picoseconds.
Weight::from_parts(21_006_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn execute() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 10_031_000 picoseconds.
Weight::from_parts(10_350_000, 0)
// Minimum execution time: 9_993_000 picoseconds.
Weight::from_parts(10_278_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: XcmPallet SupportedVersion (r:0 w:1)
Expand All @@ -95,8 +98,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 10_202_000 picoseconds.
Weight::from_parts(10_401_000, 0)
// Minimum execution time: 10_234_000 picoseconds.
Weight::from_parts(10_498_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -106,8 +109,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_042_000 picoseconds.
Weight::from_parts(3_161_000, 0)
// Minimum execution time: 3_272_000 picoseconds.
Weight::from_parts(3_469_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -130,10 +133,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn force_subscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `211`
// Estimated: `20003`
// Minimum execution time: 37_152_000 picoseconds.
Weight::from_parts(37_637_000, 0)
.saturating_add(Weight::from_parts(0, 20003))
// Estimated: `3676`
// Minimum execution time: 36_157_000 picoseconds.
Weight::from_parts(36_777_000, 0)
.saturating_add(Weight::from_parts(0, 3676))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
Expand All @@ -154,21 +157,32 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn force_unsubscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `483`
// Estimated: `20211`
// Minimum execution time: 40_068_000 picoseconds.
Weight::from_parts(40_408_000, 0)
.saturating_add(Weight::from_parts(0, 20211))
// Estimated: `3948`
// Minimum execution time: 39_613_000 picoseconds.
Weight::from_parts(39_905_000, 0)
.saturating_add(Weight::from_parts(0, 3948))
.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_296_000 picoseconds.
Weight::from_parts(3_485_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_679_000 picoseconds.
Weight::from_parts(17_372_000, 0)
// Minimum execution time: 16_201_000 picoseconds.
Weight::from_parts(16_681_000, 0)
.saturating_add(Weight::from_parts(0, 11119))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -179,8 +193,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `233`
// Estimated: `11123`
// Minimum execution time: 17_113_000 picoseconds.
Weight::from_parts(17_539_000, 0)
// Minimum execution time: 16_157_000 picoseconds.
Weight::from_parts(16_674_000, 0)
.saturating_add(Weight::from_parts(0, 11123))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -191,8 +205,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `243`
// Estimated: `13608`
// Minimum execution time: 17_831_000 picoseconds.
Weight::from_parts(18_222_000, 0)
// Minimum execution time: 17_502_000 picoseconds.
Weight::from_parts(18_000_000, 0)
.saturating_add(Weight::from_parts(0, 13608))
.saturating_add(T::DbWeight::get().reads(5))
}
Expand All @@ -211,10 +225,10 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
fn notify_current_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `281`
// Estimated: `20991`
// Minimum execution time: 34_239_000 picoseconds.
Weight::from_parts(34_714_000, 0)
.saturating_add(Weight::from_parts(0, 20991))
// Estimated: `6221`
// Minimum execution time: 33_198_000 picoseconds.
Weight::from_parts(33_742_000, 0)
.saturating_add(Weight::from_parts(0, 6221))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
}
Expand All @@ -224,8 +238,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_813_000 picoseconds.
Weight::from_parts(10_050_000, 0)
// Minimum execution time: 8_989_000 picoseconds.
Weight::from_parts(9_241_000, 0)
.saturating_add(Weight::from_parts(0, 8687))
.saturating_add(T::DbWeight::get().reads(3))
}
Expand All @@ -235,8 +249,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `240`
// Estimated: `11130`
// Minimum execution time: 17_449_000 picoseconds.
Weight::from_parts(17_898_000, 0)
// Minimum execution time: 16_709_000 picoseconds.
Weight::from_parts(17_237_000, 0)
.saturating_add(Weight::from_parts(0, 11130))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -256,10 +270,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: `285`
// Estimated: `25965`
// Minimum execution time: 41_651_000 picoseconds.
Weight::from_parts(42_184_000, 0)
.saturating_add(Weight::from_parts(0, 25965))
// Estimated: `11175`
// Minimum execution time: 40_749_000 picoseconds.
Weight::from_parts(41_154_000, 0)
.saturating_add(Weight::from_parts(0, 11175))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5))
}
Expand Down
Loading

0 comments on commit 9210c42

Please sign in to comment.