From 6eab30433af0f345b5a0e4fa1290dc94dbaa784d Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Wed, 15 Sep 2021 20:30:13 -0700 Subject: [PATCH 01/15] Add benchmarking for parachain runtime configuration pallet --- runtime/kusama/src/lib.rs | 2 + runtime/parachains/Cargo.toml | 4 +- runtime/parachains/src/configuration.rs | 5 +- .../src/configuration/benchmarking.rs | 102 ++++++++++++++++++ runtime/parachains/src/lib.rs | 1 + runtime/westend/src/lib.rs | 2 + 6 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 runtime/parachains/src/configuration/benchmarking.rs diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index d45f4e148c52..cc038943e7bb 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -1943,6 +1943,7 @@ sp_api::impl_runtime_apis! { list_benchmark!(list, extra, runtime_common::claims, Claims); list_benchmark!(list, extra, runtime_common::slots, Slots); list_benchmark!(list, extra, runtime_common::paras_registrar, Registrar); + list_benchmark!(list, extra, runtime_parachains::configuration, Configuration); // Substrate list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_bounties, Bounties); @@ -2016,6 +2017,7 @@ sp_api::impl_runtime_apis! { add_benchmark!(params, batches, runtime_common::claims, Claims); add_benchmark!(params, batches, runtime_common::slots, Slots); add_benchmark!(params, batches, runtime_common::paras_registrar, Registrar); + add_benchmark!(params, batches, runtime_parachains::configuration, Configuration); // Substrate add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_bounties, Bounties); diff --git a/runtime/parachains/Cargo.toml b/runtime/parachains/Cargo.toml index 71c6874428cf..0576d63c0272 100644 --- a/runtime/parachains/Cargo.toml +++ b/runtime/parachains/Cargo.toml @@ -27,12 +27,12 @@ pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking = { 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-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } +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 } xcm = { package = "xcm", path = "../../xcm", default-features = false } xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index a6cadd158fc7..cabb143c0db1 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -26,6 +26,9 @@ use primitives::v1::{Balance, SessionIndex, MAX_CODE_SIZE, MAX_POV_SIZE}; use sp_runtime::traits::Zero; use sp_std::prelude::*; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + pub use pallet::*; /// All configuration of the runtime with respect to parachains and parathreads. @@ -306,7 +309,7 @@ pub mod pallet { #[pallet::call] impl Pallet { /// Set the validation upgrade frequency. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_validation_upgrade_frequency())] pub fn set_validation_upgrade_frequency( origin: OriginFor, new: T::BlockNumber, diff --git a/runtime/parachains/src/configuration/benchmarking.rs b/runtime/parachains/src/configuration/benchmarking.rs new file mode 100644 index 000000000000..6b598a4036c9 --- /dev/null +++ b/runtime/parachains/src/configuration/benchmarking.rs @@ -0,0 +1,102 @@ +// Copyright 2020 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::configuration::*; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_system::RawOrigin; +use sp_runtime::traits::One; + +benchmarks! { + set_validation_upgrade_frequency {}: _(RawOrigin::Root, One::one()) + + set_validation_upgrade_delay {}: _(RawOrigin::Root, One::one()) + + set_code_retention_period {}: _(RawOrigin::Root, One::one()) + + set_max_code_size {}: _(RawOrigin::Root, 1024) + + set_max_pov_size {}: _(RawOrigin::Root, 1024) + + set_max_head_data_size {}: _(RawOrigin::Root, 1024) + + set_parathread_cores {}: _(RawOrigin::Root, 5) + + set_parathread_retries {}: _(RawOrigin::Root, 10) + + set_group_rotation_frequency {}: _(RawOrigin::Root, One::one()) + + set_chain_availability_period {}: _(RawOrigin::Root, One::one()) + + set_thread_availability_period {}: _(RawOrigin::Root, One::one()) + + set_scheduling_lookahead {}: _(RawOrigin::Root, 10) + + set_max_validators_per_core {}: _(RawOrigin::Root, Some(10)) + + set_max_validators {}: _(RawOrigin::Root, Some(300)) + + set_dispute_period {}: _(RawOrigin::Root, 10) + + set_dispute_post_conclusion_acceptance_period {}: _(RawOrigin::Root, One::one()) + + set_dispute_max_spam_slots {}: _(RawOrigin::Root, 50) + + set_dispute_conclusion_by_time_out_period {}: _(RawOrigin::Root, One::one()) + + set_no_show_slots {}: _(RawOrigin::Root, 10) + + set_n_delay_tranches {}: _(RawOrigin::Root, 10) + + set_zeroth_delay_tranche_width {}: _(RawOrigin::Root, 10) + + set_needed_approvals {}: _(RawOrigin::Root, 5) + + set_relay_vrf_modulo_samples {}: _(RawOrigin::Root, 10) + + set_max_upward_queue_count {}: _(RawOrigin::Root, 3) + + set_max_upward_queue_size {}: _(RawOrigin::Root, 10) + + set_max_downward_message_size {}: _(RawOrigin::Root, 1024) + + set_ump_service_total_weight {}: _(RawOrigin::Root, 3_000_000) + + set_max_upward_message_size {}: _(RawOrigin::Root, 1024) + + set_max_upward_message_num_per_candidate {}: _(RawOrigin::Root, 10) + + set_hrmp_sender_deposit {}: _(RawOrigin::Root, 100) + + set_hrmp_recipient_deposit {}: _(RawOrigin::Root, 100) + + set_hrmp_channel_max_capacity {}: _(RawOrigin::Root, 10) + + set_hrmp_channel_max_total_size {}: _(RawOrigin::Root, 100) + + set_hrmp_max_parachain_inbound_channels {}: _(RawOrigin::Root, 10) + + set_hrmp_max_parathread_inbound_channels {}: _(RawOrigin::Root, 10) + + set_hrmp_channel_max_message_size {}: _(RawOrigin::Root, 1024) + + set_hrmp_max_parachain_outbound_channels {}: _(RawOrigin::Root, 10) + + set_hrmp_max_parathread_outbound_channels {}: _(RawOrigin::Root, 10) + + set_hrmp_max_message_num_per_candidate {}: _(RawOrigin::Root, 10) +} + +impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(Default::default()), crate::mock::Test); diff --git a/runtime/parachains/src/lib.rs b/runtime/parachains/src/lib.rs index 1ea90bb84e63..4a3dafa78459 100644 --- a/runtime/parachains/src/lib.rs +++ b/runtime/parachains/src/lib.rs @@ -20,6 +20,7 @@ //! particular the `Initializer` module, as it is responsible for initializing the state //! of the other modules. +#![cfg_attr(feature = "runtime-benchmarks", recursion_limit="256")] #![cfg_attr(not(feature = "std"), no_std)] pub mod configuration; diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 24e522ef409c..7db4811f981a 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1405,6 +1405,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); + list_benchmark!(list, extra, runtime_parachains::configuration, Configuration); // Substrate list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); @@ -1469,6 +1470,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); + add_benchmark!(params, batches, runtime_parachains::configuration, Configuration); // Substrate add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); From deaa075c25d1f6103b5670de6da1de5d40242d14 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Wed, 15 Sep 2021 20:37:43 -0700 Subject: [PATCH 02/15] cargo fmt --- runtime/parachains/src/configuration/benchmarking.rs | 6 +++++- runtime/parachains/src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/parachains/src/configuration/benchmarking.rs b/runtime/parachains/src/configuration/benchmarking.rs index 6b598a4036c9..3de303e55fec 100644 --- a/runtime/parachains/src/configuration/benchmarking.rs +++ b/runtime/parachains/src/configuration/benchmarking.rs @@ -99,4 +99,8 @@ benchmarks! { set_hrmp_max_message_num_per_candidate {}: _(RawOrigin::Root, 10) } -impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(Default::default()), crate::mock::Test); +impl_benchmark_test_suite!( + Pallet, + crate::mock::new_test_ext(Default::default()), + crate::mock::Test +); diff --git a/runtime/parachains/src/lib.rs b/runtime/parachains/src/lib.rs index 4a3dafa78459..ab48d693d601 100644 --- a/runtime/parachains/src/lib.rs +++ b/runtime/parachains/src/lib.rs @@ -20,7 +20,7 @@ //! particular the `Initializer` module, as it is responsible for initializing the state //! of the other modules. -#![cfg_attr(feature = "runtime-benchmarks", recursion_limit="256")] +#![cfg_attr(feature = "runtime-benchmarks", recursion_limit = "256")] #![cfg_attr(not(feature = "std"), no_std)] pub mod configuration; From 4f7c89dad9581d213f2513c97ac9bc3ae983bbc4 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Wed, 15 Sep 2021 23:04:50 -0700 Subject: [PATCH 03/15] Add WeightInfo trait --- runtime/common/src/paras_registrar.rs | 10 +- runtime/kusama/src/lib.rs | 4 +- runtime/parachains/src/configuration.rs | 127 +++++-- .../src/configuration/benchmarking.rs | 8 +- .../parachains/src/configuration/weights.rs | 351 ++++++++++++++++++ runtime/rococo/src/lib.rs | 4 +- runtime/test-runtime/src/lib.rs | 4 +- runtime/westend/src/lib.rs | 4 +- 8 files changed, 462 insertions(+), 50 deletions(-) create mode 100644 runtime/parachains/src/configuration/weights.rs diff --git a/runtime/common/src/paras_registrar.rs b/runtime/common/src/paras_registrar.rs index 3c9e80993205..be5ae28e4941 100644 --- a/runtime/common/src/paras_registrar.rs +++ b/runtime/common/src/paras_registrar.rs @@ -213,7 +213,7 @@ pub mod pallet { /// /// ## Events /// The `Registered` event is emitted in case of success. - #[pallet::weight(T::WeightInfo::register())] + #[pallet::weight(::WeightInfo::register())] pub fn register( origin: OriginFor, id: ParaId, @@ -231,7 +231,7 @@ pub mod pallet { /// /// The deposit taken can be specified for this registration. Any `ParaId` /// can be registered, including sub-1000 IDs which are System Parachains. - #[pallet::weight(T::WeightInfo::force_register())] + #[pallet::weight(::WeightInfo::force_register())] pub fn force_register( origin: OriginFor, who: T::AccountId, @@ -247,7 +247,7 @@ pub mod pallet { /// Deregister a Para Id, freeing all data and returning any deposit. /// /// The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread. - #[pallet::weight(T::WeightInfo::deregister())] + #[pallet::weight(::WeightInfo::deregister())] pub fn deregister(origin: OriginFor, id: ParaId) -> DispatchResult { Self::ensure_root_para_or_owner(origin, id)?; Self::do_deregister(id) @@ -264,7 +264,7 @@ pub mod pallet { /// `ParaId` to be a long-term identifier of a notional "parachain". However, their /// scheduling info (i.e. whether they're a parathread or parachain), auction information /// and the auction deposit are switched. - #[pallet::weight(T::WeightInfo::swap())] + #[pallet::weight(::WeightInfo::swap())] pub fn swap(origin: OriginFor, id: ParaId, other: ParaId) -> DispatchResult { Self::ensure_root_para_or_owner(origin, id)?; @@ -325,7 +325,7 @@ pub mod pallet { /// /// ## Events /// The `Reserved` event is emitted in case of success, which provides the ID reserved for use. - #[pallet::weight(T::WeightInfo::reserve())] + #[pallet::weight(::WeightInfo::reserve())] pub fn reserve(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; let id = NextFreeParaId::::get().max(LOWEST_PUBLIC_ID); diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index cc038943e7bb..4b3b917ca23b 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -1093,7 +1093,9 @@ impl pallet_proxy::Config for Runtime { impl parachains_origin::Config for Runtime {} -impl parachains_configuration::Config for Runtime {} +impl parachains_configuration::Config for Runtime { + type WeightInfo = parachains_configuration::weights::WeightInfo; +} impl parachains_shared::Config for Runtime {} diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index cabb143c0db1..2a36d33d422d 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -28,6 +28,7 @@ use sp_std::prelude::*; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; +pub mod weights; pub use pallet::*; @@ -258,6 +259,49 @@ impl HostConfiguration { } } +pub trait WeightInfo { + fn set_validation_upgrade_frequency() -> Weight; + fn set_validation_upgrade_delay() -> Weight; + fn set_code_retention_period() -> Weight; + fn set_max_code_size() -> Weight; + fn set_max_pov_size() -> Weight; + fn set_max_head_data_size() -> Weight; + fn set_parathread_cores() -> Weight; + fn set_parathread_retries() -> Weight; + fn set_group_rotation_frequency() -> Weight; + fn set_chain_availability_period() -> Weight; + fn set_thread_availability_period() -> Weight; + fn set_scheduling_lookahead() -> Weight; + fn set_max_validators_per_core() -> Weight; + fn set_max_validators() -> Weight; + fn set_dispute_period() -> Weight; + fn set_dispute_post_conclusion_acceptance_period() -> Weight; + fn set_dispute_max_spam_slots() -> Weight; + fn set_dispute_conclusion_by_time_out_period() -> Weight; + fn set_no_show_slots() -> Weight; + fn set_n_delay_tranches() -> Weight; + fn set_zeroth_delay_tranche_width() -> Weight; + fn set_needed_approvals() -> Weight; + fn set_relay_vrf_modulo_samples() -> Weight; + fn set_max_upward_queue_count() -> Weight; + fn set_max_upward_queue_size() -> Weight; + fn set_max_downward_message_size() -> Weight; + fn set_ump_service_total_weight() -> Weight; + fn set_max_upward_message_size() -> Weight; + fn set_max_upward_message_num_per_candidate() -> Weight; + fn set_hrmp_open_request_ttl() -> Weight; + fn set_hrmp_sender_deposit() -> Weight; + fn set_hrmp_recipient_deposit() -> Weight; + fn set_hrmp_channel_max_capacity() -> Weight; + fn set_hrmp_channel_max_total_size() -> Weight; + fn set_hrmp_max_parachain_inbound_channels() -> Weight; + fn set_hrmp_max_parathread_inbound_channels() -> Weight; + fn set_hrmp_channel_max_message_size() -> Weight; + fn set_hrmp_max_parachain_outbound_channels() -> Weight; + fn set_hrmp_max_parathread_outbound_channels() -> Weight; + fn set_hrmp_max_message_num_per_candidate() -> Weight; +} + #[frame_support::pallet] pub mod pallet { use super::*; @@ -267,7 +311,10 @@ pub mod pallet { pub struct Pallet(_); #[pallet::config] - pub trait Config: frame_system::Config + shared::Config {} + pub trait Config: frame_system::Config + shared::Config { + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + } #[pallet::error] pub enum Error { @@ -322,7 +369,7 @@ pub mod pallet { } /// Set the validation upgrade delay. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_validation_upgrade_delay())] pub fn set_validation_upgrade_delay( origin: OriginFor, new: T::BlockNumber, @@ -335,7 +382,7 @@ pub mod pallet { } /// Set the acceptance period for an included candidate. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_code_retention_period())] pub fn set_code_retention_period( origin: OriginFor, new: T::BlockNumber, @@ -348,7 +395,7 @@ pub mod pallet { } /// Set the max validation code size for incoming upgrades. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_code_size())] pub fn set_max_code_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; ensure!(new <= MAX_CODE_SIZE, Error::::InvalidNewValue); @@ -359,7 +406,7 @@ pub mod pallet { } /// Set the max POV block size for incoming upgrades. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_pov_size())] pub fn set_max_pov_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; ensure!(new <= MAX_POV_SIZE, Error::::InvalidNewValue); @@ -370,7 +417,7 @@ pub mod pallet { } /// Set the max head data size for paras. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_head_data_size())] pub fn set_max_head_data_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -380,7 +427,7 @@ pub mod pallet { } /// Set the number of parathread execution cores. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_parathread_cores())] pub fn set_parathread_cores(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -390,7 +437,7 @@ pub mod pallet { } /// Set the number of retries for a particular parathread. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_parathread_retries())] pub fn set_parathread_retries(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -400,7 +447,7 @@ pub mod pallet { } /// Set the parachain validator-group rotation frequency - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_group_rotation_frequency())] pub fn set_group_rotation_frequency( origin: OriginFor, new: T::BlockNumber, @@ -416,7 +463,7 @@ pub mod pallet { } /// Set the availability period for parachains. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_chain_availability_period())] pub fn set_chain_availability_period( origin: OriginFor, new: T::BlockNumber, @@ -432,7 +479,7 @@ pub mod pallet { } /// Set the availability period for parathreads. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_thread_availability_period())] pub fn set_thread_availability_period( origin: OriginFor, new: T::BlockNumber, @@ -448,7 +495,7 @@ pub mod pallet { } /// Set the scheduling lookahead, in expected number of blocks at peak throughput. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_scheduling_lookahead())] pub fn set_scheduling_lookahead(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -458,7 +505,7 @@ pub mod pallet { } /// Set the maximum number of validators to assign to any core. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_validators_per_core())] pub fn set_max_validators_per_core( origin: OriginFor, new: Option, @@ -471,7 +518,7 @@ pub mod pallet { } /// Set the maximum number of validators to use in parachain consensus. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_validators())] pub fn set_max_validators(origin: OriginFor, new: Option) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -481,7 +528,7 @@ pub mod pallet { } /// Set the dispute period, in number of sessions to keep for disputes. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_dispute_period())] pub fn set_dispute_period(origin: OriginFor, new: SessionIndex) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -491,7 +538,7 @@ pub mod pallet { } /// Set the dispute post conclusion acceptance period. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_dispute_post_conclusion_acceptance_period())] pub fn set_dispute_post_conclusion_acceptance_period( origin: OriginFor, new: T::BlockNumber, @@ -505,7 +552,7 @@ pub mod pallet { } /// Set the maximum number of dispute spam slots. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_dispute_max_spam_slots())] pub fn set_dispute_max_spam_slots(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -515,7 +562,7 @@ pub mod pallet { } /// Set the dispute conclusion by time out period. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_dispute_conclusion_by_time_out_period())] pub fn set_dispute_conclusion_by_time_out_period( origin: OriginFor, new: T::BlockNumber, @@ -529,7 +576,7 @@ pub mod pallet { /// Set the no show slots, in number of number of consensus slots. /// Must be at least 1. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_no_show_slots())] pub fn set_no_show_slots(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; @@ -542,7 +589,7 @@ pub mod pallet { } /// Set the total number of delay tranches. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_n_delay_tranches())] pub fn set_n_delay_tranches(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -552,7 +599,7 @@ pub mod pallet { } /// Set the zeroth delay tranche width. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_zeroth_delay_tranche_width())] pub fn set_zeroth_delay_tranche_width(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -562,7 +609,7 @@ pub mod pallet { } /// Set the number of validators needed to approve a block. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_needed_approvals())] pub fn set_needed_approvals(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -572,7 +619,7 @@ pub mod pallet { } /// Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_relay_vrf_modulo_samples())] pub fn set_relay_vrf_modulo_samples(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -582,7 +629,7 @@ pub mod pallet { } /// Sets the maximum items that can present in a upward dispatch queue at once. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_upward_queue_count())] pub fn set_max_upward_queue_count(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -592,7 +639,7 @@ pub mod pallet { } /// Sets the maximum total size of items that can present in a upward dispatch queue at once. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_upward_queue_size())] pub fn set_max_upward_queue_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -602,7 +649,7 @@ pub mod pallet { } /// Set the critical downward message size. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_downward_message_size())] pub fn set_max_downward_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -612,7 +659,7 @@ pub mod pallet { } /// Sets the soft limit for the phase of dispatching dispatchable upward messages. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_ump_service_total_weight())] pub fn set_ump_service_total_weight(origin: OriginFor, new: Weight) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -622,7 +669,7 @@ pub mod pallet { } /// Sets the maximum size of an upward message that can be sent by a candidate. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_upward_message_size())] pub fn set_max_upward_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -632,7 +679,7 @@ pub mod pallet { } /// Sets the maximum number of messages that a candidate can contain. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_max_upward_message_num_per_candidate())] pub fn set_max_upward_message_num_per_candidate( origin: OriginFor, new: u32, @@ -645,7 +692,7 @@ pub mod pallet { } /// Sets the number of sessions after which an HRMP open channel request expires. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_open_request_ttl())] // Deprecated, but is not marked as such, because that would trigger warnings coming from // the macro. pub fn set_hrmp_open_request_ttl(_origin: OriginFor, _new: u32) -> DispatchResult { @@ -653,7 +700,7 @@ pub mod pallet { } /// Sets the amount of funds that the sender should provide for opening an HRMP channel. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_sender_deposit())] pub fn set_hrmp_sender_deposit(origin: OriginFor, new: Balance) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -664,7 +711,7 @@ pub mod pallet { /// Sets the amount of funds that the recipient should provide for accepting opening an HRMP /// channel. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_recipient_deposit())] pub fn set_hrmp_recipient_deposit(origin: OriginFor, new: Balance) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -674,7 +721,7 @@ pub mod pallet { } /// Sets the maximum number of messages allowed in an HRMP channel at once. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_capacity())] pub fn set_hrmp_channel_max_capacity(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -684,7 +731,7 @@ pub mod pallet { } /// Sets the maximum total size of messages in bytes allowed in an HRMP channel at once. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_total_size())] pub fn set_hrmp_channel_max_total_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -694,7 +741,7 @@ pub mod pallet { } /// Sets the maximum number of inbound HRMP channels a parachain is allowed to accept. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_max_parachain_inbound_channels())] pub fn set_hrmp_max_parachain_inbound_channels( origin: OriginFor, new: u32, @@ -707,7 +754,7 @@ pub mod pallet { } /// Sets the maximum number of inbound HRMP channels a parathread is allowed to accept. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_max_parathread_inbound_channels())] pub fn set_hrmp_max_parathread_inbound_channels( origin: OriginFor, new: u32, @@ -720,7 +767,7 @@ pub mod pallet { } /// Sets the maximum size of a message that could ever be put into an HRMP channel. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_message_size())] pub fn set_hrmp_channel_max_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -730,7 +777,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP channels a parachain is allowed to open. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_max_parachain_outbound_channels())] pub fn set_hrmp_max_parachain_outbound_channels( origin: OriginFor, new: u32, @@ -743,7 +790,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP channels a parathread is allowed to open. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_max_parathread_outbound_channels())] pub fn set_hrmp_max_parathread_outbound_channels( origin: OriginFor, new: u32, @@ -756,7 +803,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP messages can be sent by a candidate. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_hrmp_max_message_num_per_candidate())] pub fn set_hrmp_max_message_num_per_candidate( origin: OriginFor, new: u32, diff --git a/runtime/parachains/src/configuration/benchmarking.rs b/runtime/parachains/src/configuration/benchmarking.rs index 3de303e55fec..1a78164c43a0 100644 --- a/runtime/parachains/src/configuration/benchmarking.rs +++ b/runtime/parachains/src/configuration/benchmarking.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use crate::configuration::*; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, BenchmarkError, BenchmarkResult}; use frame_system::RawOrigin; use sp_runtime::traits::One; @@ -78,6 +78,12 @@ benchmarks! { set_max_upward_message_num_per_candidate {}: _(RawOrigin::Root, 10) + set_hrmp_open_request_ttl {}: { + Err(BenchmarkError::Override( + BenchmarkResult::from_weight(T::BlockWeights::get().max_block) + ))?; + } + set_hrmp_sender_deposit {}: _(RawOrigin::Root, 100) set_hrmp_recipient_deposit {}: _(RawOrigin::Root, 100) diff --git a/runtime/parachains/src/configuration/weights.rs b/runtime/parachains/src/configuration/weights.rs new file mode 100644 index 000000000000..6c2b2c29beff --- /dev/null +++ b/runtime/parachains/src/configuration/weights.rs @@ -0,0 +1,351 @@ + +//! Autogenerated weights for `runtime_parachains::configuration` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/polkadot +// benchmark +// --chain +// westend-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet +// runtime_parachains::configuration +// --steps +// 50 +// --repeat +// 20 +// --raw +// --extrinsic +// * +// --output +// runtime/parachains/src/configuration/weights.rs + + +#![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 runtime_parachains::configuration. +pub struct WeightInfo(PhantomData); +impl super::WeightInfo for WeightInfo { + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_validation_upgrade_frequency() -> Weight { + (11_878_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_validation_upgrade_delay() -> Weight { + (11_594_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_code_retention_period() -> Weight { + (15_986_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_code_size() -> Weight { + (15_996_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_pov_size() -> Weight { + (15_940_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_head_data_size() -> Weight { + (15_830_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_parathread_cores() -> Weight { + (15_996_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_parathread_retries() -> Weight { + (15_899_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_group_rotation_frequency() -> Weight { + (16_499_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_chain_availability_period() -> Weight { + (15_994_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_thread_availability_period() -> Weight { + (15_920_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_scheduling_lookahead() -> Weight { + (16_041_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_validators_per_core() -> Weight { + (15_971_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_validators() -> Weight { + (16_149_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_period() -> Weight { + (15_923_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_post_conclusion_acceptance_period() -> Weight { + (16_047_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_max_spam_slots() -> Weight { + (16_031_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_conclusion_by_time_out_period() -> Weight { + (16_084_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_no_show_slots() -> Weight { + (16_074_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_n_delay_tranches() -> Weight { + (16_141_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_zeroth_delay_tranche_width() -> Weight { + (16_024_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_needed_approvals() -> Weight { + (15_957_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_relay_vrf_modulo_samples() -> Weight { + (15_988_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_queue_count() -> Weight { + (15_879_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_queue_size() -> Weight { + (15_869_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_downward_message_size() -> Weight { + (11_492_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_ump_service_total_weight() -> Weight { + (15_896_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_message_size() -> Weight { + (15_916_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_message_num_per_candidate() -> Weight { + (15_892_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Benchmark Override (r:0 w:0) + fn set_hrmp_open_request_ttl() -> Weight { + (2_000_000_000_000 as Weight) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_sender_deposit() -> Weight { + (15_931_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_recipient_deposit() -> Weight { + (15_986_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_capacity() -> Weight { + (15_966_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_total_size() -> Weight { + (15_949_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parachain_inbound_channels() -> Weight { + (15_916_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parathread_inbound_channels() -> Weight { + (15_871_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_message_size() -> Weight { + (16_317_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parachain_outbound_channels() -> Weight { + (15_931_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parathread_outbound_channels() -> Weight { + (15_960_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_message_num_per_candidate() -> Weight { + (15_885_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 3da4fba66ec4..f2bf85526779 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -559,7 +559,9 @@ impl pallet_authorship::Config for Runtime { impl parachains_origin::Config for Runtime {} -impl parachains_configuration::Config for Runtime {} +impl parachains_configuration::Config for Runtime { + type WeightInfo = parachains_configuration::weights::WeightInfo; +} impl parachains_shared::Config for Runtime {} diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index 723ee4495846..8c0a4bb5a9f5 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -451,7 +451,9 @@ impl pallet_sudo::Config for Runtime { type Call = Call; } -impl parachains_configuration::Config for Runtime {} +impl parachains_configuration::Config for Runtime { + type WeightInfo = parachains_configuration::weights::WeightInfo; +} impl parachains_shared::Config for Runtime {} diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 7db4811f981a..b7dd7bfd6119 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -761,7 +761,9 @@ impl pallet_proxy::Config for Runtime { impl parachains_origin::Config for Runtime {} -impl parachains_configuration::Config for Runtime {} +impl parachains_configuration::Config for Runtime { + type WeightInfo = parachains_configuration::weights::WeightInfo; +} impl parachains_shared::Config for Runtime {} From 4a2c32e098c8e509e8ead35e178d7e50ef49ff82 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Wed, 15 Sep 2021 23:19:29 -0700 Subject: [PATCH 04/15] Specify missing WeightInfo associated type in mocks --- runtime/parachains/src/mock.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/parachains/src/mock.rs b/runtime/parachains/src/mock.rs index 88e241426d62..dbecc26a4dcd 100644 --- a/runtime/parachains/src/mock.rs +++ b/runtime/parachains/src/mock.rs @@ -114,7 +114,9 @@ impl crate::initializer::Config for Test { type ForceOrigin = frame_system::EnsureRoot; } -impl crate::configuration::Config for Test {} +impl crate::configuration::Config for Test { + type Weight = crate::configuration::weights::WeightInfo; +} impl crate::shared::Config for Test {} From cc8ebe884ce990ea1adeaa04b7073426a2910f6c Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Thu, 16 Sep 2021 00:21:08 -0700 Subject: [PATCH 05/15] Fix typo --- runtime/parachains/src/mock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/parachains/src/mock.rs b/runtime/parachains/src/mock.rs index dbecc26a4dcd..025c7f009c8f 100644 --- a/runtime/parachains/src/mock.rs +++ b/runtime/parachains/src/mock.rs @@ -115,7 +115,7 @@ impl crate::initializer::Config for Test { } impl crate::configuration::Config for Test { - type Weight = crate::configuration::weights::WeightInfo; + type WeightInfo = crate::configuration::weights::WeightInfo; } impl crate::shared::Config for Test {} From ff01b35591362f1ee61a359cc3a71eadb8f1e449 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Thu, 16 Sep 2021 09:35:20 +0000 Subject: [PATCH 06/15] cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs --- .../runtime_parachains_configuration.rs | 360 ++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 runtime/westend/src/weights/runtime_parachains_configuration.rs diff --git a/runtime/westend/src/weights/runtime_parachains_configuration.rs b/runtime/westend/src/weights/runtime_parachains_configuration.rs new file mode 100644 index 000000000000..df60d4a59d26 --- /dev/null +++ b/runtime/westend/src/weights/runtime_parachains_configuration.rs @@ -0,0 +1,360 @@ +// 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 `runtime_parachains::configuration` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 + +// Executed Command: +// target/release/polkadot +// benchmark +// --chain=westend-dev +// --steps=50 +// --repeat=20 +// --pallet=runtime_parachains::configuration +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./file_header.txt +// --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs + + +#![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 runtime_parachains::configuration. +pub struct WeightInfo(PhantomData); +impl runtime_parachains::configuration::WeightInfo for WeightInfo { + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_validation_upgrade_frequency() -> Weight { + (9_127_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_validation_upgrade_delay() -> Weight { + (9_294_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_code_retention_period() -> Weight { + (12_984_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_code_size() -> Weight { + (13_002_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_pov_size() -> Weight { + (12_987_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_head_data_size() -> Weight { + (12_934_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_parathread_cores() -> Weight { + (12_917_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_parathread_retries() -> Weight { + (12_933_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_group_rotation_frequency() -> Weight { + (12_925_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_chain_availability_period() -> Weight { + (12_855_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_thread_availability_period() -> Weight { + (13_047_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_scheduling_lookahead() -> Weight { + (12_943_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_validators_per_core() -> Weight { + (13_080_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_validators() -> Weight { + (13_083_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_period() -> Weight { + (12_889_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_post_conclusion_acceptance_period() -> Weight { + (12_883_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_max_spam_slots() -> Weight { + (12_946_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_dispute_conclusion_by_time_out_period() -> Weight { + (12_836_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_no_show_slots() -> Weight { + (12_923_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_n_delay_tranches() -> Weight { + (13_015_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_zeroth_delay_tranche_width() -> Weight { + (13_051_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_needed_approvals() -> Weight { + (12_932_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_relay_vrf_modulo_samples() -> Weight { + (13_026_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_queue_count() -> Weight { + (12_938_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_queue_size() -> Weight { + (12_915_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_downward_message_size() -> Weight { + (9_444_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_ump_service_total_weight() -> Weight { + (12_985_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_message_size() -> Weight { + (12_931_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_max_upward_message_num_per_candidate() -> Weight { + (13_088_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Benchmark Override (r:0 w:0) + fn set_hrmp_open_request_ttl() -> Weight { + (2_000_000_000_000 as Weight) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_sender_deposit() -> Weight { + (13_052_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_recipient_deposit() -> Weight { + (12_806_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_capacity() -> Weight { + (12_976_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_total_size() -> Weight { + (12_966_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parachain_inbound_channels() -> Weight { + (13_042_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parathread_inbound_channels() -> Weight { + (12_948_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_channel_max_message_size() -> Weight { + (12_915_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parachain_outbound_channels() -> Weight { + (12_911_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_parathread_outbound_channels() -> Weight { + (12_717_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_hrmp_max_message_num_per_candidate() -> Weight { + (12_776_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} From 2f16b46d983ea6fac79be10f27269281b62f6a82 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Thu, 16 Sep 2021 02:36:23 -0700 Subject: [PATCH 07/15] Fix compilation errors --- runtime/common/src/integration_tests.rs | 4 +++- runtime/common/src/paras_registrar.rs | 4 +++- xcm/xcm-builder/tests/mock/mod.rs | 4 +++- xcm/xcm-simulator/example/src/relay_chain.rs | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/runtime/common/src/integration_tests.rs b/runtime/common/src/integration_tests.rs index 50a1e9efaaac..c0e1615599e7 100644 --- a/runtime/common/src/integration_tests.rs +++ b/runtime/common/src/integration_tests.rs @@ -156,7 +156,9 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; } -impl configuration::Config for Test {} +impl configuration::Config for Test { + type WeightInfo = configuration::weights::WeightInfo; +} impl shared::Config for Test {} diff --git a/runtime/common/src/paras_registrar.rs b/runtime/common/src/paras_registrar.rs index 63795cf50a9d..ee595cd0df05 100644 --- a/runtime/common/src/paras_registrar.rs +++ b/runtime/common/src/paras_registrar.rs @@ -659,7 +659,9 @@ mod tests { type Event = Event; } - impl configuration::Config for Test {} + impl configuration::Config for Test { + type WeightInfo = configuration::weights::WeightInfo; + } parameter_types! { pub const ParaDeposit: Balance = 10; diff --git a/xcm/xcm-builder/tests/mock/mod.rs b/xcm/xcm-builder/tests/mock/mod.rs index ee5c77afe587..bcdac942a30a 100644 --- a/xcm/xcm-builder/tests/mock/mod.rs +++ b/xcm/xcm-builder/tests/mock/mod.rs @@ -107,7 +107,9 @@ impl pallet_balances::Config for Runtime { impl shared::Config for Runtime {} -impl configuration::Config for Runtime {} +impl configuration::Config for Runtime { + type WeightInfo = configuration::weights::WeightInfo; +} // aims to closely emulate the Kusama XcmConfig parameter_types! { diff --git a/xcm/xcm-simulator/example/src/relay_chain.rs b/xcm/xcm-simulator/example/src/relay_chain.rs index a6f6f1989174..cc50aec90d18 100644 --- a/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/xcm/xcm-simulator/example/src/relay_chain.rs @@ -88,7 +88,9 @@ impl pallet_balances::Config for Runtime { impl shared::Config for Runtime {} -impl configuration::Config for Runtime {} +impl configuration::Config for Runtime { + type WeightInfo = configuration::weights::WeightInfo; +} parameter_types! { pub const KsmLocation: MultiLocation = Here.into(); From 9867dad6378e6563c01c00a9df6883b5975bb265 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Thu, 16 Sep 2021 09:54:13 +0000 Subject: [PATCH 08/15] cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs --- .../runtime_parachains_configuration.rs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/runtime/westend/src/weights/runtime_parachains_configuration.rs b/runtime/westend/src/weights/runtime_parachains_configuration.rs index df60d4a59d26..5758836e203d 100644 --- a/runtime/westend/src/weights/runtime_parachains_configuration.rs +++ b/runtime/westend/src/weights/runtime_parachains_configuration.rs @@ -48,21 +48,21 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_validation_upgrade_frequency() -> Weight { - (9_127_000 as Weight) + (9_235_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_validation_upgrade_delay() -> Weight { - (9_294_000 as Weight) + (9_251_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_code_retention_period() -> Weight { - (12_984_000 as Weight) + (12_611_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -70,7 +70,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_code_size() -> Weight { - (13_002_000 as Weight) + (12_643_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -78,7 +78,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_pov_size() -> Weight { - (12_987_000 as Weight) + (12_627_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -86,7 +86,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_head_data_size() -> Weight { - (12_934_000 as Weight) + (12_663_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -94,7 +94,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_parathread_cores() -> Weight { - (12_917_000 as Weight) + (12_743_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -102,7 +102,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_parathread_retries() -> Weight { - (12_933_000 as Weight) + (12_623_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -110,7 +110,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_group_rotation_frequency() -> Weight { - (12_925_000 as Weight) + (12_594_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -118,7 +118,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_chain_availability_period() -> Weight { - (12_855_000 as Weight) + (12_647_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -126,7 +126,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_thread_availability_period() -> Weight { - (13_047_000 as Weight) + (12_694_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -134,7 +134,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_scheduling_lookahead() -> Weight { - (12_943_000 as Weight) + (12_644_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -142,7 +142,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_validators_per_core() -> Weight { - (13_080_000 as Weight) + (12_716_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -150,7 +150,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_validators() -> Weight { - (13_083_000 as Weight) + (12_590_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -158,7 +158,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_dispute_period() -> Weight { - (12_889_000 as Weight) + (12_574_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -166,7 +166,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_dispute_post_conclusion_acceptance_period() -> Weight { - (12_883_000 as Weight) + (12_718_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -174,7 +174,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_dispute_max_spam_slots() -> Weight { - (12_946_000 as Weight) + (12_582_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -182,7 +182,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_dispute_conclusion_by_time_out_period() -> Weight { - (12_836_000 as Weight) + (12_677_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -190,7 +190,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_no_show_slots() -> Weight { - (12_923_000 as Weight) + (12_632_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -198,7 +198,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_n_delay_tranches() -> Weight { - (13_015_000 as Weight) + (12_740_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -206,7 +206,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_zeroth_delay_tranche_width() -> Weight { - (13_051_000 as Weight) + (12_591_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -214,7 +214,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_needed_approvals() -> Weight { - (12_932_000 as Weight) + (12_709_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -222,7 +222,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_relay_vrf_modulo_samples() -> Weight { - (13_026_000 as Weight) + (12_752_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -230,7 +230,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_upward_queue_count() -> Weight { - (12_938_000 as Weight) + (12_544_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -238,7 +238,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_upward_queue_size() -> Weight { - (12_915_000 as Weight) + (12_567_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -246,14 +246,14 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_downward_message_size() -> Weight { - (9_444_000 as Weight) + (9_161_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_ump_service_total_weight() -> Weight { - (12_985_000 as Weight) + (12_680_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -261,7 +261,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_upward_message_size() -> Weight { - (12_931_000 as Weight) + (12_459_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -269,7 +269,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_max_upward_message_num_per_candidate() -> Weight { - (13_088_000 as Weight) + (12_601_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -281,7 +281,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_sender_deposit() -> Weight { - (13_052_000 as Weight) + (12_564_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -289,7 +289,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_recipient_deposit() -> Weight { - (12_806_000 as Weight) + (12_635_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -297,7 +297,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_channel_max_capacity() -> Weight { - (12_976_000 as Weight) + (12_554_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -305,7 +305,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_channel_max_total_size() -> Weight { - (12_966_000 as Weight) + (12_522_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -313,7 +313,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_max_parachain_inbound_channels() -> Weight { - (13_042_000 as Weight) + (12_652_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -321,7 +321,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_max_parathread_inbound_channels() -> Weight { - (12_948_000 as Weight) + (12_777_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -329,7 +329,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_channel_max_message_size() -> Weight { - (12_915_000 as Weight) + (12_702_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -337,7 +337,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_max_parachain_outbound_channels() -> Weight { - (12_911_000 as Weight) + (12_624_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -345,7 +345,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_max_parathread_outbound_channels() -> Weight { - (12_717_000 as Weight) + (12_624_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -353,7 +353,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_hrmp_max_message_num_per_candidate() -> Weight { - (12_776_000 as Weight) + (12_497_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } From f06f9ba8e764edd4674e632225dac697ed26ba8c Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Thu, 16 Sep 2021 22:52:21 -0700 Subject: [PATCH 09/15] Condense the number of WeightInfo methods --- runtime/parachains/src/configuration.rs | 124 +++----- .../src/configuration/benchmarking.rs | 78 +---- .../parachains/src/configuration/weights.rs | 294 +----------------- runtime/westend/src/weights/mod.rs | 1 + .../runtime_parachains_configuration.rs | 280 +---------------- 5 files changed, 68 insertions(+), 709 deletions(-) diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index b830aef03ddf..bcfc05e1a6c5 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -263,46 +263,12 @@ impl HostConfiguration { } pub trait WeightInfo { - fn set_validation_upgrade_frequency() -> Weight; - fn set_validation_upgrade_delay() -> Weight; - fn set_code_retention_period() -> Weight; - fn set_max_code_size() -> Weight; - fn set_max_pov_size() -> Weight; - fn set_max_head_data_size() -> Weight; - fn set_parathread_cores() -> Weight; - fn set_parathread_retries() -> Weight; - fn set_group_rotation_frequency() -> Weight; - fn set_chain_availability_period() -> Weight; - fn set_thread_availability_period() -> Weight; - fn set_scheduling_lookahead() -> Weight; - fn set_max_validators_per_core() -> Weight; - fn set_max_validators() -> Weight; - fn set_dispute_period() -> Weight; - fn set_dispute_post_conclusion_acceptance_period() -> Weight; - fn set_dispute_max_spam_slots() -> Weight; - fn set_dispute_conclusion_by_time_out_period() -> Weight; - fn set_no_show_slots() -> Weight; - fn set_n_delay_tranches() -> Weight; - fn set_zeroth_delay_tranche_width() -> Weight; - fn set_needed_approvals() -> Weight; - fn set_relay_vrf_modulo_samples() -> Weight; - fn set_max_upward_queue_count() -> Weight; - fn set_max_upward_queue_size() -> Weight; - fn set_max_downward_message_size() -> Weight; - fn set_ump_service_total_weight() -> Weight; - fn set_max_upward_message_size() -> Weight; - fn set_max_upward_message_num_per_candidate() -> Weight; + fn set_config_with_block_number() -> Weight; + fn set_config_with_u32() -> Weight; + fn set_config_with_option_u32() -> Weight; + fn set_config_with_weight() -> Weight; + fn set_config_with_balance() -> Weight; fn set_hrmp_open_request_ttl() -> Weight; - fn set_hrmp_sender_deposit() -> Weight; - fn set_hrmp_recipient_deposit() -> Weight; - fn set_hrmp_channel_max_capacity() -> Weight; - fn set_hrmp_channel_max_total_size() -> Weight; - fn set_hrmp_max_parachain_inbound_channels() -> Weight; - fn set_hrmp_max_parathread_inbound_channels() -> Weight; - fn set_hrmp_channel_max_message_size() -> Weight; - fn set_hrmp_max_parachain_outbound_channels() -> Weight; - fn set_hrmp_max_parathread_outbound_channels() -> Weight; - fn set_hrmp_max_message_num_per_candidate() -> Weight; } #[frame_support::pallet] @@ -360,7 +326,7 @@ pub mod pallet { #[pallet::call] impl Pallet { /// Set the validation upgrade frequency. - #[pallet::weight(T::WeightInfo::set_validation_upgrade_frequency())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_validation_upgrade_frequency( origin: OriginFor, new: T::BlockNumber, @@ -373,7 +339,7 @@ pub mod pallet { } /// Set the validation upgrade delay. - #[pallet::weight(T::WeightInfo::set_validation_upgrade_delay())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_validation_upgrade_delay( origin: OriginFor, new: T::BlockNumber, @@ -386,7 +352,7 @@ pub mod pallet { } /// Set the acceptance period for an included candidate. - #[pallet::weight(T::WeightInfo::set_code_retention_period())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_code_retention_period( origin: OriginFor, new: T::BlockNumber, @@ -399,7 +365,7 @@ pub mod pallet { } /// Set the max validation code size for incoming upgrades. - #[pallet::weight(T::WeightInfo::set_max_code_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_code_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; ensure!(new <= MAX_CODE_SIZE, Error::::InvalidNewValue); @@ -410,7 +376,7 @@ pub mod pallet { } /// Set the max POV block size for incoming upgrades. - #[pallet::weight(T::WeightInfo::set_max_pov_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_pov_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; ensure!(new <= MAX_POV_SIZE, Error::::InvalidNewValue); @@ -421,7 +387,7 @@ pub mod pallet { } /// Set the max head data size for paras. - #[pallet::weight(T::WeightInfo::set_max_head_data_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_head_data_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -431,7 +397,7 @@ pub mod pallet { } /// Set the number of parathread execution cores. - #[pallet::weight(T::WeightInfo::set_parathread_cores())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_parathread_cores(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -441,7 +407,7 @@ pub mod pallet { } /// Set the number of retries for a particular parathread. - #[pallet::weight(T::WeightInfo::set_parathread_retries())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_parathread_retries(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -451,7 +417,7 @@ pub mod pallet { } /// Set the parachain validator-group rotation frequency - #[pallet::weight(T::WeightInfo::set_group_rotation_frequency())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_group_rotation_frequency( origin: OriginFor, new: T::BlockNumber, @@ -467,7 +433,7 @@ pub mod pallet { } /// Set the availability period for parachains. - #[pallet::weight(T::WeightInfo::set_chain_availability_period())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_chain_availability_period( origin: OriginFor, new: T::BlockNumber, @@ -483,7 +449,7 @@ pub mod pallet { } /// Set the availability period for parathreads. - #[pallet::weight(T::WeightInfo::set_thread_availability_period())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_thread_availability_period( origin: OriginFor, new: T::BlockNumber, @@ -499,7 +465,7 @@ pub mod pallet { } /// Set the scheduling lookahead, in expected number of blocks at peak throughput. - #[pallet::weight(T::WeightInfo::set_scheduling_lookahead())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_scheduling_lookahead(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -509,7 +475,7 @@ pub mod pallet { } /// Set the maximum number of validators to assign to any core. - #[pallet::weight(T::WeightInfo::set_max_validators_per_core())] + #[pallet::weight(T::WeightInfo::set_config_with_option_u32())] pub fn set_max_validators_per_core( origin: OriginFor, new: Option, @@ -522,7 +488,7 @@ pub mod pallet { } /// Set the maximum number of validators to use in parachain consensus. - #[pallet::weight(T::WeightInfo::set_max_validators())] + #[pallet::weight(T::WeightInfo::set_config_with_option_u32())] pub fn set_max_validators(origin: OriginFor, new: Option) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -532,7 +498,7 @@ pub mod pallet { } /// Set the dispute period, in number of sessions to keep for disputes. - #[pallet::weight(T::WeightInfo::set_dispute_period())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_dispute_period(origin: OriginFor, new: SessionIndex) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -542,7 +508,7 @@ pub mod pallet { } /// Set the dispute post conclusion acceptance period. - #[pallet::weight(T::WeightInfo::set_dispute_post_conclusion_acceptance_period())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_dispute_post_conclusion_acceptance_period( origin: OriginFor, new: T::BlockNumber, @@ -556,7 +522,7 @@ pub mod pallet { } /// Set the maximum number of dispute spam slots. - #[pallet::weight(T::WeightInfo::set_dispute_max_spam_slots())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_dispute_max_spam_slots(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -566,7 +532,7 @@ pub mod pallet { } /// Set the dispute conclusion by time out period. - #[pallet::weight(T::WeightInfo::set_dispute_conclusion_by_time_out_period())] + #[pallet::weight(T::WeightInfo::set_config_with_block_number())] pub fn set_dispute_conclusion_by_time_out_period( origin: OriginFor, new: T::BlockNumber, @@ -580,7 +546,7 @@ pub mod pallet { /// Set the no show slots, in number of number of consensus slots. /// Must be at least 1. - #[pallet::weight(T::WeightInfo::set_no_show_slots())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_no_show_slots(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; @@ -593,7 +559,7 @@ pub mod pallet { } /// Set the total number of delay tranches. - #[pallet::weight(T::WeightInfo::set_n_delay_tranches())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_n_delay_tranches(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -603,7 +569,7 @@ pub mod pallet { } /// Set the zeroth delay tranche width. - #[pallet::weight(T::WeightInfo::set_zeroth_delay_tranche_width())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_zeroth_delay_tranche_width(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -613,7 +579,7 @@ pub mod pallet { } /// Set the number of validators needed to approve a block. - #[pallet::weight(T::WeightInfo::set_needed_approvals())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_needed_approvals(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -623,7 +589,7 @@ pub mod pallet { } /// Set the number of samples to do of the `RelayVRFModulo` approval assignment criterion. - #[pallet::weight(T::WeightInfo::set_relay_vrf_modulo_samples())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_relay_vrf_modulo_samples(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -633,7 +599,7 @@ pub mod pallet { } /// Sets the maximum items that can present in a upward dispatch queue at once. - #[pallet::weight(T::WeightInfo::set_max_upward_queue_count())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_upward_queue_count(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -643,7 +609,7 @@ pub mod pallet { } /// Sets the maximum total size of items that can present in a upward dispatch queue at once. - #[pallet::weight(T::WeightInfo::set_max_upward_queue_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_upward_queue_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -653,7 +619,7 @@ pub mod pallet { } /// Set the critical downward message size. - #[pallet::weight(T::WeightInfo::set_max_downward_message_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_downward_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -663,7 +629,7 @@ pub mod pallet { } /// Sets the soft limit for the phase of dispatching dispatchable upward messages. - #[pallet::weight(T::WeightInfo::set_ump_service_total_weight())] + #[pallet::weight(T::WeightInfo::set_config_with_weight())] pub fn set_ump_service_total_weight(origin: OriginFor, new: Weight) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -673,7 +639,7 @@ pub mod pallet { } /// Sets the maximum size of an upward message that can be sent by a candidate. - #[pallet::weight(T::WeightInfo::set_max_upward_message_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_upward_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -683,7 +649,7 @@ pub mod pallet { } /// Sets the maximum number of messages that a candidate can contain. - #[pallet::weight(T::WeightInfo::set_max_upward_message_num_per_candidate())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_max_upward_message_num_per_candidate( origin: OriginFor, new: u32, @@ -704,7 +670,7 @@ pub mod pallet { } /// Sets the amount of funds that the sender should provide for opening an HRMP channel. - #[pallet::weight(T::WeightInfo::set_hrmp_sender_deposit())] + #[pallet::weight(T::WeightInfo::set_config_with_balance())] pub fn set_hrmp_sender_deposit(origin: OriginFor, new: Balance) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -715,7 +681,7 @@ pub mod pallet { /// Sets the amount of funds that the recipient should provide for accepting opening an HRMP /// channel. - #[pallet::weight(T::WeightInfo::set_hrmp_recipient_deposit())] + #[pallet::weight(T::WeightInfo::set_config_with_balance())] pub fn set_hrmp_recipient_deposit(origin: OriginFor, new: Balance) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -725,7 +691,7 @@ pub mod pallet { } /// Sets the maximum number of messages allowed in an HRMP channel at once. - #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_capacity())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_channel_max_capacity(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -735,7 +701,7 @@ pub mod pallet { } /// Sets the maximum total size of messages in bytes allowed in an HRMP channel at once. - #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_total_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_channel_max_total_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -745,7 +711,7 @@ pub mod pallet { } /// Sets the maximum number of inbound HRMP channels a parachain is allowed to accept. - #[pallet::weight(T::WeightInfo::set_hrmp_max_parachain_inbound_channels())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_max_parachain_inbound_channels( origin: OriginFor, new: u32, @@ -758,7 +724,7 @@ pub mod pallet { } /// Sets the maximum number of inbound HRMP channels a parathread is allowed to accept. - #[pallet::weight(T::WeightInfo::set_hrmp_max_parathread_inbound_channels())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_max_parathread_inbound_channels( origin: OriginFor, new: u32, @@ -771,7 +737,7 @@ pub mod pallet { } /// Sets the maximum size of a message that could ever be put into an HRMP channel. - #[pallet::weight(T::WeightInfo::set_hrmp_channel_max_message_size())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_channel_max_message_size(origin: OriginFor, new: u32) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { @@ -781,7 +747,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP channels a parachain is allowed to open. - #[pallet::weight(T::WeightInfo::set_hrmp_max_parachain_outbound_channels())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_max_parachain_outbound_channels( origin: OriginFor, new: u32, @@ -794,7 +760,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP channels a parathread is allowed to open. - #[pallet::weight(T::WeightInfo::set_hrmp_max_parathread_outbound_channels())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_max_parathread_outbound_channels( origin: OriginFor, new: u32, @@ -807,7 +773,7 @@ pub mod pallet { } /// Sets the maximum number of outbound HRMP messages can be sent by a candidate. - #[pallet::weight(T::WeightInfo::set_hrmp_max_message_num_per_candidate())] + #[pallet::weight(T::WeightInfo::set_config_with_u32())] pub fn set_hrmp_max_message_num_per_candidate( origin: OriginFor, new: u32, @@ -820,7 +786,7 @@ pub mod pallet { } /// Sets the maximum amount of weight any individual upward message may consume. - #[pallet::weight((1_000, DispatchClass::Operational))] + #[pallet::weight(T::WeightInfo::set_config_with_weight())] pub fn set_ump_max_individual_weight(origin: OriginFor, new: Weight) -> DispatchResult { ensure_root(origin)?; Self::update_config_member(|config| { diff --git a/runtime/parachains/src/configuration/benchmarking.rs b/runtime/parachains/src/configuration/benchmarking.rs index 1a78164c43a0..a5bff44c388f 100644 --- a/runtime/parachains/src/configuration/benchmarking.rs +++ b/runtime/parachains/src/configuration/benchmarking.rs @@ -20,63 +20,13 @@ use frame_system::RawOrigin; use sp_runtime::traits::One; benchmarks! { - set_validation_upgrade_frequency {}: _(RawOrigin::Root, One::one()) + set_config_with_block_number {}: set_validation_upgrade_frequency(RawOrigin::Root, One::one()) - set_validation_upgrade_delay {}: _(RawOrigin::Root, One::one()) + set_config_with_u32 {}: set_max_code_size(RawOrigin::Root, 100) - set_code_retention_period {}: _(RawOrigin::Root, One::one()) + set_config_with_option_u32 {}: set_max_validators(RawOrigin::Root, Some(10)) - set_max_code_size {}: _(RawOrigin::Root, 1024) - - set_max_pov_size {}: _(RawOrigin::Root, 1024) - - set_max_head_data_size {}: _(RawOrigin::Root, 1024) - - set_parathread_cores {}: _(RawOrigin::Root, 5) - - set_parathread_retries {}: _(RawOrigin::Root, 10) - - set_group_rotation_frequency {}: _(RawOrigin::Root, One::one()) - - set_chain_availability_period {}: _(RawOrigin::Root, One::one()) - - set_thread_availability_period {}: _(RawOrigin::Root, One::one()) - - set_scheduling_lookahead {}: _(RawOrigin::Root, 10) - - set_max_validators_per_core {}: _(RawOrigin::Root, Some(10)) - - set_max_validators {}: _(RawOrigin::Root, Some(300)) - - set_dispute_period {}: _(RawOrigin::Root, 10) - - set_dispute_post_conclusion_acceptance_period {}: _(RawOrigin::Root, One::one()) - - set_dispute_max_spam_slots {}: _(RawOrigin::Root, 50) - - set_dispute_conclusion_by_time_out_period {}: _(RawOrigin::Root, One::one()) - - set_no_show_slots {}: _(RawOrigin::Root, 10) - - set_n_delay_tranches {}: _(RawOrigin::Root, 10) - - set_zeroth_delay_tranche_width {}: _(RawOrigin::Root, 10) - - set_needed_approvals {}: _(RawOrigin::Root, 5) - - set_relay_vrf_modulo_samples {}: _(RawOrigin::Root, 10) - - set_max_upward_queue_count {}: _(RawOrigin::Root, 3) - - set_max_upward_queue_size {}: _(RawOrigin::Root, 10) - - set_max_downward_message_size {}: _(RawOrigin::Root, 1024) - - set_ump_service_total_weight {}: _(RawOrigin::Root, 3_000_000) - - set_max_upward_message_size {}: _(RawOrigin::Root, 1024) - - set_max_upward_message_num_per_candidate {}: _(RawOrigin::Root, 10) + set_config_with_weight {}: set_ump_service_total_weight(RawOrigin::Root, 3_000_000) set_hrmp_open_request_ttl {}: { Err(BenchmarkError::Override( @@ -84,25 +34,7 @@ benchmarks! { ))?; } - set_hrmp_sender_deposit {}: _(RawOrigin::Root, 100) - - set_hrmp_recipient_deposit {}: _(RawOrigin::Root, 100) - - set_hrmp_channel_max_capacity {}: _(RawOrigin::Root, 10) - - set_hrmp_channel_max_total_size {}: _(RawOrigin::Root, 100) - - set_hrmp_max_parachain_inbound_channels {}: _(RawOrigin::Root, 10) - - set_hrmp_max_parathread_inbound_channels {}: _(RawOrigin::Root, 10) - - set_hrmp_channel_max_message_size {}: _(RawOrigin::Root, 1024) - - set_hrmp_max_parachain_outbound_channels {}: _(RawOrigin::Root, 10) - - set_hrmp_max_parathread_outbound_channels {}: _(RawOrigin::Root, 10) - - set_hrmp_max_message_num_per_candidate {}: _(RawOrigin::Root, 10) + set_config_with_balance {}: set_hrmp_sender_deposit(RawOrigin::Root, 100_000_000_000) } impl_benchmark_test_suite!( diff --git a/runtime/parachains/src/configuration/weights.rs b/runtime/parachains/src/configuration/weights.rs index 6c2b2c29beff..dcd0db415b57 100644 --- a/runtime/parachains/src/configuration/weights.rs +++ b/runtime/parachains/src/configuration/weights.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `runtime_parachains::configuration` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 // Executed Command: @@ -34,233 +34,35 @@ use sp_std::marker::PhantomData; /// Weight functions for runtime_parachains::configuration. pub struct WeightInfo(PhantomData); -impl super::WeightInfo for WeightInfo { +impl runtime_parachains::configuration::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_validation_upgrade_frequency() -> Weight { - (11_878_000 as Weight) + fn set_config_with_block_number() -> Weight { + (10_419_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_validation_upgrade_delay() -> Weight { - (11_594_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_code_retention_period() -> Weight { - (15_986_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_code_size() -> Weight { - (15_996_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_pov_size() -> Weight { - (15_940_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_head_data_size() -> Weight { - (15_830_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_parathread_cores() -> Weight { - (15_996_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_parathread_retries() -> Weight { - (15_899_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_group_rotation_frequency() -> Weight { - (16_499_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_chain_availability_period() -> Weight { - (15_994_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_thread_availability_period() -> Weight { - (15_920_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_scheduling_lookahead() -> Weight { - (16_041_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_validators_per_core() -> Weight { - (15_971_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_validators() -> Weight { - (16_149_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_period() -> Weight { - (15_923_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_post_conclusion_acceptance_period() -> Weight { - (16_047_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_max_spam_slots() -> Weight { - (16_031_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_conclusion_by_time_out_period() -> Weight { - (16_084_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_no_show_slots() -> Weight { - (16_074_000 as Weight) + fn set_config_with_u32() -> Weight { + (15_119_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_n_delay_tranches() -> Weight { - (16_141_000 as Weight) + fn set_config_with_option_u32() -> Weight { + (15_225_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_zeroth_delay_tranche_width() -> Weight { - (16_024_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_needed_approvals() -> Weight { - (15_957_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_relay_vrf_modulo_samples() -> Weight { - (15_988_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_queue_count() -> Weight { - (15_879_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_queue_size() -> Weight { - (15_869_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_downward_message_size() -> Weight { - (11_492_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_ump_service_total_weight() -> Weight { - (15_896_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_message_size() -> Weight { - (15_916_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_message_num_per_candidate() -> Weight { - (15_892_000 as Weight) + fn set_config_with_weight() -> Weight { + (15_265_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -271,80 +73,8 @@ impl super::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_sender_deposit() -> Weight { - (15_931_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_recipient_deposit() -> Weight { - (15_986_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_capacity() -> Weight { - (15_966_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_total_size() -> Weight { - (15_949_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parachain_inbound_channels() -> Weight { - (15_916_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parathread_inbound_channels() -> Weight { - (15_871_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_message_size() -> Weight { - (16_317_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parachain_outbound_channels() -> Weight { - (15_931_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parathread_outbound_channels() -> Weight { - (15_960_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_message_num_per_candidate() -> Weight { - (15_885_000 as Weight) + fn set_config_with_balance() -> Weight { + (15_192_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } diff --git a/runtime/westend/src/weights/mod.rs b/runtime/westend/src/weights/mod.rs index 0dc5bddb0cea..f70b293d2225 100644 --- a/runtime/westend/src/weights/mod.rs +++ b/runtime/westend/src/weights/mod.rs @@ -33,3 +33,4 @@ pub mod runtime_common_auctions; pub mod runtime_common_crowdloan; pub mod runtime_common_paras_registrar; pub mod runtime_common_slots; +pub mod runtime_parachains_configuration; diff --git a/runtime/westend/src/weights/runtime_parachains_configuration.rs b/runtime/westend/src/weights/runtime_parachains_configuration.rs index 5758836e203d..fd0a3df935af 100644 --- a/runtime/westend/src/weights/runtime_parachains_configuration.rs +++ b/runtime/westend/src/weights/runtime_parachains_configuration.rs @@ -47,29 +47,14 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_validation_upgrade_frequency() -> Weight { + fn set_config_with_block_number() -> Weight { (9_235_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_validation_upgrade_delay() -> Weight { - (9_251_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_code_retention_period() -> Weight { - (12_611_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_code_size() -> Weight { + fn set_config_with_u32() -> Weight { (12_643_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -77,79 +62,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_pov_size() -> Weight { - (12_627_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_head_data_size() -> Weight { - (12_663_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_parathread_cores() -> Weight { - (12_743_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_parathread_retries() -> Weight { - (12_623_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_group_rotation_frequency() -> Weight { - (12_594_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_chain_availability_period() -> Weight { - (12_647_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_thread_availability_period() -> Weight { - (12_694_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_scheduling_lookahead() -> Weight { - (12_644_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_validators_per_core() -> Weight { - (12_716_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_validators() -> Weight { + fn set_config_with_option_u32() -> Weight { (12_590_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -157,122 +70,11 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_period() -> Weight { - (12_574_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_post_conclusion_acceptance_period() -> Weight { - (12_718_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_max_spam_slots() -> Weight { - (12_582_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_dispute_conclusion_by_time_out_period() -> Weight { - (12_677_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_no_show_slots() -> Weight { - (12_632_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_n_delay_tranches() -> Weight { - (12_740_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_zeroth_delay_tranche_width() -> Weight { - (12_591_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_needed_approvals() -> Weight { - (12_709_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_relay_vrf_modulo_samples() -> Weight { - (12_752_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_queue_count() -> Weight { - (12_544_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_queue_size() -> Weight { - (12_567_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_downward_message_size() -> Weight { - (9_161_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_ump_service_total_weight() -> Weight { + fn set_config_with_weight() -> Weight { (12_680_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_message_size() -> Weight { - (12_459_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_max_upward_message_num_per_candidate() -> Weight { - (12_601_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } // Storage: Benchmark Override (r:0 w:0) fn set_hrmp_open_request_ttl() -> Weight { (2_000_000_000_000 as Weight) @@ -280,81 +82,9 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_sender_deposit() -> Weight { + fn set_config_with_balance() -> Weight { (12_564_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_recipient_deposit() -> Weight { - (12_635_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_capacity() -> Weight { - (12_554_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_total_size() -> Weight { - (12_522_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parachain_inbound_channels() -> Weight { - (12_652_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parathread_inbound_channels() -> Weight { - (12_777_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_channel_max_message_size() -> Weight { - (12_702_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parachain_outbound_channels() -> Weight { - (12_624_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_parathread_outbound_channels() -> Weight { - (12_624_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:1) - // Storage: Configuration ActiveConfig (r:1 w:0) - fn set_hrmp_max_message_num_per_candidate() -> Weight { - (12_497_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } } From a8459094f38b63f63d1c9f96fa5f82db6da5559f Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Thu, 16 Sep 2021 23:11:27 -0700 Subject: [PATCH 10/15] Fixes --- runtime/parachains/src/configuration/weights.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/parachains/src/configuration/weights.rs b/runtime/parachains/src/configuration/weights.rs index dcd0db415b57..25fc4a2603d3 100644 --- a/runtime/parachains/src/configuration/weights.rs +++ b/runtime/parachains/src/configuration/weights.rs @@ -34,7 +34,7 @@ use sp_std::marker::PhantomData; /// Weight functions for runtime_parachains::configuration. pub struct WeightInfo(PhantomData); -impl runtime_parachains::configuration::WeightInfo for WeightInfo { +impl super::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:0) // Storage: Configuration ActiveConfig (r:1 w:0) From 79d459eb4b5824edb8efb5e5351db65f4f1ee870 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 17 Sep 2021 07:00:25 +0000 Subject: [PATCH 11/15] cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs --- .../runtime_parachains_configuration.rs | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 runtime/kusama/src/weights/runtime_parachains_configuration.rs diff --git a/runtime/kusama/src/weights/runtime_parachains_configuration.rs b/runtime/kusama/src/weights/runtime_parachains_configuration.rs new file mode 100644 index 000000000000..f8956ade67cf --- /dev/null +++ b/runtime/kusama/src/weights/runtime_parachains_configuration.rs @@ -0,0 +1,90 @@ +// 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 `runtime_parachains::configuration` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 + +// Executed Command: +// target/release/polkadot +// benchmark +// --chain=kusama-dev +// --steps=50 +// --repeat=20 +// --pallet=runtime_parachains::configuration +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./file_header.txt +// --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs + + +#![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 `runtime_parachains::configuration`. +pub struct WeightInfo(PhantomData); +impl runtime_parachains::configuration::WeightInfo for WeightInfo { + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_config_with_block_number() -> Weight { + (9_511_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_config_with_u32() -> Weight { + (13_206_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_config_with_option_u32() -> Weight { + (13_472_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_config_with_weight() -> Weight { + (13_421_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Benchmark Override (r:0 w:0) + fn set_hrmp_open_request_ttl() -> Weight { + (2_000_000_000_000 as Weight) + } + // Storage: ParasShared CurrentSessionIndex (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + fn set_config_with_balance() -> Weight { + (13_417_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} From d227bf32ac1b407b7d434eebaf364c951fce7c80 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Fri, 17 Sep 2021 00:09:09 -0700 Subject: [PATCH 12/15] Make use of weights generated from kusama benchmarking --- runtime/kusama/src/lib.rs | 2 +- runtime/kusama/src/weights/mod.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index e5f3558bfe26..78e910f01f01 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -1127,7 +1127,7 @@ impl pallet_proxy::Config for Runtime { impl parachains_origin::Config for Runtime {} impl parachains_configuration::Config for Runtime { - type WeightInfo = parachains_configuration::weights::WeightInfo; + type WeightInfo = weights::runtime_parachains_configuration::WeightInfo; } impl parachains_shared::Config for Runtime {} diff --git a/runtime/kusama/src/weights/mod.rs b/runtime/kusama/src/weights/mod.rs index 35273e1c98a0..adb103ad4eee 100644 --- a/runtime/kusama/src/weights/mod.rs +++ b/runtime/kusama/src/weights/mod.rs @@ -44,3 +44,4 @@ pub mod runtime_common_claims; pub mod runtime_common_crowdloan; pub mod runtime_common_paras_registrar; pub mod runtime_common_slots; +pub mod runtime_parachains_configuration; From bd098618abc53b6d4ba85a6b813077cc52a7769c Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Fri, 17 Sep 2021 02:35:18 -0700 Subject: [PATCH 13/15] Use a better dispatch function for weighing set_config_with_block_number --- .../parachains/src/configuration/benchmarking.rs | 2 +- runtime/parachains/src/configuration/weights.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/runtime/parachains/src/configuration/benchmarking.rs b/runtime/parachains/src/configuration/benchmarking.rs index a5bff44c388f..8b319cb8fabb 100644 --- a/runtime/parachains/src/configuration/benchmarking.rs +++ b/runtime/parachains/src/configuration/benchmarking.rs @@ -20,7 +20,7 @@ use frame_system::RawOrigin; use sp_runtime::traits::One; benchmarks! { - set_config_with_block_number {}: set_validation_upgrade_frequency(RawOrigin::Root, One::one()) + set_config_with_block_number {}: set_code_retention_period(RawOrigin::Root, One::one()) set_config_with_u32 {}: set_max_code_size(RawOrigin::Root, 100) diff --git a/runtime/parachains/src/configuration/weights.rs b/runtime/parachains/src/configuration/weights.rs index 25fc4a2603d3..da70d6cb29d1 100644 --- a/runtime/parachains/src/configuration/weights.rs +++ b/runtime/parachains/src/configuration/weights.rs @@ -32,21 +32,22 @@ use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weight functions for runtime_parachains::configuration. +/// Weight functions for `runtime_parachains::configuration`. pub struct WeightInfo(PhantomData); impl super::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_block_number() -> Weight { - (10_419_000 as Weight) + (16_730_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_u32() -> Weight { - (15_119_000 as Weight) + (16_592_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -54,7 +55,7 @@ impl super::WeightInfo for WeightInfo { // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_option_u32() -> Weight { - (15_225_000 as Weight) + (16_419_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -62,7 +63,7 @@ impl super::WeightInfo for WeightInfo { // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_weight() -> Weight { - (15_265_000 as Weight) + (16_732_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -74,7 +75,7 @@ impl super::WeightInfo for WeightInfo { // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_balance() -> Weight { - (15_192_000 as Weight) + (16_752_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } From cabd75d41785fbc3b1b052ade56d42e42eff1782 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 17 Sep 2021 09:45:54 +0000 Subject: [PATCH 14/15] cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs --- .../src/weights/runtime_parachains_configuration.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/runtime/kusama/src/weights/runtime_parachains_configuration.rs b/runtime/kusama/src/weights/runtime_parachains_configuration.rs index f8956ade67cf..ae840f37752d 100644 --- a/runtime/kusama/src/weights/runtime_parachains_configuration.rs +++ b/runtime/kusama/src/weights/runtime_parachains_configuration.rs @@ -45,17 +45,18 @@ use sp_std::marker::PhantomData; pub struct WeightInfo(PhantomData); impl runtime_parachains::configuration::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_block_number() -> Weight { - (9_511_000 as Weight) + (12_378_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_u32() -> Weight { - (13_206_000 as Weight) + (12_384_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -63,7 +64,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_option_u32() -> Weight { - (13_472_000 as Weight) + (12_746_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -71,7 +72,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_weight() -> Weight { - (13_421_000 as Weight) + (12_563_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -83,7 +84,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_balance() -> Weight { - (13_417_000 as Weight) + (12_644_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } From 20d32e76852c8937a25f76279cdc75d7098e9f86 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 17 Sep 2021 09:54:12 +0000 Subject: [PATCH 15/15] cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs --- .../weights/runtime_parachains_configuration.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/runtime/westend/src/weights/runtime_parachains_configuration.rs b/runtime/westend/src/weights/runtime_parachains_configuration.rs index fd0a3df935af..6c1753e7c3b3 100644 --- a/runtime/westend/src/weights/runtime_parachains_configuration.rs +++ b/runtime/westend/src/weights/runtime_parachains_configuration.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `runtime_parachains::configuration` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 // Executed Command: @@ -41,21 +41,22 @@ use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -/// Weight functions for runtime_parachains::configuration. +/// Weight functions for `runtime_parachains::configuration`. pub struct WeightInfo(PhantomData); impl runtime_parachains::configuration::WeightInfo for WeightInfo { // Storage: ParasShared CurrentSessionIndex (r:1 w:0) - // Storage: Configuration PendingConfig (r:1 w:0) + // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_block_number() -> Weight { - (9_235_000 as Weight) + (12_795_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: ParasShared CurrentSessionIndex (r:1 w:0) // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_u32() -> Weight { - (12_643_000 as Weight) + (12_758_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -63,7 +64,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_option_u32() -> Weight { - (12_590_000 as Weight) + (12_861_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -71,7 +72,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_weight() -> Weight { - (12_680_000 as Weight) + (12_854_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -83,7 +84,7 @@ impl runtime_parachains::configuration::WeightInfo for // Storage: Configuration PendingConfig (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) fn set_config_with_balance() -> Weight { - (12_564_000 as Weight) + (12_838_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) }