diff --git a/Cargo.lock b/Cargo.lock index 28a0184a0b..741edf1d74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1926,6 +1926,7 @@ version = "0.1.0" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", "log", diff --git a/pallets/xcmp-queue/Cargo.toml b/pallets/xcmp-queue/Cargo.toml index 92e49b1914..c5d911bc41 100644 --- a/pallets/xcmp-queue/Cargo.toml +++ b/pallets/xcmp-queue/Cargo.toml @@ -23,6 +23,9 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot", default-feature # Cumulus cumulus-primitives-core = { path = "../../primitives/core", default-features = false } +# Optional import for benchmarking +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "master" } + [dev-dependencies] # Substrate @@ -50,3 +53,9 @@ std = [ "xcm-executor/std", "xcm/std", ] + +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", +] diff --git a/pallets/xcmp-queue/src/benchmarking.rs b/pallets/xcmp-queue/src/benchmarking.rs new file mode 100644 index 0000000000..29245870a3 --- /dev/null +++ b/pallets/xcmp-queue/src/benchmarking.rs @@ -0,0 +1,28 @@ +// Copyright (C) 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. + +//! Benchmarking setup for cumulus-pallet-xcmp-queue + +use crate::*; + +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_system::RawOrigin; + +benchmarks! { + set_config_with_u32 {}: update_resume_threshold(RawOrigin::Root, 100) + set_config_with_weight {}: update_weight_restrict_decay(RawOrigin::Root, 3_000_000 as Weight) +} + +impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index c5b399950d..947439ba8b 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -33,6 +33,11 @@ mod mock; #[cfg(test)] mod tests; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +pub mod weights; +pub use weights::WeightInfo; + use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_core::{ relay_chain::BlockNumber as RelayBlockNumber, ChannelStatus, GetChannelInfo, MessageSendError, @@ -93,6 +98,9 @@ pub mod pallet { /// The conversion function used to attempt to convert an XCM `MultiLocation` origin to a /// superuser origin. type ControllerOriginConverter: ConvertOrigin; + + /// The weight information of this pallet. + type WeightInfo: WeightInfo; } #[pallet::hooks] @@ -122,7 +130,7 @@ pub mod pallet { /// /// Events: /// - `OverweightServiced`: On success. - #[pallet::weight(weight_limit.saturating_add(1_000_000))] + #[pallet::weight((weight_limit.saturating_add(1_000_000), DispatchClass::Operational,))] pub fn service_overweight( origin: OriginFor, index: OverweightIndex, @@ -147,7 +155,7 @@ pub mod pallet { /// Suspends all XCM executions for the XCMP queue, regardless of the sender's origin. /// /// - `origin`: Must pass `ControllerOrigin`. - #[pallet::weight(T::DbWeight::get().writes(1))] + #[pallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))] pub fn suspend_xcm_execution(origin: OriginFor) -> DispatchResult { T::ControllerOrigin::ensure_origin(origin)?; @@ -161,7 +169,7 @@ pub mod pallet { /// Note that this function doesn't change the status of the in/out bound channels. /// /// - `origin`: Must pass `ControllerOrigin`. - #[pallet::weight(T::DbWeight::get().writes(1))] + #[pallet::weight((T::DbWeight::get().writes(1), DispatchClass::Operational,))] pub fn resume_xcm_execution(origin: OriginFor) -> DispatchResult { T::ControllerOrigin::ensure_origin(origin)?; @@ -175,7 +183,7 @@ pub mod pallet { /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.suspend_value` - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + #[pallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))] pub fn update_suspend_threshold(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; QueueConfig::::mutate(|data| data.suspend_threshold = new); @@ -188,7 +196,7 @@ pub mod pallet { /// /// - `origin`: Must pass `Root`. /// - `new`: Desired value for `QueueConfigData.drop_threshold` - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + #[pallet::weight((T::WeightInfo::set_config_with_u32(),DispatchClass::Operational,))] pub fn update_drop_threshold(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; QueueConfig::::mutate(|data| data.drop_threshold = new); @@ -200,8 +208,8 @@ pub mod pallet { /// message sending may recommence after it has been suspended. /// /// - `origin`: Must pass `Root`. - /// - `new`: Desired value for `QueueConfigData.resume_threshold` - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + /// - `new`: Desired value for `QueueConfigData.resume_threshold` + #[pallet::weight((T::WeightInfo::set_config_with_u32(), DispatchClass::Operational,))] pub fn update_resume_threshold(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; QueueConfig::::mutate(|data| data.resume_threshold = new); @@ -212,8 +220,8 @@ pub mod pallet { /// Overwrites the amount of remaining weight under which we stop processing messages. /// /// - `origin`: Must pass `Root`. - /// - `new`: Desired value for `QueueConfigData.threshold_weight` - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + /// - `new`: Desired value for `QueueConfigData.threshold_weight` + #[pallet::weight((T::WeightInfo::set_config_with_weight(), DispatchClass::Operational,))] pub fn update_threshold_weight(origin: OriginFor, new: Weight) -> DispatchResult { ensure_root(origin)?; QueueConfig::::mutate(|data| data.threshold_weight = new); @@ -225,8 +233,8 @@ pub mod pallet { /// A lower number results in a faster progression. A value of 1 makes the entire weight available initially. /// /// - `origin`: Must pass `Root`. - /// - `new`: Desired value for `QueueConfigData.weight_restrict_decay`. - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + /// - `new`: Desired value for `QueueConfigData.weight_restrict_decay`. + #[pallet::weight((T::WeightInfo::set_config_with_weight(), DispatchClass::Operational,))] pub fn update_weight_restrict_decay(origin: OriginFor, new: Weight) -> DispatchResult { ensure_root(origin)?; QueueConfig::::mutate(|data| data.weight_restrict_decay = new); @@ -238,8 +246,8 @@ pub mod pallet { /// Messages above this weight go into the overweight queue and may only be serviced explicitly. /// /// - `origin`: Must pass `Root`. - /// - `new`: Desired value for `QueueConfigData.xcmp_max_individual_weight`. - #[pallet::weight(10_000_000 as Weight + T::DbWeight::get().reads_writes(1, 1))] + /// - `new`: Desired value for `QueueConfigData.xcmp_max_individual_weight`. + #[pallet::weight((T::WeightInfo::set_config_with_weight(), DispatchClass::Operational,))] pub fn update_xcmp_max_individual_weight( origin: OriginFor, new: Weight, diff --git a/pallets/xcmp-queue/src/mock.rs b/pallets/xcmp-queue/src/mock.rs index b783ddf11f..1a3b5616db 100644 --- a/pallets/xcmp-queue/src/mock.rs +++ b/pallets/xcmp-queue/src/mock.rs @@ -188,6 +188,7 @@ impl Config for Test { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = SystemParachainAsSuperuser; + type WeightInfo = (); } pub fn new_test_ext() -> sp_io::TestExternalities { diff --git a/pallets/xcmp-queue/src/weights.rs b/pallets/xcmp-queue/src/weights.rs new file mode 100644 index 0000000000..559ff644e8 --- /dev/null +++ b/pallets/xcmp-queue/src/weights.rs @@ -0,0 +1,48 @@ +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_std::marker::PhantomData; + +// Implemented by autogenerated benchmarking code. +pub trait WeightInfo { + fn set_config_with_u32() -> Weight; + fn set_config_with_weight() -> Weight; +} + +pub struct SubstrateWeight(PhantomData); + +impl WeightInfo for SubstrateWeight { + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_u32() -> Weight { + (2_717_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + (2_717_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +impl WeightInfo for () { + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_u32() -> Weight { + (2_717_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + (2_717_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/parachain-template/runtime/Cargo.toml b/parachain-template/runtime/Cargo.toml index e39944c2b5..0f7d2947b5 100644 --- a/parachain-template/runtime/Cargo.toml +++ b/parachain-template/runtime/Cargo.toml @@ -141,6 +141,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", ] try-runtime = [ diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index ca506338f2..11eb36d303 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -386,6 +386,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -502,6 +503,7 @@ mod benches { [pallet_session, SessionBench::] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] ); } diff --git a/polkadot-parachains/canvas-kusama/src/xcm_config.rs b/polkadot-parachains/canvas-kusama/src/xcm_config.rs index 9288bd5073..c838f0154a 100644 --- a/polkadot-parachains/canvas-kusama/src/xcm_config.rs +++ b/polkadot-parachains/canvas-kusama/src/xcm_config.rs @@ -195,6 +195,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { EnsureXcm>, >; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; } impl cumulus_pallet_dmp_queue::Config for Runtime { diff --git a/polkadot-parachains/rococo-parachain/src/lib.rs b/polkadot-parachains/rococo-parachain/src/lib.rs index 03005decf0..ca4ecc2838 100644 --- a/polkadot-parachains/rococo-parachain/src/lib.rs +++ b/polkadot-parachains/rococo-parachain/src/lib.rs @@ -454,6 +454,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; } impl cumulus_pallet_dmp_queue::Config for Runtime { diff --git a/polkadot-parachains/statemine/Cargo.toml b/polkadot-parachains/statemine/Cargo.toml index d35cb4f88f..f7452a39f5 100644 --- a/polkadot-parachains/statemine/Cargo.toml +++ b/polkadot-parachains/statemine/Cargo.toml @@ -100,6 +100,7 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", ] try-runtime = [ "frame-executive/try-runtime", diff --git a/polkadot-parachains/statemine/src/lib.rs b/polkadot-parachains/statemine/src/lib.rs index 315d1858e6..2d2a0f24a9 100644 --- a/polkadot-parachains/statemine/src/lib.rs +++ b/polkadot-parachains/statemine/src/lib.rs @@ -429,6 +429,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureOneOf, EnsureXcm>>; type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin; + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -625,6 +626,7 @@ mod benches { [pallet_utility, Utility] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] ); } diff --git a/polkadot-parachains/statemine/src/weights/cumulus_pallet_xcmp_queue.rs b/polkadot-parachains/statemine/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 0000000000..0f9f87a846 --- /dev/null +++ b/polkadot-parachains/statemine/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,59 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-03-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot-collator +// benchmark +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./polkadot-parachains/statemine/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_xcmp_queue`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_u32() -> Weight { + (2_609_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + (2_602_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} diff --git a/polkadot-parachains/statemine/src/weights/mod.rs b/polkadot-parachains/statemine/src/weights/mod.rs index 487bd01819..847c230145 100644 --- a/polkadot-parachains/statemine/src/weights/mod.rs +++ b/polkadot-parachains/statemine/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod cumulus_pallet_xcmp_queue; pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; diff --git a/polkadot-parachains/statemint/Cargo.toml b/polkadot-parachains/statemint/Cargo.toml index 8dfb7035d2..4fb5746f98 100644 --- a/polkadot-parachains/statemint/Cargo.toml +++ b/polkadot-parachains/statemint/Cargo.toml @@ -99,6 +99,7 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", ] try-runtime = [ "frame-executive/try-runtime", diff --git a/polkadot-parachains/statemint/src/lib.rs b/polkadot-parachains/statemint/src/lib.rs index 261f545961..d901012dfa 100644 --- a/polkadot-parachains/statemint/src/lib.rs +++ b/polkadot-parachains/statemint/src/lib.rs @@ -442,6 +442,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureOneOf, EnsureXcm>>; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -637,6 +638,7 @@ mod benches { [pallet_utility, Utility] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] ); } diff --git a/polkadot-parachains/statemint/src/weights/cumulus_pallet_xcmp_queue.rs b/polkadot-parachains/statemint/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 0000000000..1be5a92cb8 --- /dev/null +++ b/polkadot-parachains/statemint/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,59 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-03-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot-collator +// benchmark +// --chain=statemint-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./polkadot-parachains/statemint/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_xcmp_queue`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_u32() -> Weight { + (2_587_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + (2_540_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} diff --git a/polkadot-parachains/statemint/src/weights/mod.rs b/polkadot-parachains/statemint/src/weights/mod.rs index 487bd01819..847c230145 100644 --- a/polkadot-parachains/statemint/src/weights/mod.rs +++ b/polkadot-parachains/statemint/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod cumulus_pallet_xcmp_queue; pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; diff --git a/polkadot-parachains/westmint/Cargo.toml b/polkadot-parachains/westmint/Cargo.toml index 99c062e910..873725cf53 100644 --- a/polkadot-parachains/westmint/Cargo.toml +++ b/polkadot-parachains/westmint/Cargo.toml @@ -98,6 +98,7 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", ] try-runtime = [ "frame-executive/try-runtime", diff --git a/polkadot-parachains/westmint/src/lib.rs b/polkadot-parachains/westmint/src/lib.rs index d4d29a19d8..b04d6e91ed 100644 --- a/polkadot-parachains/westmint/src/lib.rs +++ b/polkadot-parachains/westmint/src/lib.rs @@ -423,6 +423,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -617,6 +618,7 @@ mod benches { [pallet_utility, Utility] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] ); } diff --git a/polkadot-parachains/westmint/src/weights/cumulus_pallet_xcmp_queue.rs b/polkadot-parachains/westmint/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 0000000000..78f4a2c7b7 --- /dev/null +++ b/polkadot-parachains/westmint/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,59 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-03-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot-collator +// benchmark +// --chain=westmint-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./polkadot-parachains/westmint/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_xcmp_queue`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_u32() -> Weight { + (2_617_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + (2_505_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} diff --git a/polkadot-parachains/westmint/src/weights/mod.rs b/polkadot-parachains/westmint/src/weights/mod.rs index 487bd01819..847c230145 100644 --- a/polkadot-parachains/westmint/src/weights/mod.rs +++ b/polkadot-parachains/westmint/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod cumulus_pallet_xcmp_queue; pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index d9e8a21913..5ca8d4d460 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -20,8 +20,9 @@ pallets=( pallet_session pallet_timestamp pallet_utility - pallet_uniques - frame_system + pallet_uniques + cumulus_pallet_xcmp_queue + frame_system ) for p in ${pallets[@]}