From cbfd5b3132e6e78acd60c0d33aeaf100da8fcadc Mon Sep 17 00:00:00 2001 From: muharem Date: Tue, 30 Jan 2024 13:43:20 +0800 Subject: [PATCH 01/49] deposit trait and types, proposal deposit --- Cargo.lock | 1 + substrate/frame/collective/Cargo.toml | 6 + substrate/frame/collective/src/lib.rs | 265 +++++++++++++++++++++++- substrate/frame/collective/src/tests.rs | 131 +++++++++++- 4 files changed, 396 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 497abe4a76cf..86bcf7f8759a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9490,6 +9490,7 @@ dependencies = [ "frame-support", "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", diff --git a/substrate/frame/collective/Cargo.toml b/substrate/frame/collective/Cargo.toml index 91bb36bb89ec..628dddee5b35 100644 --- a/substrate/frame/collective/Cargo.toml +++ b/substrate/frame/collective/Cargo.toml @@ -27,6 +27,9 @@ sp-io = { path = "../../primitives/io", default-features = false } sp-runtime = { path = "../../primitives/runtime", default-features = false } sp-std = { path = "../../primitives/std", default-features = false } +[dev-dependencies] +pallet-balances = { path = "../balances", default-features = false } + [features] default = ["std"] std = [ @@ -35,6 +38,7 @@ std = [ "frame-support/std", "frame-system/std", "log/std", + "pallet-balances/std", "scale-info/std", "sp-core/std", "sp-io/std", @@ -45,10 +49,12 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", + "pallet-balances/try-runtime", "sp-runtime/try-runtime", ] diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 10f989e5c4cc..621905d54022 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -57,8 +57,11 @@ use frame_support::{ }, ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{ - Backing, ChangeMembers, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, - InitializeMembers, StorageVersion, + fungible, + fungible::{BalancedHold, MutateHold}, + tokens::Precision, + Backing, ChangeMembers, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, Imbalance, + InitializeMembers, OnUnbalanced, StorageVersion, }, weights::Weight, }; @@ -88,6 +91,10 @@ pub type ProposalIndex = u32; /// vote exactly once, therefore also the number of votes for any given motion. pub type MemberCount = u32; +type BalanceOf = <>::Currency as fungible::Inspect< + ::AccountId, +>>::Balance; + /// Default voting strategy when a member is inactive. pub trait DefaultVote { /// Get the default voting strategy, given: @@ -171,11 +178,135 @@ pub struct Votes { end: BlockNumber, } +/// Determines the deposit amount for a proposal submission. +pub trait GetDeposit { + /// Determines the required deposit for a proposal submission. The `proposal_count` parameter + /// reflects the total number of active proposals in the system, exclusive of the one currently + /// being proposed. The deposit may vary based on this count. If `None` is returned, this + /// indicates that no deposit is required. + fn get_deposit(proposal_count: u32) -> Option; +} + +/// Default implementation for [`GetDeposit`] that implies no deposit is required. +impl GetDeposit for () { + fn get_deposit(_: u32) -> Option { + None + } +} + +/// Types implementing [`GetDeposit`] trait. +/// Look for use examples to [`crate::tests::deposit_types_with_linear_work`], +/// [`crate::tests::deposit_types_with_geometric_work`] and [`crate::tests::constant_deposit_work`]. +pub mod deposit { + use super::GetDeposit; + use sp_core::Get; + use sp_std::marker::PhantomData; + + /// Constant deposit amount regardless of current proposal count. + /// Returns `None` if configured with zero deposit. + pub struct Constant(PhantomData); + impl GetDeposit for Constant + where + Deposit: Get, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(_: u32) -> Option { + let deposit = Deposit::get(); + if deposit == Balance::zero() { + None + } else { + Some(deposit) + } + } + } + + /// Linear increasing with some offset. + /// f(x) = ax + b, a = `Slope`, x = `proposal_count`, b = `Offset`. + pub struct Linear(PhantomData<(Slope, Offset)>); + impl GetDeposit for Linear + where + Slope: Get, + Offset: Get, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + Some(Offset::get().saturating_add(Slope::get().saturating_mul(proposal_count)).into()) + } + } + + /// Geometrically increasing. + /// f(x) = a * r^x, a = `Base`, x = `proposal_count`, r = `Ratio`. + pub struct Geometric(PhantomData<(Ratio, Base)>); + impl GetDeposit for Geometric + where + Ratio: Get, + Base: Get, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + let m = Ratio::get().saturating_pow(proposal_count as usize); + Some(m.saturating_mul(Base::get())) + } + } + + /// Defines `Period` for supplied `Step` implementing [`GetDeposit`] trait. + pub struct Stepped(PhantomData<(Period, Step)>); + impl GetDeposit for Stepped + where + Period: Get, + Step: GetDeposit, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + let step_num = proposal_count / Period::get(); + Step::get_deposit(step_num) + } + } + + /// Defines `Delay` for supplied `Step` implementing [`GetDeposit`] trait. + pub struct Delayed(PhantomData<(Delay, Deposit)>); + impl GetDeposit for Delayed + where + Delay: Get, + Deposit: GetDeposit, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + let delay = Delay::get(); + if delay > proposal_count { + return None + } + let pos = proposal_count.saturating_sub(delay); + Deposit::get_deposit(pos) + } + } + + /// Defines `Ceil` for supplied `Step` implementing [`GetDeposit`] trait. + pub struct WithCeil(PhantomData<(Ceil, Deposit)>); + impl GetDeposit for WithCeil + where + Ceil: Get, + Deposit: GetDeposit, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + if let Some(deposit) = Deposit::get_deposit(proposal_count) { + Some(deposit.min(Ceil::get().into())) + } else { + None + } + } + } +} + #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; + use frame_support::{ + pallet_prelude::*, + traits::{fungible::Credit, OnUnbalanced}, + }; + use frame_system::pallet_prelude::{OriginFor, *}; /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); @@ -190,6 +321,13 @@ pub mod pallet { /// The runtime origin type. type RuntimeOrigin: From>; + /// Overarching hold reason. + type RuntimeHoldReason: From; + + /// The currency used for deposit. + type Currency: MutateHold + + BalancedHold; + /// The runtime call dispatch type. type Proposal: Parameter + Dispatchable< @@ -227,6 +365,19 @@ pub mod pallet { /// The maximum weight of a dispatch call that can be proposed and executed. #[pallet::constant] type MaxProposalWeight: Get; + + /// Mechanism to assess the necessity and amount of the deposit required for publishing and + /// storing a proposal. + type ProposalDeposit: GetDeposit>; + + /// Handler for a slashed funds. + type Slash: OnUnbalanced>; + + /// Origin from which any proposal may be disapproved. + type DisapproveOrigin: EnsureOrigin<::RuntimeOrigin>; + + /// Origin from which any proposal may be killed. + type KillOrigin: EnsureOrigin<::RuntimeOrigin>; } #[pallet::genesis_config] @@ -272,6 +423,12 @@ pub mod pallet { pub type ProposalOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, >::Proposal, OptionQuery>; + /// Deposit taken for publishing and storing a proposal. Determined by [Config::ProposalDeposit] + /// and may not be applicable for certain proposals. + #[pallet::storage] + pub type DepositOf, I: 'static = ()> = + StorageMap<_, Identity, T::Hash, (T::AccountId, BalanceOf), OptionQuery>; + /// Votes on a given proposal, if it is ongoing. #[pallet::storage] #[pallet::getter(fn voting)] @@ -324,6 +481,20 @@ pub mod pallet { MemberExecuted { proposal_hash: T::Hash, result: DispatchResult }, /// A proposal was closed because its threshold was reached or after its duration was up. Closed { proposal_hash: T::Hash, yes: MemberCount, no: MemberCount }, + /// A motion was killed and deposit slashed. + Killed { proposal_hash: T::Hash }, + /// A proposal deposit was slashed. + ProposalDepositSlashed { + proposal_hash: T::Hash, + who: T::AccountId, + amount: BalanceOf, + }, + /// A proposal deposit was released. + ProposalDepositReleased { + proposal_hash: T::Hash, + who: T::AccountId, + amount: BalanceOf, + }, } #[pallet::error] @@ -350,6 +521,8 @@ pub mod pallet { WrongProposalLength, /// Prime account is not a member PrimeAccountNotMember, + /// Proposal is still active. + ProposalActive, } #[pallet::hooks] @@ -360,6 +533,14 @@ pub mod pallet { } } + /// A reason for the pallet placing a hold on funds. + #[pallet::composite_enum] + pub enum HoldReason { + /// Funds are held for submitting and storing a proposal. + #[codec(index = 0)] + ProposalSubmission, + } + // Note that councillor operations are assigned to the operational class. #[pallet::call] impl, I: 'static> Pallet { @@ -597,7 +778,7 @@ pub mod pallet { origin: OriginFor, proposal_hash: T::Hash, ) -> DispatchResultWithPostInfo { - ensure_root(origin)?; + T::DisapproveOrigin::ensure_origin(origin)?; let proposal_count = Self::do_disapprove_proposal(proposal_hash); Ok(Some(T::WeightInfo::disapprove_proposal(proposal_count)).into()) } @@ -652,6 +833,39 @@ pub mod pallet { Self::do_close(proposal_hash, index, proposal_weight_bound, length_bound) } + + /// Disapprove a proposal and slash the deposits. + /// + /// Parameters: + /// - `origin`: must be the `KillOrigin`. + /// - `proposal_hash`: The hash of the proposal that should be disapproved. + /// + /// Emits `Killed` and `ProposalDepositSlashed` if a deposit was present. + #[pallet::call_index(7)] + #[pallet::weight(1)] // TODO + pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { + T::KillOrigin::ensure_origin(origin)?; + let proposal_count = Self::do_kill_proposal(proposal_hash)?; + Ok(Some(T::WeightInfo::disapprove_proposal(proposal_count)).into()) + } + + /// Release the deposit of a completed proposal + /// + /// Parameters: + /// - `origin`: must be `Signed` or `Root`. + /// - `proposal_hash`: The hash of the proposal that should be disapproved. + /// + /// Emits `ProposalDepositReleased`. + #[pallet::call_index(8)] + #[pallet::weight(1)] // TODO + pub fn release_proposal_deposit( + origin: OriginFor, + proposal_hash: T::Hash, + ) -> DispatchResult { + let _ = ensure_signed_or_root(origin)?; + let _ = Self::do_release_proposal_deposit(proposal_hash)?; + Ok(()) + } } } @@ -722,6 +936,11 @@ impl, I: 'static> Pallet { Ok(proposals.len()) })?; + if let Some(deposit) = T::ProposalDeposit::get_deposit(active_proposals as u32 - 1) { + T::Currency::hold(&HoldReason::ProposalSubmission.into(), &who, deposit)?; + >::insert(proposal_hash, (who.clone(), deposit)); + } + let index = Self::proposal_count(); >::mutate(|i| *i += 1); >::insert(proposal_hash, proposal); @@ -937,6 +1156,42 @@ impl, I: 'static> Pallet { Self::remove_proposal(proposal_hash) } + /// Releases a proposal deposit, if one exists. + fn do_release_proposal_deposit( + proposal_hash: T::Hash, + ) -> Result>, DispatchError> { + ensure!(ProposalOf::::get(&proposal_hash).is_none(), Error::::ProposalActive); + if let Some((who, deposit)) = >::take(proposal_hash) { + T::Currency::release( + &HoldReason::ProposalSubmission.into(), + &who, + deposit, + Precision::Exact, + ) + .map(|amount| { + Self::deposit_event(Event::ProposalDepositReleased { proposal_hash, who, amount }); + Some(amount) + })?; + } + Ok(None) + } + + /// Removes a proposal, slashes it's deposit if one exists and emits the `Killed` event. + fn do_kill_proposal(proposal_hash: T::Hash) -> Result { + if let Some((who, deposit)) = >::take(proposal_hash) { + let (credit, _) = + T::Currency::slash(&HoldReason::ProposalSubmission.into(), &who, deposit); + Self::deposit_event(Event::ProposalDepositSlashed { + proposal_hash, + who, + amount: credit.peek(), + }); + T::Slash::on_unbalanced(credit); + } + Self::deposit_event(Event::Killed { proposal_hash }); + Ok(Self::remove_proposal(proposal_hash)) + } + // Removes a proposal from the pallet, cleaning up votes and the vector of proposals. fn remove_proposal(proposal_hash: T::Hash) -> u32 { // remove proposal and vote diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index dbc3fbe69b3b..a19f78ca0ac9 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -25,7 +25,7 @@ use frame_support::{ Hashable, }; use frame_system::{EnsureRoot, EventRecord, Phase}; -use sp_core::H256; +use sp_core::{ConstU128, H256}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, @@ -39,6 +39,7 @@ frame_support::construct_runtime!( pub enum Test { System: frame_system, + Balances: pallet_balances, Collective: pallet_collective::, CollectiveMajority: pallet_collective::, DefaultCollective: pallet_collective, @@ -109,7 +110,7 @@ impl frame_system::Config for Test { type BlockHashCount = ConstU64<250>; type Version = (); type PalletInfo = PalletInfo; - type AccountData = (); + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); @@ -117,8 +118,18 @@ impl frame_system::Config for Test { type OnSetCode = (); type MaxConsumers = ConstU32<16>; } + +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] +impl pallet_balances::Config for Test { + type ReserveIdentifier = [u8; 8]; + type AccountStore = System; + type RuntimeHoldReason = RuntimeHoldReason; +} + impl Config for Test { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -128,9 +139,15 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; + type ProposalDeposit = (); + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Slash = (); } impl Config for Test { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -140,6 +157,10 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; + type ProposalDeposit = (); + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Slash = (); } impl mock_democracy::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -147,6 +168,8 @@ impl mock_democracy::Config for Test { } impl Config for Test { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -156,6 +179,10 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; + type ProposalDeposit = (); + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Slash = (); } pub struct ExtBuilder { @@ -177,6 +204,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { system: frame_system::GenesisConfig::default(), + balances: pallet_balances::GenesisConfig::default(), collective: pallet_collective::GenesisConfig { members: self.collective_members, phantom: Default::default(), @@ -1525,3 +1553,102 @@ fn migration_v4() { crate::migrations::v4::post_migrate::(old_pallet); }); } + +#[test] +fn deposit_types_with_linear_work() { + type LinearWithSlop2 = crate::deposit::Linear, ConstU32<10>>; + assert_eq!(LinearWithSlop2::get_deposit(0), Some(10u128)); + assert_eq!(LinearWithSlop2::get_deposit(1), Some(12u128)); + assert_eq!(LinearWithSlop2::get_deposit(2), Some(14u128)); + assert_eq!(LinearWithSlop2::get_deposit(3), Some(16u128)); + assert_eq!(LinearWithSlop2::get_deposit(4), Some(18u128)); + + type SteppedWithStep3 = crate::deposit::Stepped, LinearWithSlop2>; + assert_eq!(SteppedWithStep3::get_deposit(0), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(1), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(2), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(3), Some(12u128)); + assert_eq!(SteppedWithStep3::get_deposit(4), Some(12u128)); + assert_eq!(SteppedWithStep3::get_deposit(5), Some(12u128)); + assert_eq!(SteppedWithStep3::get_deposit(6), Some(14u128)); + + type DelayedWithDelay4 = crate::deposit::Delayed, SteppedWithStep3>; + assert_eq!(DelayedWithDelay4::get_deposit(0), None::); + assert_eq!(DelayedWithDelay4::get_deposit(3), None::); + assert_eq!(DelayedWithDelay4::get_deposit(4), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(5), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(6), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(7), Some(12u128)); + assert_eq!(DelayedWithDelay4::get_deposit(9), Some(12u128)); + assert_eq!(DelayedWithDelay4::get_deposit(10), Some(14u128)); + assert_eq!(DelayedWithDelay4::get_deposit(13), Some(16u128)); + + type WithCeil13 = crate::deposit::WithCeil, DelayedWithDelay4>; + assert_eq!(WithCeil13::get_deposit(0), None::); + assert_eq!(WithCeil13::get_deposit(4), Some(10u128)); + assert_eq!(WithCeil13::get_deposit(9), Some(12u128)); + assert_eq!(WithCeil13::get_deposit(10), Some(13u128)); + assert_eq!(WithCeil13::get_deposit(11), Some(13u128)); + assert_eq!(WithCeil13::get_deposit(13), Some(13u128)); +} + +#[test] +fn deposit_types_with_geometric_work() { + type WithRatio2Base10 = crate::deposit::Geometric, ConstU128<10>>; + assert_eq!(WithRatio2Base10::get_deposit(0), Some(10u128)); + assert_eq!(WithRatio2Base10::get_deposit(1), Some(20u128)); + assert_eq!(WithRatio2Base10::get_deposit(2), Some(40u128)); + assert_eq!(WithRatio2Base10::get_deposit(3), Some(80u128)); + assert_eq!(WithRatio2Base10::get_deposit(4), Some(160u128)); + assert_eq!(WithRatio2Base10::get_deposit(5), Some(320u128)); + assert_eq!(WithRatio2Base10::get_deposit(6), Some(640u128)); + assert_eq!(WithRatio2Base10::get_deposit(7), Some(1280u128)); + assert_eq!(WithRatio2Base10::get_deposit(8), Some(2560u128)); + assert_eq!(WithRatio2Base10::get_deposit(9), Some(5120u128)); + + type SteppedWithStep3 = crate::deposit::Stepped, WithRatio2Base10>; + assert_eq!(SteppedWithStep3::get_deposit(0), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(1), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(2), Some(10u128)); + assert_eq!(SteppedWithStep3::get_deposit(3), Some(20u128)); + assert_eq!(SteppedWithStep3::get_deposit(4), Some(20u128)); + assert_eq!(SteppedWithStep3::get_deposit(5), Some(20u128)); + assert_eq!(SteppedWithStep3::get_deposit(6), Some(40u128)); + + type DelayedWithDelay4 = crate::deposit::Delayed, SteppedWithStep3>; + assert_eq!(DelayedWithDelay4::get_deposit(0), None::); + assert_eq!(DelayedWithDelay4::get_deposit(3), None::); + assert_eq!(DelayedWithDelay4::get_deposit(4), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(5), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(6), Some(10u128)); + assert_eq!(DelayedWithDelay4::get_deposit(7), Some(20u128)); + assert_eq!(DelayedWithDelay4::get_deposit(9), Some(20u128)); + assert_eq!(DelayedWithDelay4::get_deposit(10), Some(40u128)); + assert_eq!(DelayedWithDelay4::get_deposit(13), Some(80u128)); + + type WithCeil21 = crate::deposit::WithCeil, DelayedWithDelay4>; + assert_eq!(WithCeil21::get_deposit(0), None::); + assert_eq!(WithCeil21::get_deposit(4), Some(10u128)); + assert_eq!(WithCeil21::get_deposit(9), Some(20u128)); + assert_eq!(WithCeil21::get_deposit(10), Some(21u128)); + assert_eq!(WithCeil21::get_deposit(11), Some(21u128)); + assert_eq!(WithCeil21::get_deposit(13), Some(21u128)); +} + +#[test] +fn constant_deposit_work() { + type Constant0 = crate::deposit::Constant>; + assert_eq!(Constant0::get_deposit(0), None::); + assert_eq!(Constant0::get_deposit(1), None::); + assert_eq!(Constant0::get_deposit(2), None::); + + type Constant1 = crate::deposit::Constant>; + assert_eq!(Constant1::get_deposit(0), Some(1u128)); + assert_eq!(Constant1::get_deposit(1), Some(1u128)); + assert_eq!(Constant1::get_deposit(2), Some(1u128)); + + type Constant12 = crate::deposit::Constant>; + assert_eq!(Constant12::get_deposit(0), Some(12u128)); + assert_eq!(Constant12::get_deposit(1), Some(12u128)); + assert_eq!(Constant12::get_deposit(2), Some(12u128)); +} From bff29ac68e82fefea077160adc2ab450b488b431 Mon Sep 17 00:00:00 2001 From: muharem Date: Tue, 30 Jan 2024 13:43:48 +0800 Subject: [PATCH 02/49] upgrade to benchmarks v2 --- .../frame/collective/src/benchmarking.rs | 354 +++++++++++------- 1 file changed, 226 insertions(+), 128 deletions(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index 503d72510530..80cf32f4ba2f 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -23,7 +23,11 @@ use crate::Pallet as Collective; use sp_runtime::traits::Bounded; use sp_std::mem::size_of; -use frame_benchmarking::v1::{account, benchmarks_instance_pallet, whitelisted_caller}; +use frame_benchmarking::{ + impl_benchmark_test_suite, + v1::{account, whitelisted_caller}, + v2::*, +}; use frame_system::{ pallet_prelude::BlockNumberFor, Call as SystemCall, Pallet as System, RawOrigin as SystemOrigin, }; @@ -40,20 +44,23 @@ fn id_to_remark_data(id: u32, length: usize) -> Vec { id.to_le_bytes().into_iter().cycle().take(length).collect() } -benchmarks_instance_pallet! { - set_members { - let m in 0 .. T::MaxMembers::get(); - let n in 0 .. T::MaxMembers::get(); - let p in 0 .. T::MaxProposals::get(); +#[instance_benchmarks(where T: Config, I: 'static)] +mod benchmarks { + use super::*; + #[benchmark] + fn set_members( + m: Linear<0, { T::MaxMembers::get() }>, + n: Linear<0, { T::MaxMembers::get() }>, + p: Linear<0, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { // Set old members. // We compute the difference of old and new members, so it should influence timing. let mut old_members = vec![]; - for i in 0 .. m { + for i in 0..m { let old_member = account::("old member", i, SEED); old_members.push(old_member); } - let old_members_count = old_members.len() as u32; Collective::::set_members( SystemOrigin::Root.into(), @@ -68,9 +75,10 @@ benchmarks_instance_pallet! { let threshold = m.max(2); // Length of the proposals should be irrelevant to `set_members`. let length = 100; - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, length) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, length) }.into(); Collective::::propose( SystemOrigin::Signed(old_members.last().unwrap().clone()).into(), threshold, @@ -79,9 +87,9 @@ benchmarks_instance_pallet! { )?; let hash = T::Hashing::hash_of(&proposal); // Vote on the proposal to increase state relevant for `set_members`. - // Not voting for last old member because they proposed and not voting for the first member - // to keep the proposal from passing. - for j in 2 .. m - 1 { + // Not voting for last old member because they proposed and not voting for the first + // member to keep the proposal from passing. + for j in 2..m - 1 { let voter = &old_members[j as usize]; let approve = true; Collective::::vote( @@ -97,26 +105,33 @@ benchmarks_instance_pallet! { // Construct `new_members`. // It should influence timing since it will sort this vector. let mut new_members = vec![]; - for i in 0 .. n { + for i in 0..n { let member = account::("member", i, SEED); new_members.push(member); } + #[extrinsic_call] + _( + SystemOrigin::Root, + new_members.clone(), + new_members.last().cloned(), + T::MaxMembers::get(), + ); - }: _(SystemOrigin::Root, new_members.clone(), new_members.last().cloned(), T::MaxMembers::get()) - verify { new_members.sort(); assert_eq!(Collective::::members(), new_members); + Ok(()) } - execute { - let b in 2 .. MAX_BYTES; - let m in 1 .. T::MaxMembers::get(); - + #[benchmark] + fn execute( + b: Linear<2, MAX_BYTES>, + m: Linear<1, { T::MaxMembers::get() }>, + ) -> Result<(), BenchmarkError> { let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } @@ -124,29 +139,36 @@ benchmarks_instance_pallet! { let caller: T::AccountId = whitelisted_caller(); members.push(caller.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members, None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members, + None, + T::MaxMembers::get(), + )?; + + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(1, b as usize) }.into(); - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(1, b as usize) }.into(); + #[extrinsic_call] + _(SystemOrigin::Signed(caller), Box::new(proposal.clone()), bytes_in_storage); - }: _(SystemOrigin::Signed(caller), Box::new(proposal.clone()), bytes_in_storage) - verify { let proposal_hash = T::Hashing::hash_of(&proposal); // Note that execution fails due to mis-matched origin - assert_last_event::( - Event::MemberExecuted { proposal_hash, result: Ok(()) }.into() - ); + assert_last_event::(Event::MemberExecuted { proposal_hash, result: Ok(()) }.into()); + Ok(()) } // This tests when execution would happen immediately after proposal - propose_execute { - let b in 2 .. MAX_BYTES; - let m in 1 .. T::MaxMembers::get(); - + #[benchmark] + fn propose_execute( + b: Linear<2, MAX_BYTES>, + m: Linear<1, { T::MaxMembers::get() }>, + ) -> Result<(), BenchmarkError> { let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } @@ -154,43 +176,61 @@ benchmarks_instance_pallet! { let caller: T::AccountId = whitelisted_caller(); members.push(caller.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members, None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members, + None, + T::MaxMembers::get(), + )?; - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(1, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(1, b as usize) }.into(); let threshold = 1; - }: propose(SystemOrigin::Signed(caller), threshold, Box::new(proposal.clone()), bytes_in_storage) - verify { + #[extrinsic_call] + propose( + SystemOrigin::Signed(caller), + threshold, + Box::new(proposal.clone()), + bytes_in_storage, + ); + let proposal_hash = T::Hashing::hash_of(&proposal); // Note that execution fails due to mis-matched origin - assert_last_event::( - Event::Executed { proposal_hash, result: Ok(()) }.into() - ); + assert_last_event::(Event::Executed { proposal_hash, result: Ok(()) }.into()); + Ok(()) } // This tests when proposal is created and queued as "proposed" - propose_proposed { - let b in 2 .. MAX_BYTES; - let m in 2 .. T::MaxMembers::get(); - let p in 1 .. T::MaxProposals::get(); - + #[benchmark] + fn propose_proposed( + b: Linear<2, MAX_BYTES>, + m: Linear<2, { T::MaxMembers::get() }>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } let caller: T::AccountId = whitelisted_caller(); members.push(caller.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members, None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members, + None, + T::MaxMembers::get(), + )?; let threshold = m; // Add previous proposals. - for i in 0 .. p - 1 { + for i in 0..p - 1 { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); Collective::::propose( SystemOrigin::Signed(caller.clone()).into(), threshold, @@ -201,20 +241,29 @@ benchmarks_instance_pallet! { assert_eq!(Collective::::proposals().len(), (p - 1) as usize); - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(p, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(p, b as usize) }.into(); + #[extrinsic_call] + propose( + SystemOrigin::Signed(caller.clone()), + threshold, + Box::new(proposal.clone()), + bytes_in_storage, + ); - }: propose(SystemOrigin::Signed(caller.clone()), threshold, Box::new(proposal.clone()), bytes_in_storage) - verify { // New proposal is recorded assert_eq!(Collective::::proposals().len(), p as usize); let proposal_hash = T::Hashing::hash_of(&proposal); - assert_last_event::(Event::Proposed { account: caller, proposal_index: p - 1, proposal_hash, threshold }.into()); + assert_last_event::( + Event::Proposed { account: caller, proposal_index: p - 1, proposal_hash, threshold } + .into(), + ); + Ok(()) } - vote { - // We choose 5 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) - let m in 5 .. T::MaxMembers::get(); - + #[benchmark] + // We choose 5 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) + fn vote(m: Linear<5, { T::MaxMembers::get() }>) -> Result<(), BenchmarkError> { let p = T::MaxProposals::get(); let b = MAX_BYTES; let bytes_in_storage = b + size_of::() as u32; @@ -223,22 +272,28 @@ benchmarks_instance_pallet! { let mut members = vec![]; let proposer: T::AccountId = account::("proposer", 0, SEED); members.push(proposer.clone()); - for i in 1 .. m - 1 { + for i in 1..m - 1 { let member = account::("member", i, SEED); members.push(member); } let voter: T::AccountId = account::("voter", 0, SEED); members.push(voter.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members.clone(), None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members.clone(), + None, + T::MaxMembers::get(), + )?; // Threshold is 1 less than the number of members so that one person can vote nay let threshold = m - 1; // Add previous proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); Collective::::propose( SystemOrigin::Signed(proposer.clone()).into(), threshold, @@ -250,7 +305,7 @@ benchmarks_instance_pallet! { let index = p - 1; // Have almost everyone vote aye on last proposal, while keeping it from passing. - for j in 0 .. m - 3 { + for j in 0..m - 3 { let voter = &members[j as usize]; let approve = true; Collective::::vote( @@ -277,20 +332,24 @@ benchmarks_instance_pallet! { // Whitelist voter account from further DB operations. let voter_key = frame_system::Account::::hashed_key_for(&voter); frame_benchmarking::benchmarking::add_to_whitelist(voter_key.into()); - }: _(SystemOrigin::Signed(voter), last_hash, index, approve) - verify { + + #[extrinsic_call] + _(SystemOrigin::Signed(voter), last_hash, index, approve); + // All proposals exist and the last proposal has just been updated. assert_eq!(Collective::::proposals().len(), p as usize); let voting = Collective::::voting(&last_hash).ok_or("Proposal Missing")?; assert_eq!(voting.ayes.len(), (m - 3) as usize); assert_eq!(voting.nays.len(), 1); + Ok(()) } - close_early_disapproved { - // We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) - let m in 4 .. T::MaxMembers::get(); - let p in 1 .. T::MaxProposals::get(); - + // We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) + #[benchmark] + fn close_early_disapproved( + m: Linear<4, { T::MaxMembers::get() }>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { let bytes = 100; let bytes_in_storage = bytes + size_of::() as u32; @@ -298,22 +357,28 @@ benchmarks_instance_pallet! { let mut members = vec![]; let proposer = account::("proposer", 0, SEED); members.push(proposer.clone()); - for i in 1 .. m - 1 { + for i in 1..m - 1 { let member = account::("member", i, SEED); members.push(member); } let voter = account::("voter", 0, SEED); members.push(voter.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members.clone(), None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members.clone(), + None, + T::MaxMembers::get(), + )?; // Threshold is total members so that one nay will disapprove the vote let threshold = m; // Add previous proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); Collective::::propose( SystemOrigin::Signed(proposer.clone()).into(), threshold, @@ -325,7 +390,7 @@ benchmarks_instance_pallet! { let index = p - 1; // Have most everyone vote aye on last proposal, while keeping it from passing. - for j in 0 .. m - 2 { + for j in 0..m - 2 { let voter = &members[j as usize]; let approve = true; Collective::::vote( @@ -358,39 +423,49 @@ benchmarks_instance_pallet! { // Whitelist voter account from further DB operations. let voter_key = frame_system::Account::::hashed_key_for(&voter); frame_benchmarking::benchmarking::add_to_whitelist(voter_key.into()); - }: close(SystemOrigin::Signed(voter), last_hash, index, Weight::MAX, bytes_in_storage) - verify { + + #[extrinsic_call] + close(SystemOrigin::Signed(voter), last_hash, index, Weight::MAX, bytes_in_storage); + // The last proposal is removed. assert_eq!(Collective::::proposals().len(), (p - 1) as usize); assert_last_event::(Event::Disapproved { proposal_hash: last_hash }.into()); + Ok(()) } - close_early_approved { - let b in 2 .. MAX_BYTES; - // We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) - let m in 4 .. T::MaxMembers::get(); - let p in 1 .. T::MaxProposals::get(); - + // m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) + #[benchmark] + fn close_early_approved( + b: Linear<2, MAX_BYTES>, + m: Linear<4, { T::MaxMembers::get() }>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } let caller: T::AccountId = whitelisted_caller(); members.push(caller.clone()); - Collective::::set_members(SystemOrigin::Root.into(), members.clone(), None, T::MaxMembers::get())?; + Collective::::set_members( + SystemOrigin::Root.into(), + members.clone(), + None, + T::MaxMembers::get(), + )?; // Threshold is 2 so any two ayes will approve the vote let threshold = 2; // Add previous proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); Collective::::propose( SystemOrigin::Signed(caller.clone()).into(), threshold, @@ -400,7 +475,8 @@ benchmarks_instance_pallet! { last_hash = T::Hashing::hash_of(&proposal); } - // Caller switches vote to nay on their own proposal, allowing them to be the deciding approval vote + // Caller switches vote to nay on their own proposal, allowing them to be the deciding + // approval vote Collective::::vote( SystemOrigin::Signed(caller.clone()).into(), last_hash, @@ -409,7 +485,7 @@ benchmarks_instance_pallet! { )?; // Have almost everyone vote nay on last proposal, while keeping it from failing. - for j in 2 .. m - 1 { + for j in 2..m - 1 { let voter = &members[j as usize]; let approve = false; Collective::::vote( @@ -436,27 +512,33 @@ benchmarks_instance_pallet! { Collective::::vote( SystemOrigin::Signed(caller.clone()).into(), last_hash, - index, approve, + index, + approve, )?; - }: close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage) - verify { + #[extrinsic_call] + close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage); + // The last proposal is removed. assert_eq!(Collective::::proposals().len(), (p - 1) as usize); - assert_last_event::(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into()); + assert_last_event::( + Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into(), + ); + Ok(()) } - close_disapproved { - // We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) - let m in 4 .. T::MaxMembers::get(); - let p in 1 .. T::MaxProposals::get(); - + // m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) + #[benchmark] + fn close_disapproved( + m: Linear<4, { T::MaxMembers::get() }>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { let bytes = 100; let bytes_in_storage = bytes + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } @@ -474,9 +556,10 @@ benchmarks_instance_pallet! { // Add proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); Collective::::propose( SystemOrigin::Signed(caller.clone()).into(), threshold, @@ -490,7 +573,7 @@ benchmarks_instance_pallet! { // Have almost everyone vote aye on last proposal, while keeping it from passing. // A few abstainers will be the nay votes needed to fail the vote. let mut yes_votes: MemberCount = 0; - for j in 2 .. m - 1 { + for j in 2..m - 1 { let voter = &members[j as usize]; let approve = true; yes_votes += 1; @@ -499,7 +582,8 @@ benchmarks_instance_pallet! { Some(false), yes_votes, 0, - m,) { + m, + ) { break; } Collective::::vote( @@ -522,23 +606,26 @@ benchmarks_instance_pallet! { assert_eq!(Collective::::proposals().len(), p as usize); // Prime nay will close it as disapproved - }: close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage) - verify { + #[extrinsic_call] + close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage); + assert_eq!(Collective::::proposals().len(), (p - 1) as usize); assert_last_event::(Event::Disapproved { proposal_hash: last_hash }.into()); + Ok(()) } - close_approved { - let b in 2 .. MAX_BYTES; - // We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) - let m in 4 .. T::MaxMembers::get(); - let p in 1 .. T::MaxProposals::get(); - + // m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`) + #[benchmark] + fn close_approved( + b: Linear<2, MAX_BYTES>, + m: Linear<4, { T::MaxMembers::get() }>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } @@ -556,9 +643,10 @@ benchmarks_instance_pallet! { // Add proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); Collective::::propose( SystemOrigin::Signed(caller.clone()).into(), threshold, @@ -573,19 +661,19 @@ benchmarks_instance_pallet! { SystemOrigin::Signed(caller.clone()).into(), last_hash, p - 1, - true // Vote aye. + true, // Vote aye. )?; // Have almost everyone vote nay on last proposal, while keeping it from failing. // A few abstainers will be the aye votes needed to pass the vote. - for j in 2 .. m - 1 { + for j in 2..m - 1 { let voter = &members[j as usize]; let approve = false; Collective::::vote( SystemOrigin::Signed(voter.clone()).into(), last_hash, p - 1, - approve + approve, )?; } @@ -594,22 +682,25 @@ benchmarks_instance_pallet! { assert_eq!(Collective::::proposals().len(), p as usize); // Prime aye will close it as approved - }: close(SystemOrigin::Signed(caller), last_hash, p - 1, Weight::MAX, bytes_in_storage) - verify { + #[extrinsic_call] + close(SystemOrigin::Signed(caller), last_hash, p - 1, Weight::MAX, bytes_in_storage); + assert_eq!(Collective::::proposals().len(), (p - 1) as usize); - assert_last_event::(Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into()); + assert_last_event::( + Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into(), + ); + Ok(()) } - disapprove_proposal { - let p in 1 .. T::MaxProposals::get(); - + #[benchmark] + fn disapprove_proposal(p: Linear<1, { T::MaxProposals::get() }>) -> Result<(), BenchmarkError> { let m = 3; let b = MAX_BYTES; let bytes_in_storage = b + size_of::() as u32; // Construct `members`. let mut members = vec![]; - for i in 0 .. m - 1 { + for i in 0..m - 1 { let member = account::("member", i, SEED); members.push(member); } @@ -627,9 +718,10 @@ benchmarks_instance_pallet! { // Add proposals let mut last_hash = T::Hash::default(); - for i in 0 .. p { + for i in 0..p { // Proposals should be different so that different proposal hashes are generated - let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); Collective::::propose( SystemOrigin::Signed(caller.clone()).into(), threshold, @@ -642,11 +734,17 @@ benchmarks_instance_pallet! { System::::set_block_number(BlockNumberFor::::max_value()); assert_eq!(Collective::::proposals().len(), p as usize); - }: _(SystemOrigin::Root, last_hash) - verify { + #[extrinsic_call] + _(SystemOrigin::Root, last_hash); + assert_eq!(Collective::::proposals().len(), (p - 1) as usize); assert_last_event::(Event::Disapproved { proposal_hash: last_hash }.into()); + Ok(()) } - impl_benchmark_test_suite!(Collective, crate::tests::ExtBuilder::default().build(), crate::tests::Test); + impl_benchmark_test_suite!( + Collective, + crate::tests::ExtBuilder::default().build(), + crate::tests::Test + ); } From 9bc7f8aea5244b1efdcda8d2307706ec868ddae2 Mon Sep 17 00:00:00 2001 From: muharem Date: Tue, 30 Jan 2024 17:32:27 +0800 Subject: [PATCH 03/49] fixes --- substrate/frame/collective/src/lib.rs | 11 ++++++----- substrate/frame/collective/src/tests.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 621905d54022..509952efd59a 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -226,11 +226,12 @@ pub mod deposit { impl GetDeposit for Linear where Slope: Get, - Offset: Get, + Offset: Get, Balance: frame_support::traits::tokens::Balance, { fn get_deposit(proposal_count: u32) -> Option { - Some(Offset::get().saturating_add(Slope::get().saturating_mul(proposal_count)).into()) + let base: Balance = Slope::get().saturating_mul(proposal_count).into(); + Some(Offset::get().saturating_add(base)) } } @@ -322,7 +323,7 @@ pub mod pallet { type RuntimeOrigin: From>; /// Overarching hold reason. - type RuntimeHoldReason: From; + type RuntimeHoldReason: From>; /// The currency used for deposit. type Currency: MutateHold @@ -842,7 +843,7 @@ pub mod pallet { /// /// Emits `Killed` and `ProposalDepositSlashed` if a deposit was present. #[pallet::call_index(7)] - #[pallet::weight(1)] // TODO + #[pallet::weight({1})] // TODO pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { T::KillOrigin::ensure_origin(origin)?; let proposal_count = Self::do_kill_proposal(proposal_hash)?; @@ -857,7 +858,7 @@ pub mod pallet { /// /// Emits `ProposalDepositReleased`. #[pallet::call_index(8)] - #[pallet::weight(1)] // TODO + #[pallet::weight({1})] // TODO pub fn release_proposal_deposit( origin: OriginFor, proposal_hash: T::Hash, diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index a19f78ca0ac9..cf4faa3c88ed 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -1556,7 +1556,7 @@ fn migration_v4() { #[test] fn deposit_types_with_linear_work() { - type LinearWithSlop2 = crate::deposit::Linear, ConstU32<10>>; + type LinearWithSlop2 = crate::deposit::Linear, ConstU128<10>>; assert_eq!(LinearWithSlop2::get_deposit(0), Some(10u128)); assert_eq!(LinearWithSlop2::get_deposit(1), Some(12u128)); assert_eq!(LinearWithSlop2::get_deposit(2), Some(14u128)); From 09f7b3fa71ca7a141a88e43bb8f8ed6e85824f3d Mon Sep 17 00:00:00 2001 From: muharem Date: Tue, 30 Jan 2024 17:45:33 +0800 Subject: [PATCH 04/49] benchmarks --- .../collectives-westend/src/lib.rs | 6 + .../src/weights/pallet_collective.rs | 53 ++ substrate/bin/node/runtime/src/lib.rs | 28 + .../frame/collective/src/benchmarking.rs | 223 ++++- substrate/frame/collective/src/lib.rs | 25 +- substrate/frame/collective/src/weights.rs | 821 ++++++++++-------- 6 files changed, 795 insertions(+), 361 deletions(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index be7beafc89af..055860c8489a 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -523,6 +523,8 @@ pub const ALLIANCE_MAX_MEMBERS: u32 = 100; type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; @@ -532,6 +534,10 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = weights::pallet_collective::WeightInfo; type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = (); + type Slash = (); } pub const MAX_FELLOWS: u32 = ALLIANCE_MAX_MEMBERS; diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index 9133baa6120c..5545eaf37441 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -301,4 +301,57 @@ impl pallet_collective::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `d` is `[0, 1]`. + /// The range of component `p` is `[1, 100]`. + fn kill(d: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `628 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(12_681_542, 3833) + // Standard Error: 29_292_197 + .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) + // Standard Error: 396_965 + .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + } + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// The range of component `d` is `[0, 1]`. + fn release_proposal_deposit(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1748 + d * (212 ±0)` + // Estimated: `5213 + d * (212 ±0)` + // Minimum execution time: 121_000_000 picoseconds. + Weight::from_parts(124_000_000, 5213) + // Standard Error: 1_897_366 + .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + } } diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 37b0d93de296..7e5d3febdbae 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -1096,11 +1096,14 @@ parameter_types! { pub const CouncilMotionDuration: BlockNumber = 5 * DAYS; pub const CouncilMaxProposals: u32 = 100; pub const CouncilMaxMembers: u32 = 100; + pub const ProposalDepositOffset: Balance = ExistentialDeposit::get() + ExistentialDeposit::get(); } type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = CouncilMotionDuration; @@ -1110,6 +1113,13 @@ impl pallet_collective::Config for Runtime { type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxCollectivesProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = pallet_collective::deposit::Delayed< + ConstU32<2>, + pallet_collective::deposit::Linear, ProposalDepositOffset>, + >; + type Slash = (); } parameter_types! { @@ -1162,6 +1172,8 @@ parameter_types! { type TechnicalCollective = pallet_collective::Instance2; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = TechnicalMotionDuration; @@ -1171,6 +1183,13 @@ impl pallet_collective::Config for Runtime { type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxCollectivesProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = pallet_collective::deposit::Delayed< + ConstU32<2>, + pallet_collective::deposit::Linear, ProposalDepositOffset>, + >; + type Slash = (); } type EnsureRootOrHalfCouncil = EitherOfDiverse< @@ -1924,6 +1943,8 @@ parameter_types! { type AllianceCollective = pallet_collective::Instance3; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; @@ -1933,6 +1954,13 @@ impl pallet_collective::Config for Runtime { type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxCollectivesProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = pallet_collective::deposit::Delayed< + ConstU32<2>, + pallet_collective::deposit::Linear, ProposalDepositOffset>, + >; + type Slash = (); } parameter_types! { diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index 80cf32f4ba2f..3808c72e3adc 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -28,6 +28,7 @@ use frame_benchmarking::{ v1::{account, whitelisted_caller}, v2::*, }; +use frame_support::traits::fungible::{Inspect, Mutate}; use frame_system::{ pallet_prelude::BlockNumberFor, Call as SystemCall, Pallet as System, RawOrigin as SystemOrigin, }; @@ -40,11 +41,15 @@ fn assert_last_event, I: 'static>(generic_event: >:: frame_system::Pallet::::assert_last_event(generic_event.into()); } +fn assert_has_event, I: 'static>(generic_event: >::RuntimeEvent) { + frame_system::Pallet::::assert_has_event(generic_event.into()); +} + fn id_to_remark_data(id: u32, length: usize) -> Vec { id.to_le_bytes().into_iter().cycle().take(length).collect() } -#[instance_benchmarks(where T: Config, I: 'static)] +#[instance_benchmarks(where T: Config, I: 'static, T::Currency: Mutate)] mod benchmarks { use super::*; @@ -71,16 +76,21 @@ mod benchmarks { // If there were any old members generate a bunch of proposals. if m > 0 { + let caller = old_members.last().unwrap().clone(); // Set a high threshold for proposals passing so that they stay around. let threshold = m.max(2); // Length of the proposals should be irrelevant to `set_members`. let length = 100; for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, deposit + ed)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, length) }.into(); Collective::::propose( - SystemOrigin::Signed(old_members.last().unwrap().clone()).into(), + SystemOrigin::Signed(caller.clone()).into(), threshold, Box::new(proposal.clone()), MAX_BYTES, @@ -225,9 +235,15 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + let threshold = m; // Add previous proposals. for i in 0..p - 1 { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -241,6 +257,10 @@ mod benchmarks { assert_eq!(Collective::::proposals().len(), (p - 1) as usize); + if let Some(deposit) = T::ProposalDeposit::get_deposit(p) { + T::Currency::mint_into(&caller, deposit)?; + } + let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(p, b as usize) }.into(); #[extrinsic_call] @@ -285,12 +305,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&proposer, ed)?; + // Threshold is 1 less than the number of members so that one person can vote nay let threshold = m - 1; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&proposer, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -370,12 +396,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&proposer, ed)?; + // Threshold is total members so that one nay will disapprove the vote let threshold = m; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&proposer, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); @@ -457,12 +489,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + // Threshold is 2 so any two ayes will approve the vote let threshold = 2; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -551,12 +589,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + // Threshold is one less than total members so that two nays will disapprove the vote let threshold = m - 1; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); @@ -638,12 +682,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + // Threshold is two, so any two ayes will pass the vote let threshold = 2; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -713,12 +763,18 @@ mod benchmarks { T::MaxMembers::get(), )?; + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + // Threshold is one less than total members so that two nays will disapprove the vote let threshold = m - 1; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -734,14 +790,175 @@ mod benchmarks { System::::set_block_number(BlockNumberFor::::max_value()); assert_eq!(Collective::::proposals().len(), p as usize); + let origin = + T::DisapproveOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + #[extrinsic_call] - _(SystemOrigin::Root, last_hash); + _(origin as ::RuntimeOrigin, last_hash); assert_eq!(Collective::::proposals().len(), (p - 1) as usize); assert_last_event::(Event::Disapproved { proposal_hash: last_hash }.into()); Ok(()) } + // d: `0` - if deposit is not present and `1` otherwise. + #[benchmark] + fn kill( + d: Linear<0, 1>, + p: Linear<1, { T::MaxProposals::get() }>, + ) -> Result<(), BenchmarkError> { + let m = 3; + let b = MAX_BYTES; + let bytes_in_storage = b + size_of::() as u32; + + // Construct `members`. + let mut members = vec![]; + for i in 0..m - 1 { + let member = account::("member", i, SEED); + members.push(member); + } + let caller = account::("caller", 0, SEED); + members.push(caller.clone()); + Collective::::set_members( + SystemOrigin::Root.into(), + members.clone(), + Some(caller.clone()), + T::MaxMembers::get(), + )?; + + // Threshold is one less than total members so that two nays will disapprove the vote + let threshold = m - 1; + + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + + // Add proposals + let mut last_hash = T::Hash::default(); + for i in 0..p { + // mint assets for the deposit. + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } + + // Proposals should be different so that different proposal hashes are generated + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + Collective::::propose( + SystemOrigin::Signed(caller.clone()).into(), + threshold, + Box::new(proposal.clone()), + bytes_in_storage, + )?; + last_hash = T::Hashing::hash_of(&proposal); + } + + System::::set_block_number(BlockNumberFor::::max_value()); + assert_eq!(Collective::::proposals().len(), p as usize); + + if d == 0 { + DepositOf::::remove(last_hash); + } + + let origin = + T::KillOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _(origin as ::RuntimeOrigin, last_hash); + + assert_eq!(Collective::::proposals().len(), (p - 1) as usize); + assert_last_event::(Event::Killed { proposal_hash: last_hash }.into()); + if d != 0 { + if let Some(deposit) = T::ProposalDeposit::get_deposit(p - 1) { + assert_has_event::( + Event::ProposalDepositSlashed { + proposal_hash: last_hash, + who: caller, + amount: deposit, + } + .into(), + ); + } + } + Ok(()) + } + + // d: `0` - if deposit is not present and `1` otherwise. + #[benchmark] + fn release_proposal_deposit(d: Linear<0, 1>) -> Result<(), BenchmarkError> { + let m = 3; + let p = T::MaxProposals::get(); + let b = MAX_BYTES; + let bytes_in_storage = b + size_of::() as u32; + + // Construct `members`. + let mut members = vec![]; + for i in 0..m - 1 { + let member = account::("member", i, SEED); + members.push(member); + } + let caller = account::("caller", 0, SEED); + members.push(caller.clone()); + Collective::::set_members( + SystemOrigin::Root.into(), + members.clone(), + Some(caller.clone()), + T::MaxMembers::get(), + )?; + + let ed = T::Currency::minimum_balance(); + T::Currency::mint_into(&caller, ed)?; + + // Add proposals + let threshold = 2; + let mut last_hash = T::Hash::default(); + for i in 0..p { + // mint assets for the deposit. + if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { + T::Currency::mint_into(&caller, deposit)?; + } + + // Proposals should be different so that different proposal hashes are generated + let proposal: T::Proposal = + SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); + Collective::::propose( + SystemOrigin::Signed(caller.clone()).into(), + threshold, + Box::new(proposal.clone()), + bytes_in_storage, + )?; + last_hash = T::Hashing::hash_of(&proposal); + } + + System::::set_block_number(BlockNumberFor::::max_value()); + assert_eq!(Collective::::proposals().len(), p as usize); + + if d == 0 { + DepositOf::::remove(last_hash); + } + + assert_eq!(Collective::::proposals().len(), p as usize); + let _ = Collective::::remove_proposal(last_hash); + assert_eq!(Collective::::proposals().len(), (p - 1) as usize); + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), last_hash); + + assert_eq!(DepositOf::::get(last_hash), None); + if d != 0 { + if let Some(deposit) = T::ProposalDeposit::get_deposit(p - 1) { + assert_last_event::( + Event::ProposalDepositReleased { + proposal_hash: last_hash, + who: caller, + amount: deposit, + } + .into(), + ); + } + } + Ok(()) + } + impl_benchmark_test_suite!( Collective, crate::tests::ExtBuilder::default().build(), diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 509952efd59a..07d3e9e41038 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -843,11 +843,11 @@ pub mod pallet { /// /// Emits `Killed` and `ProposalDepositSlashed` if a deposit was present. #[pallet::call_index(7)] - #[pallet::weight({1})] // TODO + #[pallet::weight(T::WeightInfo::kill(1, T::MaxProposals::get()))] pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { T::KillOrigin::ensure_origin(origin)?; - let proposal_count = Self::do_kill_proposal(proposal_hash)?; - Ok(Some(T::WeightInfo::disapprove_proposal(proposal_count)).into()) + let (slashed, proposal_count) = Self::do_kill_proposal(proposal_hash)?; + Ok(Some(T::WeightInfo::kill(slashed as u32, proposal_count)).into()) } /// Release the deposit of a completed proposal @@ -858,14 +858,14 @@ pub mod pallet { /// /// Emits `ProposalDepositReleased`. #[pallet::call_index(8)] - #[pallet::weight({1})] // TODO + #[pallet::weight(T::WeightInfo::release_proposal_deposit(1))] pub fn release_proposal_deposit( origin: OriginFor, proposal_hash: T::Hash, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { let _ = ensure_signed_or_root(origin)?; - let _ = Self::do_release_proposal_deposit(proposal_hash)?; - Ok(()) + let slashed = Self::do_release_proposal_deposit(proposal_hash)?; + Ok(Some(T::WeightInfo::release_proposal_deposit(slashed.is_some() as u32)).into()) } } } @@ -1178,8 +1178,8 @@ impl, I: 'static> Pallet { } /// Removes a proposal, slashes it's deposit if one exists and emits the `Killed` event. - fn do_kill_proposal(proposal_hash: T::Hash) -> Result { - if let Some((who, deposit)) = >::take(proposal_hash) { + fn do_kill_proposal(proposal_hash: T::Hash) -> Result<(bool, u32), DispatchError> { + let slashed = if let Some((who, deposit)) = >::take(proposal_hash) { let (credit, _) = T::Currency::slash(&HoldReason::ProposalSubmission.into(), &who, deposit); Self::deposit_event(Event::ProposalDepositSlashed { @@ -1188,9 +1188,12 @@ impl, I: 'static> Pallet { amount: credit.peek(), }); T::Slash::on_unbalanced(credit); - } + true + } else { + false + }; Self::deposit_event(Event::Killed { proposal_hash }); - Ok(Self::remove_proposal(proposal_hash)) + Ok((slashed, Self::remove_proposal(proposal_hash))) } // Removes a proposal from the pallet, cleaning up votes and the vector of proposals. diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index eece6a006b8f..d8f050ed93e7 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -15,32 +15,27 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for pallet_collective +//! Autogenerated weights for `pallet_collective` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-30, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-e8ezs4ez-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// ./target/production/substrate +// ./target/debug/substrate-node // benchmark // pallet // --chain=dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_collective -// --no-storage-info -// --no-median-slopes -// --no-min-squares +// --steps=10 +// --repeat=2 +// --pallet=pallet-collective // --extrinsic=* -// --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/collective/src/weights.rs -// --header=./HEADER-APACHE2 -// --template=./.maintain/frame-weight-template.hbs +// --output=./substrate/frame/collective/src/._weights8.rs +// --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,7 +45,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions needed for pallet_collective. +/// Weight functions needed for `pallet_collective`. pub trait WeightInfo { fn set_members(m: u32, n: u32, p: u32, ) -> Weight; fn execute(b: u32, m: u32, ) -> Weight; @@ -62,497 +57,629 @@ pub trait WeightInfo { fn close_disapproved(m: u32, p: u32, ) -> Weight; fn close_approved(b: u32, m: u32, p: u32, ) -> Weight; fn disapprove_proposal(p: u32, ) -> Weight; + fn kill(d: u32, p: u32, ) -> Weight; + fn release_proposal_deposit(d: u32, ) -> Weight; } -/// Weights for pallet_collective using the Substrate node and recommended hardware. +/// Weights for `pallet_collective` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: Council Members (r:1 w:1) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:0) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:100 w:100) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Prime (r:0 w:1) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:100 w:100) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:0 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[0, 100]`. /// The range of component `n` is `[0, 100]`. /// The range of component `p` is `[0, 100]`. fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15861 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 17_506_000 picoseconds. - Weight::from_parts(17_767_000, 15861) - // Standard Error: 60_220 - .saturating_add(Weight::from_parts(4_374_805, 0).saturating_mul(m.into())) - // Standard Error: 60_220 - .saturating_add(Weight::from_parts(8_398_316, 0).saturating_mul(p.into())) + // Estimated: `66924 + m * (1961 ±126) + p * (4067 ±126)` + // Minimum execution time: 99_000_000 picoseconds. + Weight::from_parts(99_000_000, 66924) + // Standard Error: 2_357_870 + .saturating_add(Weight::from_parts(10_265_324, 0).saturating_mul(m.into())) + // Standard Error: 2_357_870 + .saturating_add(Weight::from_parts(40_565_516, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1961).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4067).saturating_mul(p.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `202 + m * (32 ±0)` - // Estimated: `1688 + m * (32 ±0)` - // Minimum execution time: 16_203_000 picoseconds. - Weight::from_parts(15_348_267, 1688) - // Standard Error: 37 - .saturating_add(Weight::from_parts(1_766, 0).saturating_mul(b.into())) - // Standard Error: 382 - .saturating_add(Weight::from_parts(15_765, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 163_000_000 picoseconds. + Weight::from_parts(158_881_122, 3997) + // Standard Error: 5_451 + .saturating_add(Weight::from_parts(7_491, 0).saturating_mul(b.into())) + // Standard Error: 56_294 + .saturating_add(Weight::from_parts(91_685, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:0) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `202 + m * (32 ±0)` - // Estimated: `3668 + m * (32 ±0)` - // Minimum execution time: 18_642_000 picoseconds. - Weight::from_parts(17_708_609, 3668) - // Standard Error: 58 - .saturating_add(Weight::from_parts(2_285, 0).saturating_mul(b.into())) - // Standard Error: 598 - .saturating_add(Weight::from_parts(30_454, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 186_000_000 picoseconds. + Weight::from_parts(189_486_434, 3997) + // Standard Error: 18_661 + .saturating_add(Weight::from_parts(9_079, 0).saturating_mul(b.into())) + // Standard Error: 192_714 + .saturating_add(Weight::from_parts(33_120, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalCount (r:1 w:1) - /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:0 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Storage: `Council::ProposalCount` (r:1 w:1) + /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::DepositOf` (r:0 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `492 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3884 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 27_067_000 picoseconds. - Weight::from_parts(25_456_964, 3884) - // Standard Error: 112 - .saturating_add(Weight::from_parts(3_773, 0).saturating_mul(b.into())) - // Standard Error: 1_177 - .saturating_add(Weight::from_parts(32_783, 0).saturating_mul(m.into())) - // Standard Error: 1_162 - .saturating_add(Weight::from_parts(194_388, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `722 + m * (32 ±0) + p * (35 ±0)` + // Estimated: `3843 + m * (33 ±0) + p * (38 ±0)` + // Minimum execution time: 190_000_000 picoseconds. + Weight::from_parts(419_122_697, 3843) + // Standard Error: 86_312 + .saturating_add(Weight::from_parts(57_841, 0).saturating_mul(b.into())) + // Standard Error: 894_283 + .saturating_add(Weight::from_parts(145_057, 0).saturating_mul(m.into())) + // Standard Error: 891_364 + .saturating_add(Weight::from_parts(4_062_195, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `941 + m * (64 ±0)` - // Estimated: `4405 + m * (64 ±0)` - // Minimum execution time: 26_055_000 picoseconds. - Weight::from_parts(27_251_907, 4405) - // Standard Error: 1_008 - .saturating_add(Weight::from_parts(65_947, 0).saturating_mul(m.into())) + // Measured: `1006 + m * (64 ±0)` + // Estimated: `4471 + m * (64 ±0)` + // Minimum execution time: 165_000_000 picoseconds. + Weight::from_parts(184_530_196, 4471) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `530 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3975 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 28_363_000 picoseconds. - Weight::from_parts(28_733_464, 3975) - // Standard Error: 1_275 - .saturating_add(Weight::from_parts(43_236, 0).saturating_mul(m.into())) - // Standard Error: 1_244 - .saturating_add(Weight::from_parts(180_187, 0).saturating_mul(p.into())) + // Measured: `727 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `3991 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 213_000_000 picoseconds. + Weight::from_parts(220_578_262, 3991) + // Standard Error: 75_292 + .saturating_add(Weight::from_parts(2_074_620, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `832 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4149 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_391_000 picoseconds. - Weight::from_parts(42_695_215, 4149) - // Standard Error: 167 - .saturating_add(Weight::from_parts(3_622, 0).saturating_mul(b.into())) - // Standard Error: 1_772 - .saturating_add(Weight::from_parts(33_830, 0).saturating_mul(m.into())) - // Standard Error: 1_727 - .saturating_add(Weight::from_parts(205_374, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `1314 + m * (64 ±0) + p * (38 ±0)` + // Estimated: `4384 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 372_000_000 picoseconds. + Weight::from_parts(447_625_406, 4384) + // Standard Error: 153_614 + .saturating_add(Weight::from_parts(2_213_254, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Prime (r:1 w:0) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `550 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3995 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 31_368_000 picoseconds. - Weight::from_parts(32_141_835, 3995) - // Standard Error: 1_451 - .saturating_add(Weight::from_parts(36_372, 0).saturating_mul(m.into())) - // Standard Error: 1_415 - .saturating_add(Weight::from_parts(210_635, 0).saturating_mul(p.into())) + // Measured: `747 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4011 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 233_000_000 picoseconds. + Weight::from_parts(235_232_233, 4011) + // Standard Error: 46_269 + .saturating_add(Weight::from_parts(108_247, 0).saturating_mul(m.into())) + // Standard Error: 45_030 + .saturating_add(Weight::from_parts(2_181_637, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Prime (r:1 w:0) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `852 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4169 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 43_271_000 picoseconds. - Weight::from_parts(45_495_648, 4169) - // Standard Error: 174 - .saturating_add(Weight::from_parts(3_034, 0).saturating_mul(b.into())) - // Standard Error: 1_840 - .saturating_add(Weight::from_parts(42_209, 0).saturating_mul(m.into())) - // Standard Error: 1_793 - .saturating_add(Weight::from_parts(207_525, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `1334 + m * (64 ±0) + p * (38 ±0)` + // Estimated: `4404 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 388_000_000 picoseconds. + Weight::from_parts(404_080_477, 4404) + // Standard Error: 9_884 + .saturating_add(Weight::from_parts(16_649, 0).saturating_mul(b.into())) + // Standard Error: 104_869 + .saturating_add(Weight::from_parts(113_554, 0).saturating_mul(m.into())) + // Standard Error: 102_081 + .saturating_add(Weight::from_parts(1_967_541, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:0 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `359 + p * (32 ±0)` - // Estimated: `1844 + p * (32 ±0)` - // Minimum execution time: 15_170_000 picoseconds. - Weight::from_parts(17_567_243, 1844) - // Standard Error: 1_430 - .saturating_add(Weight::from_parts(169_040, 0).saturating_mul(p.into())) + // Measured: `424 + p * (32 ±0)` + // Estimated: `1898 + p * (32 ±0)` + // Minimum execution time: 122_000_000 picoseconds. + Weight::from_parts(123_587_878, 1898) + // Standard Error: 37_089 + .saturating_add(Weight::from_parts(1_912_121, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `d` is `[0, 1]`. + /// The range of component `p` is `[1, 100]`. + fn kill(d: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `628 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(12_681_542, 3833) + // Standard Error: 29_292_197 + .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) + // Standard Error: 396_965 + .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + } + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// The range of component `d` is `[0, 1]`. + fn release_proposal_deposit(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1748 + d * (212 ±0)` + // Estimated: `5213 + d * (212 ±0)` + // Minimum execution time: 121_000_000 picoseconds. + Weight::from_parts(124_000_000, 5213) + // Standard Error: 1_897_366 + .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + } } -// For backwards compatibility and tests +// For backwards compatibility and tests. impl WeightInfo for () { - /// Storage: Council Members (r:1 w:1) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:0) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:100 w:100) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Prime (r:0 w:1) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:100 w:100) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:0 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[0, 100]`. /// The range of component `n` is `[0, 100]`. /// The range of component `p` is `[0, 100]`. fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15861 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 17_506_000 picoseconds. - Weight::from_parts(17_767_000, 15861) - // Standard Error: 60_220 - .saturating_add(Weight::from_parts(4_374_805, 0).saturating_mul(m.into())) - // Standard Error: 60_220 - .saturating_add(Weight::from_parts(8_398_316, 0).saturating_mul(p.into())) + // Estimated: `66924 + m * (1961 ±126) + p * (4067 ±126)` + // Minimum execution time: 99_000_000 picoseconds. + Weight::from_parts(99_000_000, 66924) + // Standard Error: 2_357_870 + .saturating_add(Weight::from_parts(10_265_324, 0).saturating_mul(m.into())) + // Standard Error: 2_357_870 + .saturating_add(Weight::from_parts(40_565_516, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1961).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4067).saturating_mul(p.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `202 + m * (32 ±0)` - // Estimated: `1688 + m * (32 ±0)` - // Minimum execution time: 16_203_000 picoseconds. - Weight::from_parts(15_348_267, 1688) - // Standard Error: 37 - .saturating_add(Weight::from_parts(1_766, 0).saturating_mul(b.into())) - // Standard Error: 382 - .saturating_add(Weight::from_parts(15_765, 0).saturating_mul(m.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 163_000_000 picoseconds. + Weight::from_parts(158_881_122, 3997) + // Standard Error: 5_451 + .saturating_add(Weight::from_parts(7_491, 0).saturating_mul(b.into())) + // Standard Error: 56_294 + .saturating_add(Weight::from_parts(91_685, 0).saturating_mul(m.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:0) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `202 + m * (32 ±0)` - // Estimated: `3668 + m * (32 ±0)` - // Minimum execution time: 18_642_000 picoseconds. - Weight::from_parts(17_708_609, 3668) - // Standard Error: 58 - .saturating_add(Weight::from_parts(2_285, 0).saturating_mul(b.into())) - // Standard Error: 598 - .saturating_add(Weight::from_parts(30_454, 0).saturating_mul(m.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 186_000_000 picoseconds. + Weight::from_parts(189_486_434, 3997) + // Standard Error: 18_661 + .saturating_add(Weight::from_parts(9_079, 0).saturating_mul(b.into())) + // Standard Error: 192_714 + .saturating_add(Weight::from_parts(33_120, 0).saturating_mul(m.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalCount (r:1 w:1) - /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:0 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Storage: `Council::ProposalCount` (r:1 w:1) + /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::DepositOf` (r:0 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `492 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3884 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 27_067_000 picoseconds. - Weight::from_parts(25_456_964, 3884) - // Standard Error: 112 - .saturating_add(Weight::from_parts(3_773, 0).saturating_mul(b.into())) - // Standard Error: 1_177 - .saturating_add(Weight::from_parts(32_783, 0).saturating_mul(m.into())) - // Standard Error: 1_162 - .saturating_add(Weight::from_parts(194_388, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `722 + m * (32 ±0) + p * (35 ±0)` + // Estimated: `3843 + m * (33 ±0) + p * (38 ±0)` + // Minimum execution time: 190_000_000 picoseconds. + Weight::from_parts(419_122_697, 3843) + // Standard Error: 86_312 + .saturating_add(Weight::from_parts(57_841, 0).saturating_mul(b.into())) + // Standard Error: 894_283 + .saturating_add(Weight::from_parts(145_057, 0).saturating_mul(m.into())) + // Standard Error: 891_364 + .saturating_add(Weight::from_parts(4_062_195, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) } - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `941 + m * (64 ±0)` - // Estimated: `4405 + m * (64 ±0)` - // Minimum execution time: 26_055_000 picoseconds. - Weight::from_parts(27_251_907, 4405) - // Standard Error: 1_008 - .saturating_add(Weight::from_parts(65_947, 0).saturating_mul(m.into())) + // Measured: `1006 + m * (64 ±0)` + // Estimated: `4471 + m * (64 ±0)` + // Minimum execution time: 165_000_000 picoseconds. + Weight::from_parts(184_530_196, 4471) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `530 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3975 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 28_363_000 picoseconds. - Weight::from_parts(28_733_464, 3975) - // Standard Error: 1_275 - .saturating_add(Weight::from_parts(43_236, 0).saturating_mul(m.into())) - // Standard Error: 1_244 - .saturating_add(Weight::from_parts(180_187, 0).saturating_mul(p.into())) + // Measured: `727 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `3991 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 213_000_000 picoseconds. + Weight::from_parts(220_578_262, 3991) + // Standard Error: 75_292 + .saturating_add(Weight::from_parts(2_074_620, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `832 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4149 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_391_000 picoseconds. - Weight::from_parts(42_695_215, 4149) - // Standard Error: 167 - .saturating_add(Weight::from_parts(3_622, 0).saturating_mul(b.into())) - // Standard Error: 1_772 - .saturating_add(Weight::from_parts(33_830, 0).saturating_mul(m.into())) - // Standard Error: 1_727 - .saturating_add(Weight::from_parts(205_374, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Measured: `1314 + m * (64 ±0) + p * (38 ±0)` + // Estimated: `4384 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 372_000_000 picoseconds. + Weight::from_parts(447_625_406, 4384) + // Standard Error: 153_614 + .saturating_add(Weight::from_parts(2_213_254, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Prime (r:1 w:0) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `550 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3995 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 31_368_000 picoseconds. - Weight::from_parts(32_141_835, 3995) - // Standard Error: 1_451 - .saturating_add(Weight::from_parts(36_372, 0).saturating_mul(m.into())) - // Standard Error: 1_415 - .saturating_add(Weight::from_parts(210_635, 0).saturating_mul(p.into())) + // Measured: `747 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4011 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 233_000_000 picoseconds. + Weight::from_parts(235_232_233, 4011) + // Standard Error: 46_269 + .saturating_add(Weight::from_parts(108_247, 0).saturating_mul(m.into())) + // Standard Error: 45_030 + .saturating_add(Weight::from_parts(2_181_637, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } - /// Storage: Council Voting (r:1 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Members (r:1 w:0) - /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Prime (r:1 w:0) - /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:1 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `852 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4169 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 43_271_000 picoseconds. - Weight::from_parts(45_495_648, 4169) - // Standard Error: 174 - .saturating_add(Weight::from_parts(3_034, 0).saturating_mul(b.into())) - // Standard Error: 1_840 - .saturating_add(Weight::from_parts(42_209, 0).saturating_mul(m.into())) - // Standard Error: 1_793 - .saturating_add(Weight::from_parts(207_525, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(5_u64)) + // Measured: `1334 + m * (64 ±0) + p * (38 ±0)` + // Estimated: `4404 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 388_000_000 picoseconds. + Weight::from_parts(404_080_477, 4404) + // Standard Error: 9_884 + .saturating_add(Weight::from_parts(16_649, 0).saturating_mul(b.into())) + // Standard Error: 104_869 + .saturating_add(Weight::from_parts(113_554, 0).saturating_mul(m.into())) + // Standard Error: 102_081 + .saturating_add(Weight::from_parts(1_967_541, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } - /// Storage: Council Proposals (r:1 w:1) - /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Council Voting (r:0 w:1) - /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: Council ProposalOf (r:0 w:1) - /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `359 + p * (32 ±0)` - // Estimated: `1844 + p * (32 ±0)` - // Minimum execution time: 15_170_000 picoseconds. - Weight::from_parts(17_567_243, 1844) - // Standard Error: 1_430 - .saturating_add(Weight::from_parts(169_040, 0).saturating_mul(p.into())) + // Measured: `424 + p * (32 ±0)` + // Estimated: `1898 + p * (32 ±0)` + // Minimum execution time: 122_000_000 picoseconds. + Weight::from_parts(123_587_878, 1898) + // Standard Error: 37_089 + .saturating_add(Weight::from_parts(1_912_121, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `d` is `[0, 1]`. + /// The range of component `p` is `[1, 100]`. + fn kill(d: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `628 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(12_681_542, 3833) + // Standard Error: 29_292_197 + .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) + // Standard Error: 396_965 + .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + } + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::DepositOf` (r:1 w:1) + /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// The range of component `d` is `[0, 1]`. + fn release_proposal_deposit(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1748 + d * (212 ±0)` + // Estimated: `5213 + d * (212 ±0)` + // Minimum execution time: 121_000_000 picoseconds. + Weight::from_parts(124_000_000, 5213) + // Standard Error: 1_897_366 + .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + } } From cc9a9e3ce8b7149b7cce0a82a7b9451e3592464a Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 16:07:07 +0800 Subject: [PATCH 05/49] imports --- substrate/frame/collective/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 07d3e9e41038..31ad69c478c1 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -58,7 +58,7 @@ use frame_support::{ ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{ fungible, - fungible::{BalancedHold, MutateHold}, + fungible::{BalancedHold, Credit, MutateHold}, tokens::Precision, Backing, ChangeMembers, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, Imbalance, InitializeMembers, OnUnbalanced, StorageVersion, @@ -303,11 +303,8 @@ pub mod deposit { #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::{ - pallet_prelude::*, - traits::{fungible::Credit, OnUnbalanced}, - }; - use frame_system::pallet_prelude::{OriginFor, *}; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); From de84000c1e92e48c196f98605e133a858a769c68 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 16:08:39 +0800 Subject: [PATCH 06/49] tests --- substrate/frame/collective/src/lib.rs | 4 +- substrate/frame/collective/src/tests.rs | 97 +++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 8 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 31ad69c478c1..d4e37bb510ec 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -240,12 +240,12 @@ pub mod deposit { pub struct Geometric(PhantomData<(Ratio, Base)>); impl GetDeposit for Geometric where - Ratio: Get, + Ratio: Get, Base: Get, Balance: frame_support::traits::tokens::Balance, { fn get_deposit(proposal_count: u32) -> Option { - let m = Ratio::get().saturating_pow(proposal_count as usize); + let m: Balance = Ratio::get().saturating_pow(proposal_count).into(); Some(m.saturating_mul(Base::get())) } } diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index cf4faa3c88ed..a328104f09a0 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -21,7 +21,10 @@ use frame_support::{ assert_noop, assert_ok, derive_impl, dispatch::Pays, parameter_types, - traits::{ConstU32, ConstU64, StorageVersion}, + traits::{ + fungible::{Inspect, Mutate}, + ConstU32, ConstU64, StorageVersion, + }, Hashable, }; use frame_system::{EnsureRoot, EventRecord, Phase}; @@ -126,6 +129,14 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; } +parameter_types! { + pub ProposalDepositBase: u64 = Balances::minimum_balance() + Balances::minimum_balance(); + pub const ProposalDepositDelay: u32 = 2; +} + +type CollectiveDeposit = + deposit::Delayed>; + impl Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeHoldReason = RuntimeHoldReason; @@ -139,11 +150,14 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = (); + type ProposalDeposit = CollectiveDeposit; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; type Slash = (); } + +type CollectiveMajorityDeposit = deposit::Linear, ProposalDepositBase>; + impl Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeHoldReason = RuntimeHoldReason; @@ -157,7 +171,7 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = (); + type ProposalDeposit = CollectiveMajorityDeposit; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; type Slash = (); @@ -179,7 +193,7 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = (); + type ProposalDeposit = deposit::Geometric, ProposalDepositBase>; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; type Slash = (); @@ -604,16 +618,28 @@ fn close_with_no_prime_but_majority_works() { MaxMembers::get() )); + let deposit = >::get_deposit(0).unwrap(); + let ed = Balances::minimum_balance(); + let _ = Balances::mint_into(&1, ed + deposit); + System::reset_events(); + assert_ok!(CollectiveMajority::propose( RuntimeOrigin::signed(1), 5, Box::new(proposal.clone()), proposal_len )); + assert_eq!(Balances::balance(&1), ed); + assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(1), hash, 0, true)); assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(2), hash, 0, true)); assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(3), hash, 0, true)); + assert_noop!( + CollectiveMajority::release_proposal_deposit(RuntimeOrigin::signed(1), hash), + Error::::ProposalActive + ); + System::set_block_number(4); assert_ok!(CollectiveMajority::close( RuntimeOrigin::signed(4), @@ -623,6 +649,9 @@ fn close_with_no_prime_but_majority_works() { proposal_len )); + assert_ok!(CollectiveMajority::release_proposal_deposit(RuntimeOrigin::signed(1), hash)); + assert_eq!(Balances::balance(&1), ed + deposit); + assert_eq!( System::events(), vec![ @@ -664,7 +693,14 @@ fn close_with_no_prime_but_majority_works() { record(RuntimeEvent::CollectiveMajority(CollectiveEvent::Executed { proposal_hash: hash, result: Err(DispatchError::BadOrigin) - })) + })), + record(RuntimeEvent::CollectiveMajority( + CollectiveEvent::ProposalDepositReleased { + proposal_hash: hash, + who: 1, + amount: deposit, + } + )) ] ); }); @@ -811,9 +847,14 @@ fn propose_works() { #[test] fn limit_active_proposals() { ExtBuilder::default().build_and_execute(|| { + let ed = Balances::minimum_balance(); + assert_ok!(Balances::mint_into(&1, ed)); for i in 0..MaxProposals::get() { let proposal = make_proposal(i as u64); let proposal_len: u32 = proposal.using_encoded(|p| p.len() as u32); + if let Some(deposit) = >::get_deposit(0) { + assert_ok!(Balances::mint_into(&1, deposit)); + } assert_ok!(Collective::propose( RuntimeOrigin::signed(1), 3, @@ -1554,6 +1595,50 @@ fn migration_v4() { }); } +#[test] +fn kill_proposal_with_deposit() { + ExtBuilder::default().build_and_execute(|| { + let ed = Balances::minimum_balance(); + assert_ok!(Balances::mint_into(&1, ed)); + let mut last_deposit = None; + let mut last_hash = None; + for i in 0..=ProposalDepositDelay::get() { + let proposal = make_proposal(i as u64); + let proposal_len: u32 = proposal.using_encoded(|p| p.len() as u32); + last_hash = Some(BlakeTwo256::hash_of(&proposal)); + if let Some(deposit) = >::get_deposit(i) { + assert_ok!(Balances::mint_into(&1, deposit)); + last_deposit = Some(deposit); + } + assert_ok!(Collective::propose( + RuntimeOrigin::signed(1), + 3, + Box::new(proposal.clone()), + proposal_len + )); + } + let balance = Balances::total_balance(&1); + System::reset_events(); + + assert_ok!(Collective::kill(RuntimeOrigin::root(), last_hash.unwrap())); + assert_eq!(Balances::total_balance(&1), balance - last_deposit.unwrap()); + + assert_eq!( + System::events(), + vec![ + record(RuntimeEvent::Collective(CollectiveEvent::ProposalDepositSlashed { + proposal_hash: last_hash.unwrap(), + who: 1, + amount: last_deposit.unwrap(), + })), + record(RuntimeEvent::Collective(CollectiveEvent::Killed { + proposal_hash: last_hash.unwrap(), + })), + ] + ); + }) +} + #[test] fn deposit_types_with_linear_work() { type LinearWithSlop2 = crate::deposit::Linear, ConstU128<10>>; @@ -1594,7 +1679,7 @@ fn deposit_types_with_linear_work() { #[test] fn deposit_types_with_geometric_work() { - type WithRatio2Base10 = crate::deposit::Geometric, ConstU128<10>>; + type WithRatio2Base10 = crate::deposit::Geometric, ConstU128<10>>; assert_eq!(WithRatio2Base10::get_deposit(0), Some(10u128)); assert_eq!(WithRatio2Base10::get_deposit(1), Some(20u128)); assert_eq!(WithRatio2Base10::get_deposit(2), Some(40u128)); From a7753654d642c0ccdaa9b55d129663cb50359ec6 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 17:19:33 +0800 Subject: [PATCH 07/49] fix --- substrate/frame/collective/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index d4e37bb510ec..bc2d59af8ba7 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -1160,7 +1160,7 @@ impl, I: 'static> Pallet { ) -> Result>, DispatchError> { ensure!(ProposalOf::::get(&proposal_hash).is_none(), Error::::ProposalActive); if let Some((who, deposit)) = >::take(proposal_hash) { - T::Currency::release( + return T::Currency::release( &HoldReason::ProposalSubmission.into(), &who, deposit, @@ -1169,7 +1169,7 @@ impl, I: 'static> Pallet { .map(|amount| { Self::deposit_event(Event::ProposalDepositReleased { proposal_hash, who, amount }); Some(amount) - })?; + }); } Ok(None) } From 311eb49e63f4f6b85af7c6e5cdd43748ac6b45cf Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 17:23:59 +0800 Subject: [PATCH 08/49] prdoc --- prdoc/pr_3151.prdoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 prdoc/pr_3151.prdoc diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc new file mode 100644 index 000000000000..50eeb48a898e --- /dev/null +++ b/prdoc/pr_3151.prdoc @@ -0,0 +1,19 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Dynamic deposit based on number proposals + +doc: + - audience: Runtime User + description: | + Introduce a dynamic proposal deposit mechanism influenced by the total number of active proposals, with the option to set the deposit to none. + + This is achieved through the introduction of the `GetDeposit` trait, and the corresponding implementation should be supplied to the pallet's configuration. The pallet provides basic implementations for this trait. + Two new calls are introduced: + - kill(origin, proposal_hash): the cancellation of a proposal, accompanied by the slashing of the associated deposit. + - release_proposal_deposit(origin, proposal_hash): the release of the deposit for a non-active proposal. + Additionally, benchmarks have been upgraded to benchmarks::v2. + +crates: + - name: pallet-collective + From 510003688d52b01b05260cdf95b225beca9dc662 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 17:25:21 +0800 Subject: [PATCH 09/49] fix prdoc title --- prdoc/pr_3151.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 50eeb48a898e..7db6f71cd8f6 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -1,7 +1,7 @@ # Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 # See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json -title: Dynamic deposit based on number proposals +title: Dynamic deposit based on number of proposals doc: - audience: Runtime User From b8b927a9b85f2f22efa6627ce5e72cbaef0b3582 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 17:33:00 +0800 Subject: [PATCH 10/49] fix pallet alliance --- substrate/frame/alliance/src/mock.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/substrate/frame/alliance/src/mock.rs b/substrate/frame/alliance/src/mock.rs index 3d44374c3eb3..e5ce7c7bab04 100644 --- a/substrate/frame/alliance/src/mock.rs +++ b/substrate/frame/alliance/src/mock.rs @@ -20,8 +20,8 @@ pub use sp_core::H256; use sp_runtime::traits::Hash; pub use sp_runtime::{ - traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, Verify}, - BuildStorage, MultiSignature, + traits::{BlakeTwo256, IdentifyAccount, Lazy, Verify}, + BuildStorage, }; use sp_std::convert::{TryFrom, TryInto}; @@ -70,9 +70,9 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type FreezeIdentifier = (); type MaxFreezes = (); - type RuntimeHoldReason = (); + type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = (); - type MaxHolds = (); + type MaxHolds = ConstU32<1>; } const MOTION_DURATION_IN_BLOCKS: BlockNumber = 3; @@ -86,6 +86,8 @@ parameter_types! { type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Test { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = MotionDuration; @@ -95,6 +97,10 @@ impl pallet_collective::Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = (); + type Slash = (); } parameter_types! { From bb704fa560a4621f9ff2370ad20439ad07ee0557 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 17:54:07 +0800 Subject: [PATCH 11/49] docify examples --- Cargo.lock | 1 + substrate/frame/collective/Cargo.toml | 1 + substrate/frame/collective/src/lib.rs | 10 ++++++++-- substrate/frame/collective/src/tests.rs | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22a81a6eca7f..ba949560cc37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9484,6 +9484,7 @@ dependencies = [ name = "pallet-collective" version = "28.0.0" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", diff --git a/substrate/frame/collective/Cargo.toml b/substrate/frame/collective/Cargo.toml index 628dddee5b35..918d4b296503 100644 --- a/substrate/frame/collective/Cargo.toml +++ b/substrate/frame/collective/Cargo.toml @@ -17,6 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } +docify = "0.2.7" log = { version = "0.4.17", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true } diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index bc2d59af8ba7..447d27285eaa 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -195,8 +195,14 @@ impl GetDeposit for () { } /// Types implementing [`GetDeposit`] trait. -/// Look for use examples to [`crate::tests::deposit_types_with_linear_work`], -/// [`crate::tests::deposit_types_with_geometric_work`] and [`crate::tests::constant_deposit_work`]. +/// +/// ### Example: +/// +/// 1. Linear increasing with helper types. +#[doc = docify::embed!("src/tests.rs", deposit_types_with_linear_work)] +/// +/// 2. Geometrically increasing with helper types. +#[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] pub mod deposit { use super::GetDeposit; use sp_core::Get; diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index a328104f09a0..39c16a79094a 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -1639,6 +1639,7 @@ fn kill_proposal_with_deposit() { }) } +#[docify::export] #[test] fn deposit_types_with_linear_work() { type LinearWithSlop2 = crate::deposit::Linear, ConstU128<10>>; @@ -1677,6 +1678,7 @@ fn deposit_types_with_linear_work() { assert_eq!(WithCeil13::get_deposit(13), Some(13u128)); } +#[docify::export] #[test] fn deposit_types_with_geometric_work() { type WithRatio2Base10 = crate::deposit::Geometric, ConstU128<10>>; From feb84e62219aac6d4b8cfadb7a8731823f76b68a Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 18:07:17 +0800 Subject: [PATCH 12/49] fix pallet utility --- substrate/frame/utility/src/tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index 1a1196cb4c06..f93b7ebbe8bb 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -30,6 +30,7 @@ use frame_support::{ traits::{ConstU32, ConstU64, Contains}, weights::Weight, }; +use frame_system::EnsureRoot; use pallet_collective::{EnsureProportionAtLeast, Instance1}; use sp_core::H256; use sp_runtime::{ @@ -183,7 +184,7 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type FreezeIdentifier = (); type MaxFreezes = (); - type RuntimeHoldReason = (); + type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = (); } @@ -212,6 +213,8 @@ parameter_types! { type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Test { type RuntimeOrigin = RuntimeOrigin; + type RuntimeHoldReason = RuntimeHoldReason; + type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = MotionDuration; @@ -221,6 +224,10 @@ impl pallet_collective::Config for Test { type WeightInfo = (); type SetMembersOrigin = frame_system::EnsureRoot; type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type ProposalDeposit = (); + type Slash = (); } impl example::Config for Test {} From f0768670af77f2febed7d071e14dcebfce22518f Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jan 2024 18:10:43 +0800 Subject: [PATCH 13/49] fmt --- substrate/frame/collective/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 447d27285eaa..fadb50ee2dfd 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -195,7 +195,7 @@ impl GetDeposit for () { } /// Types implementing [`GetDeposit`] trait. -/// +/// /// ### Example: /// /// 1. Linear increasing with helper types. From f7072fec45d3223a398a76e0f91f49eea2f462a9 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 1 Feb 2024 13:58:29 +0800 Subject: [PATCH 14/49] geometric and round types --- substrate/frame/collective/src/lib.rs | 44 ++++++++++++++++++++++--- substrate/frame/collective/src/tests.rs | 41 ++++++++++++++++++++--- 2 files changed, 75 insertions(+), 10 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index fadb50ee2dfd..e07c6f7f0efc 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -203,9 +203,13 @@ impl GetDeposit for () { /// /// 2. Geometrically increasing with helper types. #[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] +/// +/// 3. Geometrically increasing with rounding. +#[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] pub mod deposit { use super::GetDeposit; use sp_core::Get; + use sp_runtime::{FixedPointNumber, FixedU128, Saturating}; use sp_std::marker::PhantomData; /// Constant deposit amount regardless of current proposal count. @@ -246,13 +250,39 @@ pub mod deposit { pub struct Geometric(PhantomData<(Ratio, Base)>); impl GetDeposit for Geometric where - Ratio: Get, + Ratio: Get, Base: Get, Balance: frame_support::traits::tokens::Balance, { fn get_deposit(proposal_count: u32) -> Option { - let m: Balance = Ratio::get().saturating_pow(proposal_count).into(); - Some(m.saturating_mul(Base::get())) + let deposit = Ratio::get() + .saturating_pow(proposal_count as usize) + .saturating_mul_int(Base::get()); + if deposit > Balance::zero() { + Some(deposit) + } else { + None + } + } + } + + /// Rounds a `Deposit` result with `Precision`. + /// Particularly useful for types like [`Geometric`] that might produce deposits with high + /// precision. + pub struct Round(PhantomData<(Precision, Deposit)>); + impl GetDeposit for Round + where + Precision: Get, + Deposit: GetDeposit, + Balance: frame_support::traits::tokens::Balance, + { + fn get_deposit(proposal_count: u32) -> Option { + if let Some(deposit) = Deposit::get_deposit(proposal_count) { + let factor: Balance = 10u32.pow(Precision::get()).into(); + Some((deposit / factor) * factor) + } else { + None + } } } @@ -292,13 +322,13 @@ pub mod deposit { pub struct WithCeil(PhantomData<(Ceil, Deposit)>); impl GetDeposit for WithCeil where - Ceil: Get, + Ceil: Get, Deposit: GetDeposit, Balance: frame_support::traits::tokens::Balance, { fn get_deposit(proposal_count: u32) -> Option { if let Some(deposit) = Deposit::get_deposit(proposal_count) { - Some(deposit.min(Ceil::get().into())) + Some(deposit.min(Ceil::get())) } else { None } @@ -372,6 +402,10 @@ pub mod pallet { /// Mechanism to assess the necessity and amount of the deposit required for publishing and /// storing a proposal. + /// + /// Note: If resulting deposits are excessively high and cause benchmark failures, consider + /// supplying the [`crate::deposit::Constant`] type with a deposit equal to the minimum + /// balance. type ProposalDeposit: GetDeposit>; /// Handler for a slashed funds. diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 39c16a79094a..f1050a050007 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -32,7 +32,7 @@ use sp_core::{ConstU128, H256}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, + BuildStorage, FixedU128, }; pub type Block = sp_runtime::generic::Block; @@ -180,6 +180,10 @@ impl mock_democracy::Config for Test { type RuntimeEvent = RuntimeEvent; type ExternalMajorityOrigin = EnsureProportionAtLeast; } +parameter_types! { + pub const Ratio2: FixedU128 = FixedU128::from_u32(2); + pub ProposalDepositCeil: u64 = Balances::minimum_balance() * 100; +} impl Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeHoldReason = RuntimeHoldReason; @@ -193,7 +197,8 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = deposit::Geometric, ProposalDepositBase>; + type ProposalDeposit = + deposit::WithCeil>; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; type Slash = (); @@ -1669,7 +1674,7 @@ fn deposit_types_with_linear_work() { assert_eq!(DelayedWithDelay4::get_deposit(10), Some(14u128)); assert_eq!(DelayedWithDelay4::get_deposit(13), Some(16u128)); - type WithCeil13 = crate::deposit::WithCeil, DelayedWithDelay4>; + type WithCeil13 = crate::deposit::WithCeil, DelayedWithDelay4>; assert_eq!(WithCeil13::get_deposit(0), None::); assert_eq!(WithCeil13::get_deposit(4), Some(10u128)); assert_eq!(WithCeil13::get_deposit(9), Some(12u128)); @@ -1681,7 +1686,10 @@ fn deposit_types_with_linear_work() { #[docify::export] #[test] fn deposit_types_with_geometric_work() { - type WithRatio2Base10 = crate::deposit::Geometric, ConstU128<10>>; + parameter_types! { + pub const Ratio2: FixedU128 = FixedU128::from_u32(2); + } + type WithRatio2Base10 = crate::deposit::Geometric>; assert_eq!(WithRatio2Base10::get_deposit(0), Some(10u128)); assert_eq!(WithRatio2Base10::get_deposit(1), Some(20u128)); assert_eq!(WithRatio2Base10::get_deposit(2), Some(40u128)); @@ -1713,7 +1721,7 @@ fn deposit_types_with_geometric_work() { assert_eq!(DelayedWithDelay4::get_deposit(10), Some(40u128)); assert_eq!(DelayedWithDelay4::get_deposit(13), Some(80u128)); - type WithCeil21 = crate::deposit::WithCeil, DelayedWithDelay4>; + type WithCeil21 = crate::deposit::WithCeil, DelayedWithDelay4>; assert_eq!(WithCeil21::get_deposit(0), None::); assert_eq!(WithCeil21::get_deposit(4), Some(10u128)); assert_eq!(WithCeil21::get_deposit(9), Some(20u128)); @@ -1722,6 +1730,29 @@ fn deposit_types_with_geometric_work() { assert_eq!(WithCeil21::get_deposit(13), Some(21u128)); } +#[docify::export] +#[test] +fn deposit_round_with_geometric_work() { + parameter_types! { + pub const Ratio1_5: FixedU128 = FixedU128::from_rational(3, 2); + } + type WithRatio1_5Base10 = crate::deposit::Geometric>; + assert_eq!(WithRatio1_5Base10::get_deposit(0), Some(10000u128)); + assert_eq!(WithRatio1_5Base10::get_deposit(1), Some(15000u128)); + assert_eq!(WithRatio1_5Base10::get_deposit(2), Some(22500u128)); + assert_eq!(WithRatio1_5Base10::get_deposit(3), Some(33750u128)); + assert_eq!(WithRatio1_5Base10::get_deposit(4), Some(50625u128)); + assert_eq!(WithRatio1_5Base10::get_deposit(5), Some(75937u128)); + + type RoundWithPrecision3 = crate::deposit::Round, WithRatio1_5Base10>; + assert_eq!(RoundWithPrecision3::get_deposit(0), Some(10000u128)); + assert_eq!(RoundWithPrecision3::get_deposit(1), Some(15000u128)); + assert_eq!(RoundWithPrecision3::get_deposit(2), Some(22000u128)); + assert_eq!(RoundWithPrecision3::get_deposit(3), Some(33000u128)); + assert_eq!(RoundWithPrecision3::get_deposit(4), Some(50000u128)); + assert_eq!(RoundWithPrecision3::get_deposit(5), Some(75000u128)); +} + #[test] fn constant_deposit_work() { type Constant0 = crate::deposit::Constant>; From 737b4ceeccc3515a1088e644737e137815b2e2ce Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 1 Feb 2024 14:00:44 +0800 Subject: [PATCH 15/49] doc fix --- substrate/frame/collective/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index e07c6f7f0efc..4e9fbdcb5986 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -405,7 +405,7 @@ pub mod pallet { /// /// Note: If resulting deposits are excessively high and cause benchmark failures, consider /// supplying the [`crate::deposit::Constant`] type with a deposit equal to the minimum - /// balance. + /// balance under `runtime-benchmarks` feature. type ProposalDeposit: GetDeposit>; /// Handler for a slashed funds. From 0dd1d70f70efd2b5ac108d9128aa1e4a5876e8d6 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Tue, 6 Feb 2024 09:02:05 +0000 Subject: [PATCH 16/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 422 +++++++++++----------- 1 file changed, 220 insertions(+), 202 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index d8f050ed93e7..01491cf9ab7d 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,23 +18,25 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-01-30, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `cob`, CPU: `` +//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// ./target/debug/substrate-node +// target/production/substrate-node // benchmark // pallet -// --chain=dev -// --steps=10 -// --repeat=2 -// --pallet=pallet-collective +// --steps=50 +// --repeat=20 // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./substrate/frame/collective/src/._weights8.rs +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_collective +// --chain=dev +// --header=./substrate/HEADER-APACHE2 +// --output=./substrate/frame/collective/src/weights.rs // --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -78,19 +80,19 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `66924 + m * (1961 ±126) + p * (4067 ±126)` - // Minimum execution time: 99_000_000 picoseconds. - Weight::from_parts(99_000_000, 66924) - // Standard Error: 2_357_870 - .saturating_add(Weight::from_parts(10_265_324, 0).saturating_mul(m.into())) - // Standard Error: 2_357_870 - .saturating_add(Weight::from_parts(40_565_516, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 15_742_000 picoseconds. + Weight::from_parts(16_163_000, 15894) + // Standard Error: 58_009 + .saturating_add(Weight::from_parts(4_366_186, 0).saturating_mul(m.into())) + // Standard Error: 58_009 + .saturating_add(Weight::from_parts(7_778_194, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1961).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4067).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -104,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 163_000_000 picoseconds. - Weight::from_parts(158_881_122, 3997) - // Standard Error: 5_451 - .saturating_add(Weight::from_parts(7_491, 0).saturating_mul(b.into())) - // Standard Error: 56_294 - .saturating_add(Weight::from_parts(91_685, 0).saturating_mul(m.into())) + // Minimum execution time: 18_720_000 picoseconds. + Weight::from_parts(17_564_317, 3997) + // Standard Error: 52 + .saturating_add(Weight::from_parts(2_169, 0).saturating_mul(b.into())) + // Standard Error: 538 + .saturating_add(Weight::from_parts(20_399, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -127,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 186_000_000 picoseconds. - Weight::from_parts(189_486_434, 3997) - // Standard Error: 18_661 - .saturating_add(Weight::from_parts(9_079, 0).saturating_mul(b.into())) - // Standard Error: 192_714 - .saturating_add(Weight::from_parts(33_120, 0).saturating_mul(m.into())) + // Minimum execution time: 20_485_000 picoseconds. + Weight::from_parts(19_933_253, 3997) + // Standard Error: 52 + .saturating_add(Weight::from_parts(1_667, 0).saturating_mul(b.into())) + // Standard Error: 539 + .saturating_add(Weight::from_parts(30_461, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -143,7 +145,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::DepositOf` (r:0 w:1) @@ -155,20 +157,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `722 + m * (32 ±0) + p * (35 ±0)` - // Estimated: `3843 + m * (33 ±0) + p * (38 ±0)` - // Minimum execution time: 190_000_000 picoseconds. - Weight::from_parts(419_122_697, 3843) - // Standard Error: 86_312 - .saturating_add(Weight::from_parts(57_841, 0).saturating_mul(b.into())) - // Standard Error: 894_283 - .saturating_add(Weight::from_parts(145_057, 0).saturating_mul(m.into())) - // Standard Error: 891_364 - .saturating_add(Weight::from_parts(4_062_195, 0).saturating_mul(p.into())) + // Measured: `614 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 21_317_000 picoseconds. + Weight::from_parts(50_474_699, 3988) + // Standard Error: 381 + .saturating_add(Weight::from_parts(4_630, 0).saturating_mul(b.into())) + // Standard Error: 3_980 + .saturating_add(Weight::from_parts(38_892, 0).saturating_mul(m.into())) + // Standard Error: 3_929 + .saturating_add(Weight::from_parts(212_333, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -177,10 +179,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1006 + m * (64 ±0)` + // Measured: `1007 + m * (64 ±0)` // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 165_000_000 picoseconds. - Weight::from_parts(184_530_196, 4471) + // Minimum execution time: 22_591_000 picoseconds. + Weight::from_parts(23_608_081, 4471) + // Standard Error: 1_013 + .saturating_add(Weight::from_parts(60_257, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -197,16 +201,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `727 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `3991 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 213_000_000 picoseconds. - Weight::from_parts(220_578_262, 3991) - // Standard Error: 75_292 - .saturating_add(Weight::from_parts(2_074_620, 0).saturating_mul(p.into())) + // Measured: `596 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 23_865_000 picoseconds. + Weight::from_parts(25_005_361, 4038) + // Standard Error: 1_306 + .saturating_add(Weight::from_parts(41_486, 0).saturating_mul(m.into())) + // Standard Error: 1_273 + .saturating_add(Weight::from_parts(163_408, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -225,16 +231,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1314 + m * (64 ±0) + p * (38 ±0)` - // Estimated: `4384 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 372_000_000 picoseconds. - Weight::from_parts(447_625_406, 4384) - // Standard Error: 153_614 - .saturating_add(Weight::from_parts(2_213_254, 0).saturating_mul(p.into())) + // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_731_000 picoseconds. + Weight::from_parts(42_195_946, 4357) + // Standard Error: 172 + .saturating_add(Weight::from_parts(3_835, 0).saturating_mul(b.into())) + // Standard Error: 1_825 + .saturating_add(Weight::from_parts(33_253, 0).saturating_mul(m.into())) + // Standard Error: 1_779 + .saturating_add(Weight::from_parts(192_978, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -251,18 +261,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `747 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4011 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 233_000_000 picoseconds. - Weight::from_parts(235_232_233, 4011) - // Standard Error: 46_269 - .saturating_add(Weight::from_parts(108_247, 0).saturating_mul(m.into())) - // Standard Error: 45_030 - .saturating_add(Weight::from_parts(2_181_637, 0).saturating_mul(p.into())) + // Measured: `616 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 26_090_000 picoseconds. + Weight::from_parts(27_899_555, 4058) + // Standard Error: 1_579 + .saturating_add(Weight::from_parts(51_359, 0).saturating_mul(m.into())) + // Standard Error: 1_539 + .saturating_add(Weight::from_parts(173_123, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -283,20 +293,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1334 + m * (64 ±0) + p * (38 ±0)` - // Estimated: `4404 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 388_000_000 picoseconds. - Weight::from_parts(404_080_477, 4404) - // Standard Error: 9_884 - .saturating_add(Weight::from_parts(16_649, 0).saturating_mul(b.into())) - // Standard Error: 104_869 - .saturating_add(Weight::from_parts(113_554, 0).saturating_mul(m.into())) - // Standard Error: 102_081 - .saturating_add(Weight::from_parts(1_967_541, 0).saturating_mul(p.into())) + // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 43_232_000 picoseconds. + Weight::from_parts(44_893_012, 4377) + // Standard Error: 170 + .saturating_add(Weight::from_parts(3_193, 0).saturating_mul(b.into())) + // Standard Error: 1_802 + .saturating_add(Weight::from_parts(34_546, 0).saturating_mul(m.into())) + // Standard Error: 1_757 + .saturating_add(Weight::from_parts(195_533, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -308,12 +318,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `424 + p * (32 ±0)` - // Estimated: `1898 + p * (32 ±0)` - // Minimum execution time: 122_000_000 picoseconds. - Weight::from_parts(123_587_878, 1898) - // Standard Error: 37_089 - .saturating_add(Weight::from_parts(1_912_121, 0).saturating_mul(p.into())) + // Measured: `425 + p * (32 ±0)` + // Estimated: `1907 + p * (32 ±0)` + // Minimum execution time: 12_533_000 picoseconds. + Weight::from_parts(14_751_614, 1907) + // Standard Error: 1_693 + .saturating_add(Weight::from_parts(155_676, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -321,7 +331,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Council::DepositOf` (r:1 w:1) /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) @@ -334,20 +344,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `628 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` - // Minimum execution time: 141_000_000 picoseconds. - Weight::from_parts(12_681_542, 3833) - // Standard Error: 29_292_197 - .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) - // Standard Error: 396_965 - .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `609 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3980 + d * (1883 ±0) + p * (38 ±0)` + // Minimum execution time: 14_131_000 picoseconds. + Weight::from_parts(10_618_117, 3980) + // Standard Error: 278_381 + .saturating_add(Weight::from_parts(28_536_684, 0).saturating_mul(d.into())) + // Standard Error: 4_311 + .saturating_add(Weight::from_parts(231_309, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -356,20 +366,20 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. fn release_proposal_deposit(d: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` - // Estimated: `5213 + d * (212 ±0)` - // Minimum execution time: 121_000_000 picoseconds. - Weight::from_parts(124_000_000, 5213) - // Standard Error: 1_897_366 - .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) + // Estimated: `5213 + d * (1883 ±0)` + // Minimum execution time: 16_221_000 picoseconds. + Weight::from_parts(17_178_708, 5213) + // Standard Error: 49_254 + .saturating_add(Weight::from_parts(38_468_291, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) } } @@ -389,19 +399,19 @@ impl WeightInfo for () { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `66924 + m * (1961 ±126) + p * (4067 ±126)` - // Minimum execution time: 99_000_000 picoseconds. - Weight::from_parts(99_000_000, 66924) - // Standard Error: 2_357_870 - .saturating_add(Weight::from_parts(10_265_324, 0).saturating_mul(m.into())) - // Standard Error: 2_357_870 - .saturating_add(Weight::from_parts(40_565_516, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 15_742_000 picoseconds. + Weight::from_parts(16_163_000, 15894) + // Standard Error: 58_009 + .saturating_add(Weight::from_parts(4_366_186, 0).saturating_mul(m.into())) + // Standard Error: 58_009 + .saturating_add(Weight::from_parts(7_778_194, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1961).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4067).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -415,12 +425,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 163_000_000 picoseconds. - Weight::from_parts(158_881_122, 3997) - // Standard Error: 5_451 - .saturating_add(Weight::from_parts(7_491, 0).saturating_mul(b.into())) - // Standard Error: 56_294 - .saturating_add(Weight::from_parts(91_685, 0).saturating_mul(m.into())) + // Minimum execution time: 18_720_000 picoseconds. + Weight::from_parts(17_564_317, 3997) + // Standard Error: 52 + .saturating_add(Weight::from_parts(2_169, 0).saturating_mul(b.into())) + // Standard Error: 538 + .saturating_add(Weight::from_parts(20_399, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -438,12 +448,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 186_000_000 picoseconds. - Weight::from_parts(189_486_434, 3997) - // Standard Error: 18_661 - .saturating_add(Weight::from_parts(9_079, 0).saturating_mul(b.into())) - // Standard Error: 192_714 - .saturating_add(Weight::from_parts(33_120, 0).saturating_mul(m.into())) + // Minimum execution time: 20_485_000 picoseconds. + Weight::from_parts(19_933_253, 3997) + // Standard Error: 52 + .saturating_add(Weight::from_parts(1_667, 0).saturating_mul(b.into())) + // Standard Error: 539 + .saturating_add(Weight::from_parts(30_461, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -454,7 +464,7 @@ impl WeightInfo for () { /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::DepositOf` (r:0 w:1) @@ -466,20 +476,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `722 + m * (32 ±0) + p * (35 ±0)` - // Estimated: `3843 + m * (33 ±0) + p * (38 ±0)` - // Minimum execution time: 190_000_000 picoseconds. - Weight::from_parts(419_122_697, 3843) - // Standard Error: 86_312 - .saturating_add(Weight::from_parts(57_841, 0).saturating_mul(b.into())) - // Standard Error: 894_283 - .saturating_add(Weight::from_parts(145_057, 0).saturating_mul(m.into())) - // Standard Error: 891_364 - .saturating_add(Weight::from_parts(4_062_195, 0).saturating_mul(p.into())) + // Measured: `614 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 21_317_000 picoseconds. + Weight::from_parts(50_474_699, 3988) + // Standard Error: 381 + .saturating_add(Weight::from_parts(4_630, 0).saturating_mul(b.into())) + // Standard Error: 3_980 + .saturating_add(Weight::from_parts(38_892, 0).saturating_mul(m.into())) + // Standard Error: 3_929 + .saturating_add(Weight::from_parts(212_333, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -488,10 +498,12 @@ impl WeightInfo for () { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1006 + m * (64 ±0)` + // Measured: `1007 + m * (64 ±0)` // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 165_000_000 picoseconds. - Weight::from_parts(184_530_196, 4471) + // Minimum execution time: 22_591_000 picoseconds. + Weight::from_parts(23_608_081, 4471) + // Standard Error: 1_013 + .saturating_add(Weight::from_parts(60_257, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -508,16 +520,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `727 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `3991 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 213_000_000 picoseconds. - Weight::from_parts(220_578_262, 3991) - // Standard Error: 75_292 - .saturating_add(Weight::from_parts(2_074_620, 0).saturating_mul(p.into())) + // Measured: `596 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 23_865_000 picoseconds. + Weight::from_parts(25_005_361, 4038) + // Standard Error: 1_306 + .saturating_add(Weight::from_parts(41_486, 0).saturating_mul(m.into())) + // Standard Error: 1_273 + .saturating_add(Weight::from_parts(163_408, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -536,16 +550,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1314 + m * (64 ±0) + p * (38 ±0)` - // Estimated: `4384 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 372_000_000 picoseconds. - Weight::from_parts(447_625_406, 4384) - // Standard Error: 153_614 - .saturating_add(Weight::from_parts(2_213_254, 0).saturating_mul(p.into())) + // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_731_000 picoseconds. + Weight::from_parts(42_195_946, 4357) + // Standard Error: 172 + .saturating_add(Weight::from_parts(3_835, 0).saturating_mul(b.into())) + // Standard Error: 1_825 + .saturating_add(Weight::from_parts(33_253, 0).saturating_mul(m.into())) + // Standard Error: 1_779 + .saturating_add(Weight::from_parts(192_978, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -562,18 +580,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `747 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4011 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 233_000_000 picoseconds. - Weight::from_parts(235_232_233, 4011) - // Standard Error: 46_269 - .saturating_add(Weight::from_parts(108_247, 0).saturating_mul(m.into())) - // Standard Error: 45_030 - .saturating_add(Weight::from_parts(2_181_637, 0).saturating_mul(p.into())) + // Measured: `616 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 26_090_000 picoseconds. + Weight::from_parts(27_899_555, 4058) + // Standard Error: 1_579 + .saturating_add(Weight::from_parts(51_359, 0).saturating_mul(m.into())) + // Standard Error: 1_539 + .saturating_add(Weight::from_parts(173_123, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -594,20 +612,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1334 + m * (64 ±0) + p * (38 ±0)` - // Estimated: `4404 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 388_000_000 picoseconds. - Weight::from_parts(404_080_477, 4404) - // Standard Error: 9_884 - .saturating_add(Weight::from_parts(16_649, 0).saturating_mul(b.into())) - // Standard Error: 104_869 - .saturating_add(Weight::from_parts(113_554, 0).saturating_mul(m.into())) - // Standard Error: 102_081 - .saturating_add(Weight::from_parts(1_967_541, 0).saturating_mul(p.into())) + // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 43_232_000 picoseconds. + Weight::from_parts(44_893_012, 4377) + // Standard Error: 170 + .saturating_add(Weight::from_parts(3_193, 0).saturating_mul(b.into())) + // Standard Error: 1_802 + .saturating_add(Weight::from_parts(34_546, 0).saturating_mul(m.into())) + // Standard Error: 1_757 + .saturating_add(Weight::from_parts(195_533, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -619,12 +637,12 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `424 + p * (32 ±0)` - // Estimated: `1898 + p * (32 ±0)` - // Minimum execution time: 122_000_000 picoseconds. - Weight::from_parts(123_587_878, 1898) - // Standard Error: 37_089 - .saturating_add(Weight::from_parts(1_912_121, 0).saturating_mul(p.into())) + // Measured: `425 + p * (32 ±0)` + // Estimated: `1907 + p * (32 ±0)` + // Minimum execution time: 12_533_000 picoseconds. + Weight::from_parts(14_751_614, 1907) + // Standard Error: 1_693 + .saturating_add(Weight::from_parts(155_676, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -632,7 +650,7 @@ impl WeightInfo for () { /// Storage: `Council::DepositOf` (r:1 w:1) /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) @@ -645,20 +663,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `628 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` - // Minimum execution time: 141_000_000 picoseconds. - Weight::from_parts(12_681_542, 3833) - // Standard Error: 29_292_197 - .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) - // Standard Error: 396_965 - .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `609 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3980 + d * (1883 ±0) + p * (38 ±0)` + // Minimum execution time: 14_131_000 picoseconds. + Weight::from_parts(10_618_117, 3980) + // Standard Error: 278_381 + .saturating_add(Weight::from_parts(28_536_684, 0).saturating_mul(d.into())) + // Standard Error: 4_311 + .saturating_add(Weight::from_parts(231_309, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -667,19 +685,19 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. fn release_proposal_deposit(d: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` - // Estimated: `5213 + d * (212 ±0)` - // Minimum execution time: 121_000_000 picoseconds. - Weight::from_parts(124_000_000, 5213) - // Standard Error: 1_897_366 - .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) + // Estimated: `5213 + d * (1883 ±0)` + // Minimum execution time: 16_221_000 picoseconds. + Weight::from_parts(17_178_708, 5213) + // Standard Error: 49_254 + .saturating_add(Weight::from_parts(38_468_291, 0).saturating_mul(d.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) } } From 36f1855330ad5834b3eef2d8db133cdd69304b46 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 13 Mar 2024 16:44:08 +0100 Subject: [PATCH 17/49] remove unused import --- substrate/frame/collective/src/benchmarking.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index d91512cd95a3..c3a22e154736 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -24,7 +24,6 @@ use core::mem::size_of; use sp_runtime::traits::Bounded; use frame_benchmarking::{ - impl_benchmark_test_suite, v1::{account, whitelisted_caller}, v2::*, }; From c8dd9c403d98fcf701af8ebbb7df32cc722692eb Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 13 Mar 2024 16:42:05 +0000 Subject: [PATCH 18/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 288 +++++++++++----------- 1 file changed, 144 insertions(+), 144 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 01491cf9ab7d..cd3fea32a662 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-02-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-03-13, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-p5qp1txx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -81,12 +81,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 15_742_000 picoseconds. - Weight::from_parts(16_163_000, 15894) - // Standard Error: 58_009 - .saturating_add(Weight::from_parts(4_366_186, 0).saturating_mul(m.into())) - // Standard Error: 58_009 - .saturating_add(Weight::from_parts(7_778_194, 0).saturating_mul(p.into())) + // Minimum execution time: 15_704_000 picoseconds. + Weight::from_parts(16_332_000, 15894) + // Standard Error: 55_372 + .saturating_add(Weight::from_parts(4_182_388, 0).saturating_mul(m.into())) + // Standard Error: 55_372 + .saturating_add(Weight::from_parts(7_816_302, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -106,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 18_720_000 picoseconds. - Weight::from_parts(17_564_317, 3997) - // Standard Error: 52 - .saturating_add(Weight::from_parts(2_169, 0).saturating_mul(b.into())) - // Standard Error: 538 - .saturating_add(Weight::from_parts(20_399, 0).saturating_mul(m.into())) + // Minimum execution time: 19_058_000 picoseconds. + Weight::from_parts(18_531_578, 3997) + // Standard Error: 54 + .saturating_add(Weight::from_parts(2_044, 0).saturating_mul(b.into())) + // Standard Error: 565 + .saturating_add(Weight::from_parts(17_429, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -129,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 20_485_000 picoseconds. - Weight::from_parts(19_933_253, 3997) + // Minimum execution time: 21_056_000 picoseconds. + Weight::from_parts(20_463_382, 3997) // Standard Error: 52 - .saturating_add(Weight::from_parts(1_667, 0).saturating_mul(b.into())) - // Standard Error: 539 - .saturating_add(Weight::from_parts(30_461, 0).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(1_819, 0).saturating_mul(b.into())) + // Standard Error: 540 + .saturating_add(Weight::from_parts(31_955, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -159,14 +159,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `614 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 21_317_000 picoseconds. - Weight::from_parts(50_474_699, 3988) - // Standard Error: 381 - .saturating_add(Weight::from_parts(4_630, 0).saturating_mul(b.into())) - // Standard Error: 3_980 - .saturating_add(Weight::from_parts(38_892, 0).saturating_mul(m.into())) - // Standard Error: 3_929 - .saturating_add(Weight::from_parts(212_333, 0).saturating_mul(p.into())) + // Minimum execution time: 23_081_000 picoseconds. + Weight::from_parts(54_550_636, 3988) + // Standard Error: 412 + .saturating_add(Weight::from_parts(3_955, 0).saturating_mul(b.into())) + // Standard Error: 4_300 + .saturating_add(Weight::from_parts(45_402, 0).saturating_mul(m.into())) + // Standard Error: 4_245 + .saturating_add(Weight::from_parts(230_982, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -181,10 +181,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1007 + m * (64 ±0)` // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 22_591_000 picoseconds. - Weight::from_parts(23_608_081, 4471) - // Standard Error: 1_013 - .saturating_add(Weight::from_parts(60_257, 0).saturating_mul(m.into())) + // Minimum execution time: 23_559_000 picoseconds. + Weight::from_parts(24_441_035, 4471) + // Standard Error: 909 + .saturating_add(Weight::from_parts(53_050, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -203,12 +203,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `596 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 23_865_000 picoseconds. - Weight::from_parts(25_005_361, 4038) - // Standard Error: 1_306 - .saturating_add(Weight::from_parts(41_486, 0).saturating_mul(m.into())) - // Standard Error: 1_273 - .saturating_add(Weight::from_parts(163_408, 0).saturating_mul(p.into())) + // Minimum execution time: 24_928_000 picoseconds. + Weight::from_parts(25_393_657, 4038) + // Standard Error: 1_298 + .saturating_add(Weight::from_parts(44_631, 0).saturating_mul(m.into())) + // Standard Error: 1_266 + .saturating_add(Weight::from_parts(180_003, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -233,14 +233,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_731_000 picoseconds. - Weight::from_parts(42_195_946, 4357) - // Standard Error: 172 - .saturating_add(Weight::from_parts(3_835, 0).saturating_mul(b.into())) - // Standard Error: 1_825 - .saturating_add(Weight::from_parts(33_253, 0).saturating_mul(m.into())) - // Standard Error: 1_779 - .saturating_add(Weight::from_parts(192_978, 0).saturating_mul(p.into())) + // Minimum execution time: 42_435_000 picoseconds. + Weight::from_parts(44_834_149, 4357) + // Standard Error: 167 + .saturating_add(Weight::from_parts(2_826, 0).saturating_mul(b.into())) + // Standard Error: 1_770 + .saturating_add(Weight::from_parts(33_716, 0).saturating_mul(m.into())) + // Standard Error: 1_725 + .saturating_add(Weight::from_parts(201_317, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -263,12 +263,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `616 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 26_090_000 picoseconds. - Weight::from_parts(27_899_555, 4058) - // Standard Error: 1_579 - .saturating_add(Weight::from_parts(51_359, 0).saturating_mul(m.into())) + // Minimum execution time: 26_985_000 picoseconds. + Weight::from_parts(28_747_174, 4058) + // Standard Error: 1_578 + .saturating_add(Weight::from_parts(54_687, 0).saturating_mul(m.into())) // Standard Error: 1_539 - .saturating_add(Weight::from_parts(173_123, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(187_932, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -295,14 +295,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 43_232_000 picoseconds. - Weight::from_parts(44_893_012, 4377) - // Standard Error: 170 - .saturating_add(Weight::from_parts(3_193, 0).saturating_mul(b.into())) - // Standard Error: 1_802 - .saturating_add(Weight::from_parts(34_546, 0).saturating_mul(m.into())) - // Standard Error: 1_757 - .saturating_add(Weight::from_parts(195_533, 0).saturating_mul(p.into())) + // Minimum execution time: 44_484_000 picoseconds. + Weight::from_parts(46_132_232, 4377) + // Standard Error: 176 + .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) + // Standard Error: 1_869 + .saturating_add(Weight::from_parts(38_409, 0).saturating_mul(m.into())) + // Standard Error: 1_822 + .saturating_add(Weight::from_parts(204_440, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -320,10 +320,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `425 + p * (32 ±0)` // Estimated: `1907 + p * (32 ±0)` - // Minimum execution time: 12_533_000 picoseconds. - Weight::from_parts(14_751_614, 1907) - // Standard Error: 1_693 - .saturating_add(Weight::from_parts(155_676, 0).saturating_mul(p.into())) + // Minimum execution time: 13_038_000 picoseconds. + Weight::from_parts(15_927_614, 1907) + // Standard Error: 1_583 + .saturating_add(Weight::from_parts(157_773, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -345,13 +345,13 @@ impl WeightInfo for SubstrateWeight { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `609 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3980 + d * (1883 ±0) + p * (38 ±0)` - // Minimum execution time: 14_131_000 picoseconds. - Weight::from_parts(10_618_117, 3980) - // Standard Error: 278_381 - .saturating_add(Weight::from_parts(28_536_684, 0).saturating_mul(d.into())) - // Standard Error: 4_311 - .saturating_add(Weight::from_parts(231_309, 0).saturating_mul(p.into())) + // Estimated: `3980 + d * (1883 ±7) + p * (38 ±0)` + // Minimum execution time: 14_324_000 picoseconds. + Weight::from_parts(12_207_388, 3980) + // Standard Error: 293_542 + .saturating_add(Weight::from_parts(29_417_624, 0).saturating_mul(d.into())) + // Standard Error: 4_545 + .saturating_add(Weight::from_parts(230_391, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -372,10 +372,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (1883 ±0)` - // Minimum execution time: 16_221_000 picoseconds. - Weight::from_parts(17_178_708, 5213) - // Standard Error: 49_254 - .saturating_add(Weight::from_parts(38_468_291, 0).saturating_mul(d.into())) + // Minimum execution time: 16_584_000 picoseconds. + Weight::from_parts(17_348_765, 5213) + // Standard Error: 47_417 + .saturating_add(Weight::from_parts(40_411_534, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) @@ -400,12 +400,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 15_742_000 picoseconds. - Weight::from_parts(16_163_000, 15894) - // Standard Error: 58_009 - .saturating_add(Weight::from_parts(4_366_186, 0).saturating_mul(m.into())) - // Standard Error: 58_009 - .saturating_add(Weight::from_parts(7_778_194, 0).saturating_mul(p.into())) + // Minimum execution time: 15_704_000 picoseconds. + Weight::from_parts(16_332_000, 15894) + // Standard Error: 55_372 + .saturating_add(Weight::from_parts(4_182_388, 0).saturating_mul(m.into())) + // Standard Error: 55_372 + .saturating_add(Weight::from_parts(7_816_302, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -425,12 +425,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 18_720_000 picoseconds. - Weight::from_parts(17_564_317, 3997) - // Standard Error: 52 - .saturating_add(Weight::from_parts(2_169, 0).saturating_mul(b.into())) - // Standard Error: 538 - .saturating_add(Weight::from_parts(20_399, 0).saturating_mul(m.into())) + // Minimum execution time: 19_058_000 picoseconds. + Weight::from_parts(18_531_578, 3997) + // Standard Error: 54 + .saturating_add(Weight::from_parts(2_044, 0).saturating_mul(b.into())) + // Standard Error: 565 + .saturating_add(Weight::from_parts(17_429, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -448,12 +448,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 20_485_000 picoseconds. - Weight::from_parts(19_933_253, 3997) + // Minimum execution time: 21_056_000 picoseconds. + Weight::from_parts(20_463_382, 3997) // Standard Error: 52 - .saturating_add(Weight::from_parts(1_667, 0).saturating_mul(b.into())) - // Standard Error: 539 - .saturating_add(Weight::from_parts(30_461, 0).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(1_819, 0).saturating_mul(b.into())) + // Standard Error: 540 + .saturating_add(Weight::from_parts(31_955, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -478,14 +478,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `614 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 21_317_000 picoseconds. - Weight::from_parts(50_474_699, 3988) - // Standard Error: 381 - .saturating_add(Weight::from_parts(4_630, 0).saturating_mul(b.into())) - // Standard Error: 3_980 - .saturating_add(Weight::from_parts(38_892, 0).saturating_mul(m.into())) - // Standard Error: 3_929 - .saturating_add(Weight::from_parts(212_333, 0).saturating_mul(p.into())) + // Minimum execution time: 23_081_000 picoseconds. + Weight::from_parts(54_550_636, 3988) + // Standard Error: 412 + .saturating_add(Weight::from_parts(3_955, 0).saturating_mul(b.into())) + // Standard Error: 4_300 + .saturating_add(Weight::from_parts(45_402, 0).saturating_mul(m.into())) + // Standard Error: 4_245 + .saturating_add(Weight::from_parts(230_982, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -500,10 +500,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1007 + m * (64 ±0)` // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 22_591_000 picoseconds. - Weight::from_parts(23_608_081, 4471) - // Standard Error: 1_013 - .saturating_add(Weight::from_parts(60_257, 0).saturating_mul(m.into())) + // Minimum execution time: 23_559_000 picoseconds. + Weight::from_parts(24_441_035, 4471) + // Standard Error: 909 + .saturating_add(Weight::from_parts(53_050, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -522,12 +522,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `596 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 23_865_000 picoseconds. - Weight::from_parts(25_005_361, 4038) - // Standard Error: 1_306 - .saturating_add(Weight::from_parts(41_486, 0).saturating_mul(m.into())) - // Standard Error: 1_273 - .saturating_add(Weight::from_parts(163_408, 0).saturating_mul(p.into())) + // Minimum execution time: 24_928_000 picoseconds. + Weight::from_parts(25_393_657, 4038) + // Standard Error: 1_298 + .saturating_add(Weight::from_parts(44_631, 0).saturating_mul(m.into())) + // Standard Error: 1_266 + .saturating_add(Weight::from_parts(180_003, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -552,14 +552,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_731_000 picoseconds. - Weight::from_parts(42_195_946, 4357) - // Standard Error: 172 - .saturating_add(Weight::from_parts(3_835, 0).saturating_mul(b.into())) - // Standard Error: 1_825 - .saturating_add(Weight::from_parts(33_253, 0).saturating_mul(m.into())) - // Standard Error: 1_779 - .saturating_add(Weight::from_parts(192_978, 0).saturating_mul(p.into())) + // Minimum execution time: 42_435_000 picoseconds. + Weight::from_parts(44_834_149, 4357) + // Standard Error: 167 + .saturating_add(Weight::from_parts(2_826, 0).saturating_mul(b.into())) + // Standard Error: 1_770 + .saturating_add(Weight::from_parts(33_716, 0).saturating_mul(m.into())) + // Standard Error: 1_725 + .saturating_add(Weight::from_parts(201_317, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -582,12 +582,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `616 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 26_090_000 picoseconds. - Weight::from_parts(27_899_555, 4058) - // Standard Error: 1_579 - .saturating_add(Weight::from_parts(51_359, 0).saturating_mul(m.into())) + // Minimum execution time: 26_985_000 picoseconds. + Weight::from_parts(28_747_174, 4058) + // Standard Error: 1_578 + .saturating_add(Weight::from_parts(54_687, 0).saturating_mul(m.into())) // Standard Error: 1_539 - .saturating_add(Weight::from_parts(173_123, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(187_932, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -614,14 +614,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 43_232_000 picoseconds. - Weight::from_parts(44_893_012, 4377) - // Standard Error: 170 - .saturating_add(Weight::from_parts(3_193, 0).saturating_mul(b.into())) - // Standard Error: 1_802 - .saturating_add(Weight::from_parts(34_546, 0).saturating_mul(m.into())) - // Standard Error: 1_757 - .saturating_add(Weight::from_parts(195_533, 0).saturating_mul(p.into())) + // Minimum execution time: 44_484_000 picoseconds. + Weight::from_parts(46_132_232, 4377) + // Standard Error: 176 + .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) + // Standard Error: 1_869 + .saturating_add(Weight::from_parts(38_409, 0).saturating_mul(m.into())) + // Standard Error: 1_822 + .saturating_add(Weight::from_parts(204_440, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -639,10 +639,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `425 + p * (32 ±0)` // Estimated: `1907 + p * (32 ±0)` - // Minimum execution time: 12_533_000 picoseconds. - Weight::from_parts(14_751_614, 1907) - // Standard Error: 1_693 - .saturating_add(Weight::from_parts(155_676, 0).saturating_mul(p.into())) + // Minimum execution time: 13_038_000 picoseconds. + Weight::from_parts(15_927_614, 1907) + // Standard Error: 1_583 + .saturating_add(Weight::from_parts(157_773, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -664,13 +664,13 @@ impl WeightInfo for () { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `609 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3980 + d * (1883 ±0) + p * (38 ±0)` - // Minimum execution time: 14_131_000 picoseconds. - Weight::from_parts(10_618_117, 3980) - // Standard Error: 278_381 - .saturating_add(Weight::from_parts(28_536_684, 0).saturating_mul(d.into())) - // Standard Error: 4_311 - .saturating_add(Weight::from_parts(231_309, 0).saturating_mul(p.into())) + // Estimated: `3980 + d * (1883 ±7) + p * (38 ±0)` + // Minimum execution time: 14_324_000 picoseconds. + Weight::from_parts(12_207_388, 3980) + // Standard Error: 293_542 + .saturating_add(Weight::from_parts(29_417_624, 0).saturating_mul(d.into())) + // Standard Error: 4_545 + .saturating_add(Weight::from_parts(230_391, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -691,10 +691,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (1883 ±0)` - // Minimum execution time: 16_221_000 picoseconds. - Weight::from_parts(17_178_708, 5213) - // Standard Error: 49_254 - .saturating_add(Weight::from_parts(38_468_291, 0).saturating_mul(d.into())) + // Minimum execution time: 16_584_000 picoseconds. + Weight::from_parts(17_348_765, 5213) + // Standard Error: 47_417 + .saturating_add(Weight::from_parts(40_411_534, 0).saturating_mul(d.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) From 94c35f9043c93c5c2e7d092b8a87ae77c1245852 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 16:28:07 +0200 Subject: [PATCH 19/49] use considerations --- .../collectives-westend/src/lib.rs | 5 +- .../src/weights/pallet_collective.rs | 2 +- prdoc/pr_3151.prdoc | 9 + substrate/bin/node/runtime/src/lib.rs | 33 +-- substrate/frame/alliance/src/mock.rs | 5 +- .../frame/collective/src/benchmarking.rs | 110 ++------ substrate/frame/collective/src/lib.rs | 254 +++++++----------- substrate/frame/collective/src/tests.rs | 227 ++++++++-------- substrate/frame/collective/src/weights.rs | 30 +-- substrate/frame/support/src/traits/storage.rs | 6 + .../support/src/traits/tokens/fungible/mod.rs | 38 ++- substrate/frame/utility/src/tests.rs | 5 +- 12 files changed, 307 insertions(+), 417 deletions(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index 2b71fc4aea18..72d3e3130271 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -540,8 +540,6 @@ pub const ALLIANCE_MAX_MEMBERS: u32 = 100; type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; @@ -553,8 +551,7 @@ impl pallet_collective::Config for Runtime { type MaxProposalWeight = MaxProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = (); - type Slash = (); + type Consideration = (); } pub const MAX_FELLOWS: u32 = ALLIANCE_MAX_MEMBERS; diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index 5545eaf37441..ec9fc62e28e5 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -341,7 +341,7 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. - fn release_proposal_deposit(d: u32, ) -> Weight { + fn release_proposal_cost(d: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (212 ±0)` diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 7db6f71cd8f6..532f9e4bc5c8 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -16,4 +16,13 @@ doc: crates: - name: pallet-collective + bump: major + - name: frame-support + bump: major + - name: collectives-westend-runtime + bump: minor + - name: kitchensink-runtime + bump: minor + - name: pallet-alliance + bump: patch diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index ca74fa1ae139..e014a0a69f3f 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -1119,13 +1119,13 @@ parameter_types! { pub const CouncilMaxProposals: u32 = 100; pub const CouncilMaxMembers: u32 = 100; pub const ProposalDepositOffset: Balance = ExistentialDeposit::get() + ExistentialDeposit::get(); + pub const ProposalHoldReason: RuntimeHoldReason = + RuntimeHoldReason::Council(pallet_collective::HoldReason::ProposalSubmission); } type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = CouncilMotionDuration; @@ -1137,11 +1137,16 @@ impl pallet_collective::Config for Runtime { type MaxProposalWeight = MaxCollectivesProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = pallet_collective::deposit::Delayed< - ConstU32<2>, - pallet_collective::deposit::Linear, ProposalDepositOffset>, + type Consideration = HoldConsideration< + AccountId, + Balances, + ProposalHoldReason, + pallet_collective::deposit::Delayed< + ConstU32<2>, + pallet_collective::deposit::Linear, ProposalDepositOffset>, + >, + u32, >; - type Slash = (); } parameter_types! { @@ -1194,8 +1199,6 @@ parameter_types! { type TechnicalCollective = pallet_collective::Instance2; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = TechnicalMotionDuration; @@ -1207,11 +1210,7 @@ impl pallet_collective::Config for Runtime { type MaxProposalWeight = MaxCollectivesProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = pallet_collective::deposit::Delayed< - ConstU32<2>, - pallet_collective::deposit::Linear, ProposalDepositOffset>, - >; - type Slash = (); + type Consideration = (); } type EnsureRootOrHalfCouncil = EitherOfDiverse< @@ -2005,8 +2004,6 @@ parameter_types! { type AllianceCollective = pallet_collective::Instance3; impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = AllianceMotionDuration; @@ -2018,11 +2015,7 @@ impl pallet_collective::Config for Runtime { type MaxProposalWeight = MaxCollectivesProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = pallet_collective::deposit::Delayed< - ConstU32<2>, - pallet_collective::deposit::Linear, ProposalDepositOffset>, - >; - type Slash = (); + type Consideration = (); } parameter_types! { diff --git a/substrate/frame/alliance/src/mock.rs b/substrate/frame/alliance/src/mock.rs index 65b3e0392dbd..4be6ea5dc99b 100644 --- a/substrate/frame/alliance/src/mock.rs +++ b/substrate/frame/alliance/src/mock.rs @@ -68,8 +68,6 @@ parameter_types! { type AllianceCollective = pallet_collective::Instance1; impl pallet_collective::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = MotionDuration; @@ -81,8 +79,7 @@ impl pallet_collective::Config for Test { type MaxProposalWeight = MaxProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = (); - type Slash = (); + type Consideration = (); } parameter_types! { diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index c3a22e154736..290191213e8b 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -48,7 +48,7 @@ fn id_to_remark_data(id: u32, length: usize) -> Vec { id.to_le_bytes().into_iter().cycle().take(length).collect() } -#[instance_benchmarks(where T: Config, I: 'static, T::Currency: Mutate)] +#[instance_benchmarks(where T: Config, I: 'static)] mod benchmarks { use super::*; @@ -81,10 +81,7 @@ mod benchmarks { // Length of the proposals should be irrelevant to `set_members`. let length = 100; for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, deposit + ed)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, length) }.into(); @@ -234,15 +231,10 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - let threshold = m; // Add previous proposals. for i in 0..p - 1 { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -256,9 +248,7 @@ mod benchmarks { assert_eq!(Proposals::::get().len(), (p - 1) as usize); - if let Some(deposit) = T::ProposalDeposit::get_deposit(p) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, p); let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(p, b as usize) }.into(); @@ -304,18 +294,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&proposer, ed)?; - // Threshold is 1 less than the number of members so that one person can vote nay let threshold = m - 1; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&proposer, deposit)?; - } + T::Consideration::ensure_successful(&proposer, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -395,18 +380,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&proposer, ed)?; - // Threshold is total members so that one nay will disapprove the vote let threshold = m; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&proposer, deposit)?; - } + T::Consideration::ensure_successful(&proposer, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); @@ -488,18 +468,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Threshold is 2 so any two ayes will approve the vote let threshold = 2; // Add previous proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -588,18 +563,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Threshold is one less than total members so that two nays will disapprove the vote let threshold = m - 1; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, bytes as usize) }.into(); @@ -681,18 +651,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Threshold is two, so any two ayes will pass the vote let threshold = 2; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -762,18 +727,13 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Threshold is one less than total members so that two nays will disapprove the vote let threshold = m - 1; // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = SystemCall::::remark { remark: id_to_remark_data(i, b as usize) }.into(); @@ -828,16 +788,10 @@ mod benchmarks { // Threshold is one less than total members so that two nays will disapprove the vote let threshold = m - 1; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Add proposals let mut last_hash = T::Hash::default(); for i in 0..p { - // mint assets for the deposit. - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = @@ -855,7 +809,7 @@ mod benchmarks { assert_eq!(Proposals::::get().len(), p as usize); if d == 0 { - DepositOf::::remove(last_hash); + CostOf::::remove(last_hash); } let origin = @@ -867,23 +821,16 @@ mod benchmarks { assert_eq!(Proposals::::get().len(), (p - 1) as usize); assert_last_event::(Event::Killed { proposal_hash: last_hash }.into()); if d != 0 { - if let Some(deposit) = T::ProposalDeposit::get_deposit(p - 1) { - assert_has_event::( - Event::ProposalDepositSlashed { - proposal_hash: last_hash, - who: caller, - amount: deposit, - } - .into(), - ); - } + assert_has_event::( + Event::ProposalCostBurned { proposal_hash: last_hash, who: caller }.into(), + ); } Ok(()) } // d: `0` - if deposit is not present and `1` otherwise. #[benchmark] - fn release_proposal_deposit(d: Linear<0, 1>) -> Result<(), BenchmarkError> { + fn release_proposal_cost(d: Linear<0, 1>) -> Result<(), BenchmarkError> { let m = 3; let p = T::MaxProposals::get(); let b = MAX_BYTES; @@ -904,17 +851,11 @@ mod benchmarks { T::MaxMembers::get(), )?; - let ed = T::Currency::minimum_balance(); - T::Currency::mint_into(&caller, ed)?; - // Add proposals let threshold = 2; let mut last_hash = T::Hash::default(); for i in 0..p { - // mint assets for the deposit. - if let Some(deposit) = T::ProposalDeposit::get_deposit(i) { - T::Currency::mint_into(&caller, deposit)?; - } + T::Consideration::ensure_successful(&caller, i); // Proposals should be different so that different proposal hashes are generated let proposal: T::Proposal = @@ -932,7 +873,7 @@ mod benchmarks { assert_eq!(Proposals::::get().len(), p as usize); if d == 0 { - DepositOf::::remove(last_hash); + CostOf::::remove(last_hash); } assert_eq!(Proposals::::get().len(), p as usize); @@ -942,18 +883,11 @@ mod benchmarks { #[extrinsic_call] _(SystemOrigin::Signed(caller.clone()), last_hash); - assert_eq!(DepositOf::::get(last_hash), None); + assert_eq!(CostOf::::get(last_hash), None); if d != 0 { - if let Some(deposit) = T::ProposalDeposit::get_deposit(p - 1) { - assert_last_event::( - Event::ProposalDepositReleased { - proposal_hash: last_hash, - who: caller, - amount: deposit, - } - .into(), - ); - } + assert_last_event::( + Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), + ); } Ok(()) } diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index f7a119f0d35c..a6d2d8d3dc81 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -58,8 +58,7 @@ use frame_support::{ traits::{ fungible, fungible::{BalancedHold, Credit, MutateHold}, - tokens::Precision, - Backing, ChangeMembers, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, Imbalance, + Backing, ChangeMembers, Consideration, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, InitializeMembers, OnUnbalanced, StorageVersion, }, weights::Weight, @@ -90,10 +89,6 @@ pub type ProposalIndex = u32; /// vote exactly once, therefore also the number of votes for any given motion. pub type MemberCount = u32; -type BalanceOf = <>::Currency as fungible::Inspect< - ::AccountId, ->>::Balance; - /// Default voting strategy when a member is inactive. pub trait DefaultVote { /// Get the default voting strategy, given: @@ -177,91 +172,68 @@ pub struct Votes { end: BlockNumber, } -/// Determines the deposit amount for a proposal submission. -pub trait GetDeposit { - /// Determines the required deposit for a proposal submission. The `proposal_count` parameter - /// reflects the total number of active proposals in the system, exclusive of the one currently - /// being proposed. The deposit may vary based on this count. If `None` is returned, this - /// indicates that no deposit is required. - fn get_deposit(proposal_count: u32) -> Option; -} - -/// Default implementation for [`GetDeposit`] that implies no deposit is required. -impl GetDeposit for () { - fn get_deposit(_: u32) -> Option { - None - } -} - -/// Types implementing [`GetDeposit`] trait. +/// Types implementing various cost strategies for a given proposal count. +/// +/// These types implement [`Convert`] trait and can be used with types like +/// [HoldConsideration](`frame_support::traits::fungible::HoldConsideration`) implementing +/// [Consideration](`frame_support::traits::Consideration`) trait. /// /// ### Example: /// /// 1. Linear increasing with helper types. -#[doc = docify::embed!("src/tests.rs", deposit_types_with_linear_work)] +/// #[doc = docify::embed!("src/tests.rs", deposit_types_with_linear_work)] /// /// 2. Geometrically increasing with helper types. -#[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] +/// #[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] /// /// 3. Geometrically increasing with rounding. -#[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] +/// #[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] pub mod deposit { - use super::GetDeposit; use sp_core::Get; - use sp_runtime::{FixedPointNumber, FixedU128, Saturating}; + use sp_runtime::{traits::Convert, FixedPointNumber, FixedU128, Saturating}; use sp_std::marker::PhantomData; /// Constant deposit amount regardless of current proposal count. /// Returns `None` if configured with zero deposit. pub struct Constant(PhantomData); - impl GetDeposit for Constant + impl Convert for Constant where Deposit: Get, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(_: u32) -> Option { - let deposit = Deposit::get(); - if deposit == Balance::zero() { - None - } else { - Some(deposit) - } + fn convert(_: u32) -> Balance { + Deposit::get() } } /// Linear increasing with some offset. /// f(x) = ax + b, a = `Slope`, x = `proposal_count`, b = `Offset`. pub struct Linear(PhantomData<(Slope, Offset)>); - impl GetDeposit for Linear + impl Convert for Linear where Slope: Get, Offset: Get, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { + fn convert(proposal_count: u32) -> Balance { let base: Balance = Slope::get().saturating_mul(proposal_count).into(); - Some(Offset::get().saturating_add(base)) + Offset::get().saturating_add(base) } } /// Geometrically increasing. /// f(x) = a * r^x, a = `Base`, x = `proposal_count`, r = `Ratio`. pub struct Geometric(PhantomData<(Ratio, Base)>); - impl GetDeposit for Geometric + impl Convert for Geometric where Ratio: Get, Base: Get, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { - let deposit = Ratio::get() + fn convert(proposal_count: u32) -> Balance { + Ratio::get() .saturating_pow(proposal_count as usize) - .saturating_mul_int(Base::get()); - if deposit > Balance::zero() { - Some(deposit) - } else { - None - } + .saturating_mul_int(Base::get()) } } @@ -269,68 +241,65 @@ pub mod deposit { /// Particularly useful for types like [`Geometric`] that might produce deposits with high /// precision. pub struct Round(PhantomData<(Precision, Deposit)>); - impl GetDeposit for Round + impl Convert for Round where Precision: Get, - Deposit: GetDeposit, + Deposit: Convert, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { - if let Some(deposit) = Deposit::get_deposit(proposal_count) { + fn convert(proposal_count: u32) -> Balance { + let deposit = Deposit::convert(proposal_count); + if !deposit.is_zero() { let factor: Balance = 10u32.pow(Precision::get()).into(); - Some((deposit / factor) * factor) + (deposit / factor) * factor } else { - None + deposit } } } /// Defines `Period` for supplied `Step` implementing [`GetDeposit`] trait. pub struct Stepped(PhantomData<(Period, Step)>); - impl GetDeposit for Stepped + impl Convert for Stepped where Period: Get, - Step: GetDeposit, + Step: Convert, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { + fn convert(proposal_count: u32) -> Balance { let step_num = proposal_count / Period::get(); - Step::get_deposit(step_num) + Step::convert(step_num) } } /// Defines `Delay` for supplied `Step` implementing [`GetDeposit`] trait. pub struct Delayed(PhantomData<(Delay, Deposit)>); - impl GetDeposit for Delayed + impl Convert for Delayed where Delay: Get, - Deposit: GetDeposit, + Deposit: Convert, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { + fn convert(proposal_count: u32) -> Balance { let delay = Delay::get(); if delay > proposal_count { - return None + return Balance::zero(); } let pos = proposal_count.saturating_sub(delay); - Deposit::get_deposit(pos) + Deposit::convert(pos) } } /// Defines `Ceil` for supplied `Step` implementing [`GetDeposit`] trait. pub struct WithCeil(PhantomData<(Ceil, Deposit)>); - impl GetDeposit for WithCeil + impl Convert for WithCeil where Ceil: Get, - Deposit: GetDeposit, + Deposit: Convert, Balance: frame_support::traits::tokens::Balance, { - fn get_deposit(proposal_count: u32) -> Option { - if let Some(deposit) = Deposit::get_deposit(proposal_count) { - Some(deposit.min(Ceil::get())) - } else { - None - } + fn convert(proposal_count: u32) -> Balance { + Deposit::convert(proposal_count).min(Ceil::get()) } } } @@ -354,13 +323,6 @@ pub mod pallet { /// The runtime origin type. type RuntimeOrigin: From>; - /// Overarching hold reason. - type RuntimeHoldReason: From>; - - /// The currency used for deposit. - type Currency: MutateHold - + BalancedHold; - /// The runtime call dispatch type. type Proposal: Parameter + Dispatchable< @@ -399,22 +361,22 @@ pub mod pallet { #[pallet::constant] type MaxProposalWeight: Get; - /// Mechanism to assess the necessity and amount of the deposit required for publishing and - /// storing a proposal. - /// - /// Note: If resulting deposits are excessively high and cause benchmark failures, consider - /// supplying the [`crate::deposit::Constant`] type with a deposit equal to the minimum - /// balance under `runtime-benchmarks` feature. - type ProposalDeposit: GetDeposit>; - - /// Handler for a slashed funds. - type Slash: OnUnbalanced>; - /// Origin from which any proposal may be disapproved. type DisapproveOrigin: EnsureOrigin<::RuntimeOrigin>; /// Origin from which any proposal may be killed. type KillOrigin: EnsureOrigin<::RuntimeOrigin>; + + /// Mechanism to assess the necessity of some cost for publishing and storing a proposal. + /// + /// The footprint is defined as `proposal_count`, which reflects the total number of active + /// proposals in the system, excluding the one currently being proposed. The cost may vary + /// based on this count. + /// + /// Note: If the resulting deposits are excessively high and cause benchmark failures, + /// consider using a constant cost (e.g., [`crate::deposit::Constant`]) equal to the minimum + /// balance under the `runtime-benchmarks` feature. + type Consideration: Consideration; } #[pallet::genesis_config] @@ -458,11 +420,11 @@ pub mod pallet { pub type ProposalOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, >::Proposal, OptionQuery>; - /// Deposit taken for publishing and storing a proposal. Determined by [Config::ProposalDeposit] - /// and may not be applicable for certain proposals. + /// Consideration cost created for publishing and storing a proposal. Determined by + /// [Config::Consideration] and may not be applicable for certain proposals. #[pallet::storage] - pub type DepositOf, I: 'static = ()> = - StorageMap<_, Identity, T::Hash, (T::AccountId, BalanceOf), OptionQuery>; + pub type CostOf, I: 'static = ()> = + StorageMap<_, Identity, T::Hash, (T::AccountId, T::Consideration), OptionQuery>; /// Votes on a given proposal, if it is ongoing. #[pallet::storage] @@ -512,20 +474,12 @@ pub mod pallet { MemberExecuted { proposal_hash: T::Hash, result: DispatchResult }, /// A proposal was closed because its threshold was reached or after its duration was up. Closed { proposal_hash: T::Hash, yes: MemberCount, no: MemberCount }, - /// A motion was killed and deposit slashed. + /// A proposal was killed. Killed { proposal_hash: T::Hash }, - /// A proposal deposit was slashed. - ProposalDepositSlashed { - proposal_hash: T::Hash, - who: T::AccountId, - amount: BalanceOf, - }, - /// A proposal deposit was released. - ProposalDepositReleased { - proposal_hash: T::Hash, - who: T::AccountId, - amount: BalanceOf, - }, + /// Some cost for storing a proposal was burned. + ProposalCostBurned { proposal_hash: T::Hash, who: T::AccountId }, + /// Some cost for storing a proposal was released. + ProposalCostReleased { proposal_hash: T::Hash, who: T::AccountId }, } #[pallet::error] @@ -865,37 +819,57 @@ pub mod pallet { Self::do_close(proposal_hash, index, proposal_weight_bound, length_bound) } - /// Disapprove a proposal and slash the deposits. + /// Disapprove the proposal and burn the cost held for storing this proposal. /// /// Parameters: /// - `origin`: must be the `KillOrigin`. - /// - `proposal_hash`: The hash of the proposal that should be disapproved. + /// - `proposal_hash`: The hash of the proposal that should be killed. /// - /// Emits `Killed` and `ProposalDepositSlashed` if a deposit was present. + /// Emits `Killed` and `ProposalCostBurned` if any cost was held for a given proposal. #[pallet::call_index(7)] #[pallet::weight(T::WeightInfo::kill(1, T::MaxProposals::get()))] pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { T::KillOrigin::ensure_origin(origin)?; - let (slashed, proposal_count) = Self::do_kill_proposal(proposal_hash)?; - Ok(Some(T::WeightInfo::kill(slashed as u32, proposal_count)).into()) + let burned = if let Some((who, cost)) = >::take(proposal_hash) { + cost.burn(&who); + Self::deposit_event(Event::ProposalCostBurned { proposal_hash, who }); + true + } else { + false + }; + let proposal_count = Self::remove_proposal(proposal_hash); + + Self::deposit_event(Event::Killed { proposal_hash }); + + Ok(Some(T::WeightInfo::kill(burned as u32, proposal_count)).into()) } - /// Release the deposit of a completed proposal + /// Release the cost held for storing a proposal once the given proposal is completed. /// /// Parameters: /// - `origin`: must be `Signed` or `Root`. - /// - `proposal_hash`: The hash of the proposal that should be disapproved. + /// - `proposal_hash`: The hash of the proposal. /// - /// Emits `ProposalDepositReleased`. + /// Emits `ProposalCostReleased` if any cost held for a given proposal. #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::release_proposal_deposit(1))] - pub fn release_proposal_deposit( + #[pallet::weight(T::WeightInfo::release_proposal_cost(1))] + pub fn release_proposal_cost( origin: OriginFor, proposal_hash: T::Hash, ) -> DispatchResultWithPostInfo { let _ = ensure_signed_or_root(origin)?; - let slashed = Self::do_release_proposal_deposit(proposal_hash)?; - Ok(Some(T::WeightInfo::release_proposal_deposit(slashed.is_some() as u32)).into()) + ensure!( + ProposalOf::::get(&proposal_hash).is_none(), + Error::::ProposalActive + ); + let dropped = if let Some((who, cost)) = >::take(proposal_hash) { + let _ = cost.drop(&who)?; + Self::deposit_event(Event::ProposalCostReleased { proposal_hash, who }); + true + } else { + false + }; + Ok(Some(T::WeightInfo::release_proposal_cost(dropped as u32)).into()) } } } @@ -967,9 +941,8 @@ impl, I: 'static> Pallet { Ok(proposals.len()) })?; - if let Some(deposit) = T::ProposalDeposit::get_deposit(active_proposals as u32 - 1) { - T::Currency::hold(&HoldReason::ProposalSubmission.into(), &who, deposit)?; - >::insert(proposal_hash, (who.clone(), deposit)); + if let Some(cost) = T::Consideration::new(&who, active_proposals as u32 - 1)? { + >::insert(proposal_hash, (who.clone(), cost)); } let index = ProposalCount::::get(); @@ -1188,45 +1161,6 @@ impl, I: 'static> Pallet { Self::remove_proposal(proposal_hash) } - /// Releases a proposal deposit, if one exists. - fn do_release_proposal_deposit( - proposal_hash: T::Hash, - ) -> Result>, DispatchError> { - ensure!(ProposalOf::::get(&proposal_hash).is_none(), Error::::ProposalActive); - if let Some((who, deposit)) = >::take(proposal_hash) { - return T::Currency::release( - &HoldReason::ProposalSubmission.into(), - &who, - deposit, - Precision::Exact, - ) - .map(|amount| { - Self::deposit_event(Event::ProposalDepositReleased { proposal_hash, who, amount }); - Some(amount) - }); - } - Ok(None) - } - - /// Removes a proposal, slashes it's deposit if one exists and emits the `Killed` event. - fn do_kill_proposal(proposal_hash: T::Hash) -> Result<(bool, u32), DispatchError> { - let slashed = if let Some((who, deposit)) = >::take(proposal_hash) { - let (credit, _) = - T::Currency::slash(&HoldReason::ProposalSubmission.into(), &who, deposit); - Self::deposit_event(Event::ProposalDepositSlashed { - proposal_hash, - who, - amount: credit.peek(), - }); - T::Slash::on_unbalanced(credit); - true - } else { - false - }; - Self::deposit_event(Event::Killed { proposal_hash }); - Ok((slashed, Self::remove_proposal(proposal_hash))) - } - // Removes a proposal from the pallet, cleaning up votes and the vector of proposals. fn remove_proposal(proposal_hash: T::Hash) -> u32 { // remove proposal and vote diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 1be3ec2319d0..252b286a2680 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -28,8 +28,13 @@ use frame_support::{ Hashable, }; use frame_system::{EnsureRoot, EventRecord, Phase}; +use fungible::HoldConsideration; use sp_core::{ConstU128, H256}; -use sp_runtime::{testing::Header, traits::BlakeTwo256, BuildStorage, FixedU128}; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, Convert}, + BuildStorage, FixedU128, +}; pub type Block = sp_runtime::generic::Block; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; @@ -107,6 +112,8 @@ impl pallet_balances::Config for Test { parameter_types! { pub ProposalDepositBase: u64 = Balances::minimum_balance() + Balances::minimum_balance(); pub const ProposalDepositDelay: u32 = 2; + pub const ProposalHoldReason: RuntimeHoldReason = + RuntimeHoldReason::Collective(pallet_collective::HoldReason::ProposalSubmission); } type CollectiveDeposit = @@ -114,8 +121,6 @@ type CollectiveDeposit = impl Config for Test { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -125,18 +130,17 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = CollectiveDeposit; + // type ProposalDeposit = CollectiveDeposit; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type Slash = (); + type Consideration = + HoldConsideration; } type CollectiveMajorityDeposit = deposit::Linear, ProposalDepositBase>; impl Config for Test { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -146,10 +150,11 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = CollectiveMajorityDeposit; + // type ProposalDeposit = CollectiveMajorityDeposit; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type Slash = (); + type Consideration = + HoldConsideration; } impl mock_democracy::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -159,10 +164,10 @@ parameter_types! { pub const Ratio2: FixedU128 = FixedU128::from_u32(2); pub ProposalDepositCeil: u64 = Balances::minimum_balance() * 100; } +type DefaultCollectiveDeposit = + deposit::WithCeil>; impl Config for Test { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = ConstU64<3>; @@ -172,11 +177,12 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - type ProposalDeposit = - deposit::WithCeil>; + // type ProposalDeposit = + // deposit::WithCeil>; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type Slash = (); + type Consideration = + HoldConsideration; } pub struct ExtBuilder { @@ -598,7 +604,7 @@ fn close_with_no_prime_but_majority_works() { MaxMembers::get() )); - let deposit = >::get_deposit(0).unwrap(); + let deposit = >::convert(0); let ed = Balances::minimum_balance(); let _ = Balances::mint_into(&1, ed + deposit); System::reset_events(); @@ -616,7 +622,7 @@ fn close_with_no_prime_but_majority_works() { assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(3), hash, 0, true)); assert_noop!( - CollectiveMajority::release_proposal_deposit(RuntimeOrigin::signed(1), hash), + CollectiveMajority::release_proposal_cost(RuntimeOrigin::signed(1), hash), Error::::ProposalActive ); @@ -629,7 +635,7 @@ fn close_with_no_prime_but_majority_works() { proposal_len )); - assert_ok!(CollectiveMajority::release_proposal_deposit(RuntimeOrigin::signed(1), hash)); + assert_ok!(CollectiveMajority::release_proposal_cost(RuntimeOrigin::signed(1), hash)); assert_eq!(Balances::balance(&1), ed + deposit); assert_eq!( @@ -674,13 +680,10 @@ fn close_with_no_prime_but_majority_works() { proposal_hash: hash, result: Err(DispatchError::BadOrigin) })), - record(RuntimeEvent::CollectiveMajority( - CollectiveEvent::ProposalDepositReleased { - proposal_hash: hash, - who: 1, - amount: deposit, - } - )) + record(RuntimeEvent::CollectiveMajority(CollectiveEvent::ProposalCostReleased { + proposal_hash: hash, + who: 1, + })) ] ); }); @@ -832,9 +835,8 @@ fn limit_active_proposals() { for i in 0..MaxProposals::get() { let proposal = make_proposal(i as u64); let proposal_len: u32 = proposal.using_encoded(|p| p.len() as u32); - if let Some(deposit) = >::get_deposit(0) { - assert_ok!(Balances::mint_into(&1, deposit)); - } + let deposit = >::convert(0); + assert_ok!(Balances::mint_into(&1, deposit)); assert_ok!(Collective::propose( RuntimeOrigin::signed(1), 3, @@ -1586,10 +1588,10 @@ fn kill_proposal_with_deposit() { let proposal = make_proposal(i as u64); let proposal_len: u32 = proposal.using_encoded(|p| p.len() as u32); last_hash = Some(BlakeTwo256::hash_of(&proposal)); - if let Some(deposit) = >::get_deposit(i) { - assert_ok!(Balances::mint_into(&1, deposit)); - last_deposit = Some(deposit); - } + let deposit = >::convert(i); + assert_ok!(Balances::mint_into(&1, deposit)); + last_deposit = Some(deposit); + assert_ok!(Collective::propose( RuntimeOrigin::signed(1), 3, @@ -1606,10 +1608,9 @@ fn kill_proposal_with_deposit() { assert_eq!( System::events(), vec![ - record(RuntimeEvent::Collective(CollectiveEvent::ProposalDepositSlashed { + record(RuntimeEvent::Collective(CollectiveEvent::ProposalCostBurned { proposal_hash: last_hash.unwrap(), who: 1, - amount: last_deposit.unwrap(), })), record(RuntimeEvent::Collective(CollectiveEvent::Killed { proposal_hash: last_hash.unwrap(), @@ -1623,39 +1624,39 @@ fn kill_proposal_with_deposit() { #[test] fn deposit_types_with_linear_work() { type LinearWithSlop2 = crate::deposit::Linear, ConstU128<10>>; - assert_eq!(LinearWithSlop2::get_deposit(0), Some(10u128)); - assert_eq!(LinearWithSlop2::get_deposit(1), Some(12u128)); - assert_eq!(LinearWithSlop2::get_deposit(2), Some(14u128)); - assert_eq!(LinearWithSlop2::get_deposit(3), Some(16u128)); - assert_eq!(LinearWithSlop2::get_deposit(4), Some(18u128)); + assert_eq!(>::convert(0), 10); + assert_eq!(>::convert(1), 12); + assert_eq!(>::convert(2), 14); + assert_eq!(>::convert(3), 16); + assert_eq!(>::convert(4), 18); type SteppedWithStep3 = crate::deposit::Stepped, LinearWithSlop2>; - assert_eq!(SteppedWithStep3::get_deposit(0), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(1), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(2), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(3), Some(12u128)); - assert_eq!(SteppedWithStep3::get_deposit(4), Some(12u128)); - assert_eq!(SteppedWithStep3::get_deposit(5), Some(12u128)); - assert_eq!(SteppedWithStep3::get_deposit(6), Some(14u128)); + assert_eq!(>::convert(0), 10); + assert_eq!(>::convert(1), 10); + assert_eq!(>::convert(2), 10); + assert_eq!(>::convert(3), 12); + assert_eq!(>::convert(4), 12); + assert_eq!(>::convert(5), 12); + assert_eq!(>::convert(6), 14); type DelayedWithDelay4 = crate::deposit::Delayed, SteppedWithStep3>; - assert_eq!(DelayedWithDelay4::get_deposit(0), None::); - assert_eq!(DelayedWithDelay4::get_deposit(3), None::); - assert_eq!(DelayedWithDelay4::get_deposit(4), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(5), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(6), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(7), Some(12u128)); - assert_eq!(DelayedWithDelay4::get_deposit(9), Some(12u128)); - assert_eq!(DelayedWithDelay4::get_deposit(10), Some(14u128)); - assert_eq!(DelayedWithDelay4::get_deposit(13), Some(16u128)); + assert_eq!(>::convert(0), 0); + assert_eq!(>::convert(3), 0); + assert_eq!(>::convert(4), 10); + assert_eq!(>::convert(5), 10); + assert_eq!(>::convert(6), 10); + assert_eq!(>::convert(7), 12); + assert_eq!(>::convert(9), 12); + assert_eq!(>::convert(10), 14); + assert_eq!(>::convert(13), 16); type WithCeil13 = crate::deposit::WithCeil, DelayedWithDelay4>; - assert_eq!(WithCeil13::get_deposit(0), None::); - assert_eq!(WithCeil13::get_deposit(4), Some(10u128)); - assert_eq!(WithCeil13::get_deposit(9), Some(12u128)); - assert_eq!(WithCeil13::get_deposit(10), Some(13u128)); - assert_eq!(WithCeil13::get_deposit(11), Some(13u128)); - assert_eq!(WithCeil13::get_deposit(13), Some(13u128)); + assert_eq!(>::convert(0), 0); + assert_eq!(>::convert(4), 10); + assert_eq!(>::convert(9), 12); + assert_eq!(>::convert(10), 13); + assert_eq!(>::convert(11), 13); + assert_eq!(>::convert(13), 13); } #[docify::export] @@ -1665,44 +1666,44 @@ fn deposit_types_with_geometric_work() { pub const Ratio2: FixedU128 = FixedU128::from_u32(2); } type WithRatio2Base10 = crate::deposit::Geometric>; - assert_eq!(WithRatio2Base10::get_deposit(0), Some(10u128)); - assert_eq!(WithRatio2Base10::get_deposit(1), Some(20u128)); - assert_eq!(WithRatio2Base10::get_deposit(2), Some(40u128)); - assert_eq!(WithRatio2Base10::get_deposit(3), Some(80u128)); - assert_eq!(WithRatio2Base10::get_deposit(4), Some(160u128)); - assert_eq!(WithRatio2Base10::get_deposit(5), Some(320u128)); - assert_eq!(WithRatio2Base10::get_deposit(6), Some(640u128)); - assert_eq!(WithRatio2Base10::get_deposit(7), Some(1280u128)); - assert_eq!(WithRatio2Base10::get_deposit(8), Some(2560u128)); - assert_eq!(WithRatio2Base10::get_deposit(9), Some(5120u128)); + assert_eq!(>::convert(0), 10); + assert_eq!(>::convert(1), 20); + assert_eq!(>::convert(2), 40); + assert_eq!(>::convert(3), 80); + assert_eq!(>::convert(4), 160); + assert_eq!(>::convert(5), 320); + assert_eq!(>::convert(6), 640); + assert_eq!(>::convert(7), 1280); + assert_eq!(>::convert(8), 2560); + assert_eq!(>::convert(9), 5120); type SteppedWithStep3 = crate::deposit::Stepped, WithRatio2Base10>; - assert_eq!(SteppedWithStep3::get_deposit(0), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(1), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(2), Some(10u128)); - assert_eq!(SteppedWithStep3::get_deposit(3), Some(20u128)); - assert_eq!(SteppedWithStep3::get_deposit(4), Some(20u128)); - assert_eq!(SteppedWithStep3::get_deposit(5), Some(20u128)); - assert_eq!(SteppedWithStep3::get_deposit(6), Some(40u128)); + assert_eq!(>::convert(0), 10); + assert_eq!(>::convert(1), 10); + assert_eq!(>::convert(2), 10); + assert_eq!(>::convert(3), 20); + assert_eq!(>::convert(4), 20); + assert_eq!(>::convert(5), 20); + assert_eq!(>::convert(6), 40); type DelayedWithDelay4 = crate::deposit::Delayed, SteppedWithStep3>; - assert_eq!(DelayedWithDelay4::get_deposit(0), None::); - assert_eq!(DelayedWithDelay4::get_deposit(3), None::); - assert_eq!(DelayedWithDelay4::get_deposit(4), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(5), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(6), Some(10u128)); - assert_eq!(DelayedWithDelay4::get_deposit(7), Some(20u128)); - assert_eq!(DelayedWithDelay4::get_deposit(9), Some(20u128)); - assert_eq!(DelayedWithDelay4::get_deposit(10), Some(40u128)); - assert_eq!(DelayedWithDelay4::get_deposit(13), Some(80u128)); + assert_eq!(>::convert(0), 0); + assert_eq!(>::convert(3), 0); + assert_eq!(>::convert(4), 10); + assert_eq!(>::convert(5), 10); + assert_eq!(>::convert(6), 10); + assert_eq!(>::convert(7), 20); + assert_eq!(>::convert(9), 20); + assert_eq!(>::convert(10), 40); + assert_eq!(>::convert(13), 80); type WithCeil21 = crate::deposit::WithCeil, DelayedWithDelay4>; - assert_eq!(WithCeil21::get_deposit(0), None::); - assert_eq!(WithCeil21::get_deposit(4), Some(10u128)); - assert_eq!(WithCeil21::get_deposit(9), Some(20u128)); - assert_eq!(WithCeil21::get_deposit(10), Some(21u128)); - assert_eq!(WithCeil21::get_deposit(11), Some(21u128)); - assert_eq!(WithCeil21::get_deposit(13), Some(21u128)); + assert_eq!(>::convert(0), 0); + assert_eq!(>::convert(4), 10); + assert_eq!(>::convert(9), 20); + assert_eq!(>::convert(10), 21); + assert_eq!(>::convert(11), 21); + assert_eq!(>::convert(13), 21); } #[docify::export] @@ -1712,36 +1713,36 @@ fn deposit_round_with_geometric_work() { pub const Ratio1_5: FixedU128 = FixedU128::from_rational(3, 2); } type WithRatio1_5Base10 = crate::deposit::Geometric>; - assert_eq!(WithRatio1_5Base10::get_deposit(0), Some(10000u128)); - assert_eq!(WithRatio1_5Base10::get_deposit(1), Some(15000u128)); - assert_eq!(WithRatio1_5Base10::get_deposit(2), Some(22500u128)); - assert_eq!(WithRatio1_5Base10::get_deposit(3), Some(33750u128)); - assert_eq!(WithRatio1_5Base10::get_deposit(4), Some(50625u128)); - assert_eq!(WithRatio1_5Base10::get_deposit(5), Some(75937u128)); + assert_eq!(>::convert(0), 10000); + assert_eq!(>::convert(1), 15000); + assert_eq!(>::convert(2), 22500); + assert_eq!(>::convert(3), 33750); + assert_eq!(>::convert(4), 50625); + assert_eq!(>::convert(5), 75937); type RoundWithPrecision3 = crate::deposit::Round, WithRatio1_5Base10>; - assert_eq!(RoundWithPrecision3::get_deposit(0), Some(10000u128)); - assert_eq!(RoundWithPrecision3::get_deposit(1), Some(15000u128)); - assert_eq!(RoundWithPrecision3::get_deposit(2), Some(22000u128)); - assert_eq!(RoundWithPrecision3::get_deposit(3), Some(33000u128)); - assert_eq!(RoundWithPrecision3::get_deposit(4), Some(50000u128)); - assert_eq!(RoundWithPrecision3::get_deposit(5), Some(75000u128)); + assert_eq!(>::convert(0), 10000); + assert_eq!(>::convert(1), 15000); + assert_eq!(>::convert(2), 22000); + assert_eq!(>::convert(3), 33000); + assert_eq!(>::convert(4), 50000); + assert_eq!(>::convert(5), 75000); } #[test] fn constant_deposit_work() { type Constant0 = crate::deposit::Constant>; - assert_eq!(Constant0::get_deposit(0), None::); - assert_eq!(Constant0::get_deposit(1), None::); - assert_eq!(Constant0::get_deposit(2), None::); + assert_eq!(>::convert(0), 0); + assert_eq!(>::convert(1), 0); + assert_eq!(>::convert(2), 0); type Constant1 = crate::deposit::Constant>; - assert_eq!(Constant1::get_deposit(0), Some(1u128)); - assert_eq!(Constant1::get_deposit(1), Some(1u128)); - assert_eq!(Constant1::get_deposit(2), Some(1u128)); + assert_eq!(>::convert(0), 1); + assert_eq!(>::convert(1), 1); + assert_eq!(>::convert(2), 1); type Constant12 = crate::deposit::Constant>; - assert_eq!(Constant12::get_deposit(0), Some(12u128)); - assert_eq!(Constant12::get_deposit(1), Some(12u128)); - assert_eq!(Constant12::get_deposit(2), Some(12u128)); + assert_eq!(>::convert(0), 12); + assert_eq!(>::convert(1), 12); + assert_eq!(>::convert(2), 12); } diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index cd3fea32a662..6b06e903cce9 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -60,7 +60,7 @@ pub trait WeightInfo { fn close_approved(b: u32, m: u32, p: u32, ) -> Weight; fn disapprove_proposal(p: u32, ) -> Weight; fn kill(d: u32, p: u32, ) -> Weight; - fn release_proposal_deposit(d: u32, ) -> Weight; + fn release_proposal_cost(d: u32, ) -> Weight; } /// Weights for `pallet_collective` using the Substrate node and recommended hardware. @@ -148,8 +148,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::DepositOf` (r:0 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:0 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. @@ -328,8 +328,8 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -361,14 +361,14 @@ impl WeightInfo for SubstrateWeight { } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. - fn release_proposal_deposit(d: u32, ) -> Weight { + fn release_proposal_cost(d: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (1883 ±0)` @@ -467,8 +467,8 @@ impl WeightInfo for () { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::DepositOf` (r:0 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:0 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. @@ -647,8 +647,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -680,14 +680,14 @@ impl WeightInfo for () { } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. - fn release_proposal_deposit(d: u32, ) -> Weight { + fn release_proposal_cost(d: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (1883 ±0)` diff --git a/substrate/frame/support/src/traits/storage.rs b/substrate/frame/support/src/traits/storage.rs index 875ff56bea19..b13e6685a233 100644 --- a/substrate/frame/support/src/traits/storage.rs +++ b/substrate/frame/support/src/traits/storage.rs @@ -232,6 +232,10 @@ pub trait Consideration: fn burn(self, _: &AccountId) { let _ = self; } + /// Ensure that creating a ticket for a given account and footprint will be successful if done + /// immediately after this call. + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(who: &AccountId, new: Footprint); } impl Consideration for () { @@ -244,6 +248,8 @@ impl Consideration for () { fn drop(self, _: &A) -> Result<(), DispatchError> { Ok(()) } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(_: &A, _: F) {} } macro_rules! impl_incrementable { diff --git a/substrate/frame/support/src/traits/tokens/fungible/mod.rs b/substrate/frame/support/src/traits/tokens/fungible/mod.rs index b8e985648983..63aa9283ee29 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/mod.rs @@ -158,6 +158,8 @@ mod union_of; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support_procedural::{CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; use scale_info::TypeInfo; +#[cfg(feature = "runtime-benchmarks")] +use sp_runtime::Saturating; use sp_std::marker::PhantomData; use super::{ @@ -204,8 +206,9 @@ pub struct FreezeConsideration(F::Balance, PhantomData ( where F: MutateFreeze; impl< - A: 'static, - F: 'static + MutateFreeze, + A: 'static + Eq, + #[cfg(not(feature = "runtime-benchmarks"))] F: 'static + MutateFreeze, + #[cfg(feature = "runtime-benchmarks")] F: 'static + MutateFreeze + Mutate, R: 'static + Get, D: 'static + Convert, Fp: 'static, @@ -236,6 +239,10 @@ impl< fn drop(self, who: &A) -> Result<(), DispatchError> { F::decrease_frozen(&R::get(), who, self.0).map(|_| ()) } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(who: &A, fp: Fp) { + let _ = F::mint_into(who, F::minimum_balance().saturating_add(D::convert(fp))); + } } /// Consideration method using a `fungible` balance frozen as the cost exacted for the footprint. @@ -258,8 +265,9 @@ pub struct HoldConsideration( where F: MutateHold; impl< - A: 'static, - F: 'static + MutateHold, + A: 'static + Eq, + #[cfg(not(feature = "runtime-benchmarks"))] F: 'static + MutateHold, + #[cfg(feature = "runtime-benchmarks")] F: 'static + MutateHold + Mutate, R: 'static + Get, D: 'static + Convert, Fp: 'static, @@ -293,6 +301,10 @@ impl< fn burn(self, who: &A) { let _ = F::burn_held(&R::get(), who, self.0, BestEffort, Force); } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(who: &A, fp: Fp) { + let _ = F::mint_into(who, F::minimum_balance().saturating_add(D::convert(fp))); + } } /// Basic consideration method using a `fungible` balance frozen as the cost exacted for the @@ -316,8 +328,9 @@ impl< #[codec(mel_bound())] pub struct LoneFreezeConsideration(PhantomData (A, Fx, Rx, D, Fp)>); impl< - A: 'static, - Fx: 'static + MutateFreeze, + A: 'static + Eq, + #[cfg(not(feature = "runtime-benchmarks"))] Fx: 'static + MutateFreeze, + #[cfg(feature = "runtime-benchmarks")] Fx: 'static + MutateFreeze + Mutate, Rx: 'static + Get, D: 'static + Convert, Fp: 'static, @@ -344,6 +357,10 @@ impl< fn drop(self, who: &A) -> Result<(), DispatchError> { Fx::thaw(&Rx::get(), who).map(|_| ()) } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(who: &A, fp: Fp) { + let _ = Fx::mint_into(who, Fx::minimum_balance().saturating_add(D::convert(fp))); + } } /// Basic consideration method using a `fungible` balance placed on hold as the cost exacted for the @@ -367,8 +384,9 @@ impl< #[codec(mel_bound())] pub struct LoneHoldConsideration(PhantomData (A, Fx, Rx, D, Fp)>); impl< - A: 'static, - F: 'static + MutateHold, + A: 'static + Eq, + #[cfg(not(feature = "runtime-benchmarks"))] F: 'static + MutateHold, + #[cfg(feature = "runtime-benchmarks")] F: 'static + MutateHold + Mutate, R: 'static + Get, D: 'static + Convert, Fp: 'static, @@ -398,4 +416,8 @@ impl< fn burn(self, who: &A) { let _ = F::burn_all_held(&R::get(), who, BestEffort, Force); } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(who: &A, fp: Fp) { + let _ = F::mint_into(who, F::minimum_balance().saturating_add(D::convert(fp))); + } } diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index 2e96464e4aaa..6c9470eb082b 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -182,8 +182,6 @@ parameter_types! { type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type RuntimeHoldReason = RuntimeHoldReason; - type Currency = Balances; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type MotionDuration = MotionDuration; @@ -195,8 +193,7 @@ impl pallet_collective::Config for Test { type MaxProposalWeight = MaxProposalWeight; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; - type ProposalDeposit = (); - type Slash = (); + type Consideration = (); } impl example::Config for Test {} From 29bfd875cfd1fb4cf6dad7727edb7dc088f79b21 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 16:36:15 +0200 Subject: [PATCH 20/49] improve doc --- prdoc/pr_3151.prdoc | 2 ++ substrate/frame/preimage/src/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 532f9e4bc5c8..e6c07a5c5e23 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -25,4 +25,6 @@ crates: bump: minor - name: pallet-alliance bump: patch + - name: pallet-preimage + bump: patch diff --git a/substrate/frame/preimage/src/lib.rs b/substrate/frame/preimage/src/lib.rs index dd323a12b8f8..316851edfe70 100644 --- a/substrate/frame/preimage/src/lib.rs +++ b/substrate/frame/preimage/src/lib.rs @@ -123,7 +123,8 @@ pub mod pallet { /// A means of providing some cost while data is stored on-chain. /// - /// Should never return a `None`, implying no cost for a non-empty preimage. + /// Some cost is expected for any non-zero footprint. Therefore, the consideration should + /// not return `None` in such cases. type Consideration: Consideration; } From 61dba532306f504f7f8c3d4a191fe7a4a235b0e6 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 16:39:55 +0200 Subject: [PATCH 21/49] remove unused imports --- substrate/frame/collective/src/benchmarking.rs | 1 - substrate/frame/collective/src/lib.rs | 4 +--- substrate/frame/collective/src/tests.rs | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index 290191213e8b..f6605ea42cf0 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -27,7 +27,6 @@ use frame_benchmarking::{ v1::{account, whitelisted_caller}, v2::*, }; -use frame_support::traits::fungible::{Inspect, Mutate}; use frame_system::{ pallet_prelude::BlockNumberFor, Call as SystemCall, Pallet as System, RawOrigin as SystemOrigin, }; diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index a6d2d8d3dc81..e99154e7f4b7 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -56,10 +56,8 @@ use frame_support::{ }, ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{ - fungible, - fungible::{BalancedHold, Credit, MutateHold}, Backing, ChangeMembers, Consideration, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, - InitializeMembers, OnUnbalanced, StorageVersion, + InitializeMembers, StorageVersion, }, weights::Weight, }; diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 252b286a2680..830c019d223e 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -22,13 +22,12 @@ use frame_support::{ dispatch::Pays, parameter_types, traits::{ - fungible::{Inspect, Mutate}, + fungible::{HoldConsideration, Inspect, Mutate}, ConstU32, ConstU64, StorageVersion, }, Hashable, }; use frame_system::{EnsureRoot, EventRecord, Phase}; -use fungible::HoldConsideration; use sp_core::{ConstU128, H256}; use sp_runtime::{ testing::Header, From 23d6385c2c4246ce51a9cc949926e164208f3caa Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 17:16:03 +0200 Subject: [PATCH 22/49] fixes --- prdoc/pr_3151.prdoc | 20 +++++++++++++++----- substrate/frame/collective/Cargo.toml | 2 +- substrate/frame/collective/src/lib.rs | 10 +++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index e6c07a5c5e23..45ff969d3336 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -6,13 +6,23 @@ title: Dynamic deposit based on number of proposals doc: - audience: Runtime User description: | - Introduce a dynamic proposal deposit mechanism influenced by the total number of active proposals, with the option to set the deposit to none. + Introduce a dynamic proposal deposit mechanism influenced by the total number of active + proposals, with the option to set the deposit to none. + + The potential cost (e.g., balance hold) for proposal submission and storage is determined + by the implementation of the `Consideration` trait. The footprint is defined as `proposal_count`, + representing the total number of active proposals in the system, excluding the one currently + being proposed. This cost may vary based on the proposal count. The pallet also offers various + types to define a cost strategy based on the number of proposals. - This is achieved through the introduction of the `GetDeposit` trait, and the corresponding implementation should be supplied to the pallet's configuration. The pallet provides basic implementations for this trait. Two new calls are introduced: - - kill(origin, proposal_hash): the cancellation of a proposal, accompanied by the slashing of the associated deposit. - - release_proposal_deposit(origin, proposal_hash): the release of the deposit for a non-active proposal. - Additionally, benchmarks have been upgraded to benchmarks::v2. + - kill(origin, proposal_hash): the cancellation of a proposal, accompanied by the burning + of the associated cost/consideration ticket. + - release_proposal_cost(origin, proposal_hash): the release of the cost for a non-active proposal. + + Additionally change: + - benchmarks have been upgraded to benchmarks::v2 for collective pallet; + - `ensure_successful` function added to the `Consideration` under `runtime-benchmarks` feature. crates: - name: pallet-collective diff --git a/substrate/frame/collective/Cargo.toml b/substrate/frame/collective/Cargo.toml index 8006668eb922..0a32359b6cfd 100644 --- a/substrate/frame/collective/Cargo.toml +++ b/substrate/frame/collective/Cargo.toml @@ -29,7 +29,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } [dev-dependencies] -pallet-balances = { path = "../balances", default-features = false } +pallet-balances = { workspace = true, default-features = false } [features] default = ["std"] diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index e99154e7f4b7..3c0ee3f311a9 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -172,8 +172,8 @@ pub struct Votes { /// Types implementing various cost strategies for a given proposal count. /// -/// These types implement [`Convert`] trait and can be used with types like -/// [HoldConsideration](`frame_support::traits::fungible::HoldConsideration`) implementing +/// These types implement [Convert](sp_runtime::traits::Convert) trait and can be used with types +/// like [HoldConsideration](`frame_support::traits::fungible::HoldConsideration`) implementing /// [Consideration](`frame_support::traits::Consideration`) trait. /// /// ### Example: @@ -256,7 +256,7 @@ pub mod deposit { } } - /// Defines `Period` for supplied `Step` implementing [`GetDeposit`] trait. + /// Defines `Period` for supplied `Step` implementing [`Convert`] trait. pub struct Stepped(PhantomData<(Period, Step)>); impl Convert for Stepped where @@ -270,7 +270,7 @@ pub mod deposit { } } - /// Defines `Delay` for supplied `Step` implementing [`GetDeposit`] trait. + /// Defines `Delay` for supplied `Step` implementing [`Convert`] trait. pub struct Delayed(PhantomData<(Delay, Deposit)>); impl Convert for Delayed where @@ -288,7 +288,7 @@ pub mod deposit { } } - /// Defines `Ceil` for supplied `Step` implementing [`GetDeposit`] trait. + /// Defines `Ceil` for supplied `Step` implementing [`Convert`] trait. pub struct WithCeil(PhantomData<(Ceil, Deposit)>); impl Convert for WithCeil where From a68785530dfe7a33540a21b97489dee102ae1723 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 18:02:24 +0200 Subject: [PATCH 23/49] fixe benches --- substrate/frame/collective/src/benchmarking.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index f6605ea42cf0..2d81a9cc61db 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -810,6 +810,7 @@ mod benchmarks { if d == 0 { CostOf::::remove(last_hash); } + let cost_present = CostOf::::get(last_hash).is_some(); let origin = T::KillOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; @@ -819,7 +820,7 @@ mod benchmarks { assert_eq!(Proposals::::get().len(), (p - 1) as usize); assert_last_event::(Event::Killed { proposal_hash: last_hash }.into()); - if d != 0 { + if cost_present { assert_has_event::( Event::ProposalCostBurned { proposal_hash: last_hash, who: caller }.into(), ); @@ -874,6 +875,7 @@ mod benchmarks { if d == 0 { CostOf::::remove(last_hash); } + let cost_present = CostOf::::get(last_hash).is_some(); assert_eq!(Proposals::::get().len(), p as usize); let _ = Collective::::remove_proposal(last_hash); @@ -883,7 +885,7 @@ mod benchmarks { _(SystemOrigin::Signed(caller.clone()), last_hash); assert_eq!(CostOf::::get(last_hash), None); - if d != 0 { + if cost_present { assert_last_event::( Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), ); From f67e7477011f72b4fccacc10b0c608308ecf969b Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 27 Jun 2024 18:02:35 +0200 Subject: [PATCH 24/49] fix pr doc --- prdoc/pr_3151.prdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 45ff969d3336..598161f077a0 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -30,9 +30,9 @@ crates: - name: frame-support bump: major - name: collectives-westend-runtime - bump: minor + bump: major - name: kitchensink-runtime - bump: minor + bump: major - name: pallet-alliance bump: patch - name: pallet-preimage From c5eaefd93b251caf9afb97046f45f17d3fc23f77 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Thu, 27 Jun 2024 16:58:11 +0000 Subject: [PATCH 25/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 380 +++++++++++----------- 1 file changed, 190 insertions(+), 190 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 6b06e903cce9..2b0fab7eb492 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-13, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-p5qp1txx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-7wrmsoux-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -81,12 +81,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 15_704_000 picoseconds. - Weight::from_parts(16_332_000, 15894) - // Standard Error: 55_372 - .saturating_add(Weight::from_parts(4_182_388, 0).saturating_mul(m.into())) - // Standard Error: 55_372 - .saturating_add(Weight::from_parts(7_816_302, 0).saturating_mul(p.into())) + // Minimum execution time: 14_908_000 picoseconds. + Weight::from_parts(15_068_000, 15894) + // Standard Error: 57_938 + .saturating_add(Weight::from_parts(4_395_036, 0).saturating_mul(m.into())) + // Standard Error: 57_938 + .saturating_add(Weight::from_parts(7_882_901, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -106,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_058_000 picoseconds. - Weight::from_parts(18_531_578, 3997) - // Standard Error: 54 - .saturating_add(Weight::from_parts(2_044, 0).saturating_mul(b.into())) - // Standard Error: 565 - .saturating_add(Weight::from_parts(17_429, 0).saturating_mul(m.into())) + // Minimum execution time: 17_307_000 picoseconds. + Weight::from_parts(16_380_063, 3997) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_606, 0).saturating_mul(b.into())) + // Standard Error: 275 + .saturating_add(Weight::from_parts(16_346, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -129,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_056_000 picoseconds. - Weight::from_parts(20_463_382, 3997) - // Standard Error: 52 - .saturating_add(Weight::from_parts(1_819, 0).saturating_mul(b.into())) - // Standard Error: 540 - .saturating_add(Weight::from_parts(31_955, 0).saturating_mul(m.into())) + // Minimum execution time: 19_090_000 picoseconds. + Weight::from_parts(18_332_223, 3997) + // Standard Error: 30 + .saturating_add(Weight::from_parts(1_767, 0).saturating_mul(b.into())) + // Standard Error: 315 + .saturating_add(Weight::from_parts(27_065, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -148,25 +148,25 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::CostOf` (r:0 w:1) - /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:0 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `614 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 23_081_000 picoseconds. - Weight::from_parts(54_550_636, 3988) - // Standard Error: 412 - .saturating_add(Weight::from_parts(3_955, 0).saturating_mul(b.into())) - // Standard Error: 4_300 - .saturating_add(Weight::from_parts(45_402, 0).saturating_mul(m.into())) - // Standard Error: 4_245 - .saturating_add(Weight::from_parts(230_982, 0).saturating_mul(p.into())) + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 20_909_000 picoseconds. + Weight::from_parts(55_746_293, 3991) + // Standard Error: 424 + .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(b.into())) + // Standard Error: 4_428 + .saturating_add(Weight::from_parts(42_332, 0).saturating_mul(m.into())) + // Standard Error: 4_372 + .saturating_add(Weight::from_parts(231_808, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -179,12 +179,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1007 + m * (64 ±0)` - // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 23_559_000 picoseconds. - Weight::from_parts(24_441_035, 4471) - // Standard Error: 909 - .saturating_add(Weight::from_parts(53_050, 0).saturating_mul(m.into())) + // Measured: `1011 + m * (64 ±0)` + // Estimated: `4475 + m * (64 ±0)` + // Minimum execution time: 22_947_000 picoseconds. + Weight::from_parts(23_913_673, 4475) + // Standard Error: 780 + .saturating_add(Weight::from_parts(38_053, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -201,14 +201,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `596 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 24_928_000 picoseconds. - Weight::from_parts(25_393_657, 4038) - // Standard Error: 1_298 - .saturating_add(Weight::from_parts(44_631, 0).saturating_mul(m.into())) - // Standard Error: 1_266 - .saturating_add(Weight::from_parts(180_003, 0).saturating_mul(p.into())) + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 22_981_000 picoseconds. + Weight::from_parts(25_766_411, 4042) + // Standard Error: 1_610 + .saturating_add(Weight::from_parts(16_430, 0).saturating_mul(m.into())) + // Standard Error: 1_570 + .saturating_add(Weight::from_parts(202_896, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -231,16 +231,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 42_435_000 picoseconds. - Weight::from_parts(44_834_149, 4357) - // Standard Error: 167 - .saturating_add(Weight::from_parts(2_826, 0).saturating_mul(b.into())) - // Standard Error: 1_770 - .saturating_add(Weight::from_parts(33_716, 0).saturating_mul(m.into())) - // Standard Error: 1_725 - .saturating_add(Weight::from_parts(201_317, 0).saturating_mul(p.into())) + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_266_000 picoseconds. + Weight::from_parts(43_310_998, 4360) + // Standard Error: 162 + .saturating_add(Weight::from_parts(2_462, 0).saturating_mul(b.into())) + // Standard Error: 1_715 + .saturating_add(Weight::from_parts(29_231, 0).saturating_mul(m.into())) + // Standard Error: 1_671 + .saturating_add(Weight::from_parts(213_172, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -261,14 +261,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `616 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 26_985_000 picoseconds. - Weight::from_parts(28_747_174, 4058) - // Standard Error: 1_578 - .saturating_add(Weight::from_parts(54_687, 0).saturating_mul(m.into())) - // Standard Error: 1_539 - .saturating_add(Weight::from_parts(187_932, 0).saturating_mul(p.into())) + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 25_385_000 picoseconds. + Weight::from_parts(29_288_474, 4062) + // Standard Error: 1_477 + .saturating_add(Weight::from_parts(33_804, 0).saturating_mul(m.into())) + // Standard Error: 1_441 + .saturating_add(Weight::from_parts(182_270, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -293,16 +293,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 44_484_000 picoseconds. - Weight::from_parts(46_132_232, 4377) - // Standard Error: 176 - .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) - // Standard Error: 1_869 - .saturating_add(Weight::from_parts(38_409, 0).saturating_mul(m.into())) - // Standard Error: 1_822 - .saturating_add(Weight::from_parts(204_440, 0).saturating_mul(p.into())) + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 41_816_000 picoseconds. + Weight::from_parts(45_174_137, 4380) + // Standard Error: 163 + .saturating_add(Weight::from_parts(2_359, 0).saturating_mul(b.into())) + // Standard Error: 1_729 + .saturating_add(Weight::from_parts(32_544, 0).saturating_mul(m.into())) + // Standard Error: 1_685 + .saturating_add(Weight::from_parts(214_308, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -318,22 +318,22 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `425 + p * (32 ±0)` - // Estimated: `1907 + p * (32 ±0)` - // Minimum execution time: 13_038_000 picoseconds. - Weight::from_parts(15_927_614, 1907) - // Standard Error: 1_583 - .saturating_add(Weight::from_parts(157_773, 0).saturating_mul(p.into())) + // Measured: `392 + p * (32 ±0)` + // Estimated: `1877 + p * (32 ±0)` + // Minimum execution time: 12_073_000 picoseconds. + Weight::from_parts(14_467_711, 1877) + // Standard Error: 1_267 + .saturating_add(Weight::from_parts(163_628, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } /// Storage: `Council::CostOf` (r:1 w:1) /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -344,14 +344,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `609 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3980 + d * (1883 ±7) + p * (38 ±0)` - // Minimum execution time: 14_324_000 picoseconds. - Weight::from_parts(12_207_388, 3980) - // Standard Error: 293_542 - .saturating_add(Weight::from_parts(29_417_624, 0).saturating_mul(d.into())) - // Standard Error: 4_545 - .saturating_add(Weight::from_parts(230_391, 0).saturating_mul(p.into())) + // Measured: `613 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3986 + d * (1883 ±0) + p * (38 ±0)` + // Minimum execution time: 13_608_000 picoseconds. + Weight::from_parts(9_166_865, 3986) + // Standard Error: 332_782 + .saturating_add(Weight::from_parts(33_940_315, 0).saturating_mul(d.into())) + // Standard Error: 5_153 + .saturating_add(Weight::from_parts(257_590, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -370,12 +370,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `d` is `[0, 1]`. fn release_proposal_cost(d: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1748 + d * (212 ±0)` - // Estimated: `5213 + d * (1883 ±0)` - // Minimum execution time: 16_584_000 picoseconds. - Weight::from_parts(17_348_765, 5213) - // Standard Error: 47_417 - .saturating_add(Weight::from_parts(40_411_534, 0).saturating_mul(d.into())) + // Measured: `1752 + d * (212 ±0)` + // Estimated: `5217 + d * (1883 ±0)` + // Minimum execution time: 16_238_000 picoseconds. + Weight::from_parts(17_120_118, 5217) + // Standard Error: 49_551 + .saturating_add(Weight::from_parts(42_271_981, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) @@ -400,12 +400,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 15_704_000 picoseconds. - Weight::from_parts(16_332_000, 15894) - // Standard Error: 55_372 - .saturating_add(Weight::from_parts(4_182_388, 0).saturating_mul(m.into())) - // Standard Error: 55_372 - .saturating_add(Weight::from_parts(7_816_302, 0).saturating_mul(p.into())) + // Minimum execution time: 14_908_000 picoseconds. + Weight::from_parts(15_068_000, 15894) + // Standard Error: 57_938 + .saturating_add(Weight::from_parts(4_395_036, 0).saturating_mul(m.into())) + // Standard Error: 57_938 + .saturating_add(Weight::from_parts(7_882_901, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -425,12 +425,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_058_000 picoseconds. - Weight::from_parts(18_531_578, 3997) - // Standard Error: 54 - .saturating_add(Weight::from_parts(2_044, 0).saturating_mul(b.into())) - // Standard Error: 565 - .saturating_add(Weight::from_parts(17_429, 0).saturating_mul(m.into())) + // Minimum execution time: 17_307_000 picoseconds. + Weight::from_parts(16_380_063, 3997) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_606, 0).saturating_mul(b.into())) + // Standard Error: 275 + .saturating_add(Weight::from_parts(16_346, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -448,12 +448,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_056_000 picoseconds. - Weight::from_parts(20_463_382, 3997) - // Standard Error: 52 - .saturating_add(Weight::from_parts(1_819, 0).saturating_mul(b.into())) - // Standard Error: 540 - .saturating_add(Weight::from_parts(31_955, 0).saturating_mul(m.into())) + // Minimum execution time: 19_090_000 picoseconds. + Weight::from_parts(18_332_223, 3997) + // Standard Error: 30 + .saturating_add(Weight::from_parts(1_767, 0).saturating_mul(b.into())) + // Standard Error: 315 + .saturating_add(Weight::from_parts(27_065, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -467,25 +467,25 @@ impl WeightInfo for () { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::CostOf` (r:0 w:1) - /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:0 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `614 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3988 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 23_081_000 picoseconds. - Weight::from_parts(54_550_636, 3988) - // Standard Error: 412 - .saturating_add(Weight::from_parts(3_955, 0).saturating_mul(b.into())) - // Standard Error: 4_300 - .saturating_add(Weight::from_parts(45_402, 0).saturating_mul(m.into())) - // Standard Error: 4_245 - .saturating_add(Weight::from_parts(230_982, 0).saturating_mul(p.into())) + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 20_909_000 picoseconds. + Weight::from_parts(55_746_293, 3991) + // Standard Error: 424 + .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(b.into())) + // Standard Error: 4_428 + .saturating_add(Weight::from_parts(42_332, 0).saturating_mul(m.into())) + // Standard Error: 4_372 + .saturating_add(Weight::from_parts(231_808, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -498,12 +498,12 @@ impl WeightInfo for () { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1007 + m * (64 ±0)` - // Estimated: `4471 + m * (64 ±0)` - // Minimum execution time: 23_559_000 picoseconds. - Weight::from_parts(24_441_035, 4471) - // Standard Error: 909 - .saturating_add(Weight::from_parts(53_050, 0).saturating_mul(m.into())) + // Measured: `1011 + m * (64 ±0)` + // Estimated: `4475 + m * (64 ±0)` + // Minimum execution time: 22_947_000 picoseconds. + Weight::from_parts(23_913_673, 4475) + // Standard Error: 780 + .saturating_add(Weight::from_parts(38_053, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -520,14 +520,14 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `596 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4038 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 24_928_000 picoseconds. - Weight::from_parts(25_393_657, 4038) - // Standard Error: 1_298 - .saturating_add(Weight::from_parts(44_631, 0).saturating_mul(m.into())) - // Standard Error: 1_266 - .saturating_add(Weight::from_parts(180_003, 0).saturating_mul(p.into())) + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 22_981_000 picoseconds. + Weight::from_parts(25_766_411, 4042) + // Standard Error: 1_610 + .saturating_add(Weight::from_parts(16_430, 0).saturating_mul(m.into())) + // Standard Error: 1_570 + .saturating_add(Weight::from_parts(202_896, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -550,16 +550,16 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1043 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4357 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 42_435_000 picoseconds. - Weight::from_parts(44_834_149, 4357) - // Standard Error: 167 - .saturating_add(Weight::from_parts(2_826, 0).saturating_mul(b.into())) - // Standard Error: 1_770 - .saturating_add(Weight::from_parts(33_716, 0).saturating_mul(m.into())) - // Standard Error: 1_725 - .saturating_add(Weight::from_parts(201_317, 0).saturating_mul(p.into())) + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_266_000 picoseconds. + Weight::from_parts(43_310_998, 4360) + // Standard Error: 162 + .saturating_add(Weight::from_parts(2_462, 0).saturating_mul(b.into())) + // Standard Error: 1_715 + .saturating_add(Weight::from_parts(29_231, 0).saturating_mul(m.into())) + // Standard Error: 1_671 + .saturating_add(Weight::from_parts(213_172, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -580,14 +580,14 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `616 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4058 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 26_985_000 picoseconds. - Weight::from_parts(28_747_174, 4058) - // Standard Error: 1_578 - .saturating_add(Weight::from_parts(54_687, 0).saturating_mul(m.into())) - // Standard Error: 1_539 - .saturating_add(Weight::from_parts(187_932, 0).saturating_mul(p.into())) + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 25_385_000 picoseconds. + Weight::from_parts(29_288_474, 4062) + // Standard Error: 1_477 + .saturating_add(Weight::from_parts(33_804, 0).saturating_mul(m.into())) + // Standard Error: 1_441 + .saturating_add(Weight::from_parts(182_270, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -612,16 +612,16 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1063 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4377 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 44_484_000 picoseconds. - Weight::from_parts(46_132_232, 4377) - // Standard Error: 176 - .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) - // Standard Error: 1_869 - .saturating_add(Weight::from_parts(38_409, 0).saturating_mul(m.into())) - // Standard Error: 1_822 - .saturating_add(Weight::from_parts(204_440, 0).saturating_mul(p.into())) + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 41_816_000 picoseconds. + Weight::from_parts(45_174_137, 4380) + // Standard Error: 163 + .saturating_add(Weight::from_parts(2_359, 0).saturating_mul(b.into())) + // Standard Error: 1_729 + .saturating_add(Weight::from_parts(32_544, 0).saturating_mul(m.into())) + // Standard Error: 1_685 + .saturating_add(Weight::from_parts(214_308, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -637,22 +637,22 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `425 + p * (32 ±0)` - // Estimated: `1907 + p * (32 ±0)` - // Minimum execution time: 13_038_000 picoseconds. - Weight::from_parts(15_927_614, 1907) - // Standard Error: 1_583 - .saturating_add(Weight::from_parts(157_773, 0).saturating_mul(p.into())) + // Measured: `392 + p * (32 ±0)` + // Estimated: `1877 + p * (32 ±0)` + // Minimum execution time: 12_073_000 picoseconds. + Weight::from_parts(14_467_711, 1877) + // Standard Error: 1_267 + .saturating_add(Weight::from_parts(163_628, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } /// Storage: `Council::CostOf` (r:1 w:1) /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -663,14 +663,14 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `609 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3980 + d * (1883 ±7) + p * (38 ±0)` - // Minimum execution time: 14_324_000 picoseconds. - Weight::from_parts(12_207_388, 3980) - // Standard Error: 293_542 - .saturating_add(Weight::from_parts(29_417_624, 0).saturating_mul(d.into())) - // Standard Error: 4_545 - .saturating_add(Weight::from_parts(230_391, 0).saturating_mul(p.into())) + // Measured: `613 + d * (212 ±0) + p * (36 ±0)` + // Estimated: `3986 + d * (1883 ±0) + p * (38 ±0)` + // Minimum execution time: 13_608_000 picoseconds. + Weight::from_parts(9_166_865, 3986) + // Standard Error: 332_782 + .saturating_add(Weight::from_parts(33_940_315, 0).saturating_mul(d.into())) + // Standard Error: 5_153 + .saturating_add(Weight::from_parts(257_590, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -689,12 +689,12 @@ impl WeightInfo for () { /// The range of component `d` is `[0, 1]`. fn release_proposal_cost(d: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1748 + d * (212 ±0)` - // Estimated: `5213 + d * (1883 ±0)` - // Minimum execution time: 16_584_000 picoseconds. - Weight::from_parts(17_348_765, 5213) - // Standard Error: 47_417 - .saturating_add(Weight::from_parts(40_411_534, 0).saturating_mul(d.into())) + // Measured: `1752 + d * (212 ±0)` + // Estimated: `5217 + d * (1883 ±0)` + // Minimum execution time: 16_238_000 picoseconds. + Weight::from_parts(17_120_118, 5217) + // Standard Error: 49_551 + .saturating_add(Weight::from_parts(42_271_981, 0).saturating_mul(d.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) From f505e780767f14fa43b477f6721582e100888d54 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 31 Jul 2024 15:03:40 +0200 Subject: [PATCH 26/49] fix import --- substrate/frame/collective/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index cc72ff8bd136..688c01117cb3 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -190,9 +190,9 @@ pub struct Votes { /// 3. Geometrically increasing with rounding. /// #[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] pub mod deposit { + use core::marker::PhantomData; use sp_core::Get; use sp_runtime::{traits::Convert, FixedPointNumber, FixedU128, Saturating}; - use sp_std::marker::PhantomData; /// Constant deposit amount regardless of current proposal count. /// Returns `None` if configured with zero deposit. From de9a1239b1115cf49389189a1c1ab5f42c4568f0 Mon Sep 17 00:00:00 2001 From: muharem Date: Fri, 2 Aug 2024 12:51:35 +0200 Subject: [PATCH 27/49] fixes --- .../frame/collective/src/benchmarking.rs | 16 +- substrate/frame/collective/src/lib.rs | 29 +- substrate/frame/collective/src/tests.rs | 6 + substrate/frame/collective/src/weights.rs | 414 ++++++++---------- 4 files changed, 215 insertions(+), 250 deletions(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index 2d81a9cc61db..684c10eb7461 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -828,9 +828,8 @@ mod benchmarks { Ok(()) } - // d: `0` - if deposit is not present and `1` otherwise. #[benchmark] - fn release_proposal_cost(d: Linear<0, 1>) -> Result<(), BenchmarkError> { + fn release_proposal_cost() -> Result<(), BenchmarkError> { let m = 3; let p = T::MaxProposals::get(); let b = MAX_BYTES; @@ -872,11 +871,6 @@ mod benchmarks { System::::set_block_number(BlockNumberFor::::max_value()); assert_eq!(Proposals::::get().len(), p as usize); - if d == 0 { - CostOf::::remove(last_hash); - } - let cost_present = CostOf::::get(last_hash).is_some(); - assert_eq!(Proposals::::get().len(), p as usize); let _ = Collective::::remove_proposal(last_hash); assert_eq!(Proposals::::get().len(), (p - 1) as usize); @@ -885,11 +879,9 @@ mod benchmarks { _(SystemOrigin::Signed(caller.clone()), last_hash); assert_eq!(CostOf::::get(last_hash), None); - if cost_present { - assert_last_event::( - Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), - ); - } + assert_last_event::( + Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), + ); Ok(()) } diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 688c01117cb3..a8520ed1fba3 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -362,10 +362,14 @@ pub mod pallet { #[pallet::constant] type MaxProposalWeight: Get; - /// Origin from which any proposal may be disapproved. + /// Origin from which a proposal in any status may be disapproved without associated cost + /// for a proposer. type DisapproveOrigin: EnsureOrigin<::RuntimeOrigin>; - /// Origin from which any proposal may be killed. + /// Origin from which any malicious proposal may be killed with associated cost for a + /// proposer. + /// + /// The associated cost is set by [`Config::Consideration`] and can be none. type KillOrigin: EnsureOrigin<::RuntimeOrigin>; /// Mechanism to assess the necessity of some cost for publishing and storing a proposal. @@ -509,6 +513,8 @@ pub mod pallet { PrimeAccountNotMember, /// Proposal is still active. ProposalActive, + /// No associated cost for the proposal. + NoCost, } #[pallet::hooks] @@ -831,6 +837,10 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::kill(1, T::MaxProposals::get()))] pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { T::KillOrigin::ensure_origin(origin)?; + ensure!( + ProposalOf::::get(&proposal_hash).is_some(), + Error::::ProposalMissing + ); let burned = if let Some((who, cost)) = >::take(proposal_hash) { cost.burn(&who); Self::deposit_event(Event::ProposalCostBurned { proposal_hash, who }); @@ -853,7 +863,7 @@ pub mod pallet { /// /// Emits `ProposalCostReleased` if any cost held for a given proposal. #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::release_proposal_cost(1))] + #[pallet::weight(T::WeightInfo::release_proposal_cost())] pub fn release_proposal_cost( origin: OriginFor, proposal_hash: T::Hash, @@ -863,14 +873,11 @@ pub mod pallet { ProposalOf::::get(&proposal_hash).is_none(), Error::::ProposalActive ); - let dropped = if let Some((who, cost)) = >::take(proposal_hash) { - let _ = cost.drop(&who)?; - Self::deposit_event(Event::ProposalCostReleased { proposal_hash, who }); - true - } else { - false - }; - Ok(Some(T::WeightInfo::release_proposal_cost(dropped as u32)).into()) + let (who, cost) = >::take(proposal_hash).ok_or(Error::::NoCost)?; + let _ = cost.drop(&who)?; + Self::deposit_event(Event::ProposalCostReleased { proposal_hash, who }); + + Ok(Some(T::WeightInfo::release_proposal_cost()).into()) } } } diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 830c019d223e..ed179e9891c2 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -1601,6 +1601,12 @@ fn kill_proposal_with_deposit() { let balance = Balances::total_balance(&1); System::reset_events(); + let unpublished = make_proposal((ProposalDepositDelay::get() + 1).into()); + assert_noop!( + Collective::kill(RuntimeOrigin::root(), BlakeTwo256::hash_of(&unpublished)), + Error::::ProposalMissing + ); + assert_ok!(Collective::kill(RuntimeOrigin::root(), last_hash.unwrap())); assert_eq!(Balances::total_balance(&1), balance - last_deposit.unwrap()); diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 2b0fab7eb492..a8fad66eef8c 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,25 +18,23 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-02, STEPS: `20`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-7wrmsoux-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// target/production/substrate-node +// ./target/debug/substrate-node // benchmark // pallet -// --steps=50 -// --repeat=20 +// --chain=dev +// --steps=20 +// --repeat=2 +// --pallet=pallet-collective // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json -// --pallet=pallet_collective -// --chain=dev -// --header=./substrate/HEADER-APACHE2 -// --output=./substrate/frame/collective/src/weights.rs +// --output=./substrate/frame/collective/src/._weights0.rs // --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -60,7 +58,7 @@ pub trait WeightInfo { fn close_approved(b: u32, m: u32, p: u32, ) -> Weight; fn disapprove_proposal(p: u32, ) -> Weight; fn kill(d: u32, p: u32, ) -> Weight; - fn release_proposal_cost(d: u32, ) -> Weight; + fn release_proposal_cost() -> Weight; } /// Weights for `pallet_collective` using the Substrate node and recommended hardware. @@ -80,19 +78,19 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 14_908_000 picoseconds. - Weight::from_parts(15_068_000, 15894) - // Standard Error: 57_938 - .saturating_add(Weight::from_parts(4_395_036, 0).saturating_mul(m.into())) - // Standard Error: 57_938 - .saturating_add(Weight::from_parts(7_882_901, 0).saturating_mul(p.into())) + // Estimated: `32930 + m * (1964 ±85) + p * (4242 ±85)` + // Minimum execution time: 95_000_000 picoseconds. + Weight::from_parts(95_000_000, 32930) + // Standard Error: 1_319_711 + .saturating_add(Weight::from_parts(7_345_241, 0).saturating_mul(m.into())) + // Standard Error: 1_319_711 + .saturating_add(Weight::from_parts(45_344_411, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -102,16 +100,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn execute(b: u32, m: u32, ) -> Weight { + fn execute(_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_307_000 picoseconds. - Weight::from_parts(16_380_063, 3997) - // Standard Error: 26 - .saturating_add(Weight::from_parts(1_606, 0).saturating_mul(b.into())) - // Standard Error: 275 - .saturating_add(Weight::from_parts(16_346, 0).saturating_mul(m.into())) + // Minimum execution time: 163_000_000 picoseconds. + Weight::from_parts(175_361_364, 3997) + // Standard Error: 64_811 + .saturating_add(Weight::from_parts(55_369, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -125,16 +121,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { + fn propose_execute(_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_090_000 picoseconds. - Weight::from_parts(18_332_223, 3997) - // Standard Error: 30 - .saturating_add(Weight::from_parts(1_767, 0).saturating_mul(b.into())) - // Standard Error: 315 - .saturating_add(Weight::from_parts(27_065, 0).saturating_mul(m.into())) + // Minimum execution time: 185_000_000 picoseconds. + Weight::from_parts(198_658_525, 3997) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -157,18 +149,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `618 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 20_909_000 picoseconds. - Weight::from_parts(55_746_293, 3991) - // Standard Error: 424 - .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(b.into())) - // Standard Error: 4_428 - .saturating_add(Weight::from_parts(42_332, 0).saturating_mul(m.into())) - // Standard Error: 4_372 - .saturating_add(Weight::from_parts(231_808, 0).saturating_mul(p.into())) + // Measured: `688 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `4011 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 196_000_000 picoseconds. + Weight::from_parts(659_251_254, 4011) + // Standard Error: 26_959 + .saturating_add(Weight::from_parts(2_243, 0).saturating_mul(b.into())) + // Standard Error: 277_134 + .saturating_add(Weight::from_parts(2_708_228, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -179,12 +169,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1011 + m * (64 ±0)` + // Measured: `1010 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_947_000 picoseconds. - Weight::from_parts(23_913_673, 4475) - // Standard Error: 780 - .saturating_add(Weight::from_parts(38_053, 0).saturating_mul(m.into())) + // Minimum execution time: 166_000_000 picoseconds. + Weight::from_parts(180_136_842, 4475) + // Standard Error: 135_641 + .saturating_add(Weight::from_parts(72_631, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -201,18 +191,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `600 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 22_981_000 picoseconds. - Weight::from_parts(25_766_411, 4042) - // Standard Error: 1_610 - .saturating_add(Weight::from_parts(16_430, 0).saturating_mul(m.into())) - // Standard Error: 1_570 - .saturating_add(Weight::from_parts(202_896, 0).saturating_mul(p.into())) + // Measured: `637 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4005 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 215_000_000 picoseconds. + Weight::from_parts(245_242_161, 4005) + // Standard Error: 103_781 + .saturating_add(Weight::from_parts(2_059_924, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -231,20 +219,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_266_000 picoseconds. - Weight::from_parts(43_310_998, 4360) - // Standard Error: 162 - .saturating_add(Weight::from_parts(2_462, 0).saturating_mul(b.into())) - // Standard Error: 1_715 - .saturating_add(Weight::from_parts(29_231, 0).saturating_mul(m.into())) - // Standard Error: 1_671 - .saturating_add(Weight::from_parts(213_172, 0).saturating_mul(p.into())) + // Measured: `1092 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4407 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 385_000_000 picoseconds. + Weight::from_parts(61_638_538, 4407) + // Standard Error: 110_605 + .saturating_add(Weight::from_parts(163_938, 0).saturating_mul(b.into())) + // Standard Error: 1_175_118 + .saturating_add(Weight::from_parts(1_628_095, 0).saturating_mul(m.into())) + // Standard Error: 1_136_981 + .saturating_add(Weight::from_parts(3_512_979, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -261,18 +249,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `620 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 25_385_000 picoseconds. - Weight::from_parts(29_288_474, 4062) - // Standard Error: 1_477 - .saturating_add(Weight::from_parts(33_804, 0).saturating_mul(m.into())) - // Standard Error: 1_441 - .saturating_add(Weight::from_parts(182_270, 0).saturating_mul(p.into())) + // Measured: `657 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4025 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 234_000_000 picoseconds. + Weight::from_parts(1_086_700_196, 4025) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -293,20 +277,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_816_000 picoseconds. - Weight::from_parts(45_174_137, 4380) - // Standard Error: 163 - .saturating_add(Weight::from_parts(2_359, 0).saturating_mul(b.into())) - // Standard Error: 1_729 - .saturating_add(Weight::from_parts(32_544, 0).saturating_mul(m.into())) - // Standard Error: 1_685 - .saturating_add(Weight::from_parts(214_308, 0).saturating_mul(p.into())) + // Measured: `1112 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4427 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 421_000_000 picoseconds. + Weight::from_parts(390_423_888, 4427) + // Standard Error: 22_167 + .saturating_add(Weight::from_parts(4_001, 0).saturating_mul(b.into())) + // Standard Error: 235_521 + .saturating_add(Weight::from_parts(290_446, 0).saturating_mul(m.into())) + // Standard Error: 227_877 + .saturating_add(Weight::from_parts(2_475_514, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -318,16 +302,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + p * (32 ±0)` + // Measured: `391 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 12_073_000 picoseconds. - Weight::from_parts(14_467_711, 1877) - // Standard Error: 1_267 - .saturating_add(Weight::from_parts(163_628, 0).saturating_mul(p.into())) + // Minimum execution time: 129_000_000 picoseconds. + Weight::from_parts(163_744_221, 1877) + // Standard Error: 2_390_355 + .saturating_add(Weight::from_parts(2_666_948, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::CostOf` (r:1 w:1) /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -338,26 +324,24 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[0, 1]`. /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `613 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3986 + d * (1883 ±0) + p * (38 ±0)` - // Minimum execution time: 13_608_000 picoseconds. - Weight::from_parts(9_166_865, 3986) - // Standard Error: 332_782 - .saturating_add(Weight::from_parts(33_940_315, 0).saturating_mul(d.into())) - // Standard Error: 5_153 - .saturating_add(Weight::from_parts(257_590, 0).saturating_mul(p.into())) + // Measured: `1941 + d * (212 ±0) + p * (40 ±0)` + // Estimated: `5127 + d * (1883 ±70) + p * (43 ±0)` + // Minimum execution time: 184_000_000 picoseconds. + Weight::from_parts(119_683_217, 5127) + // Standard Error: 23_708_587 + .saturating_add(Weight::from_parts(326_152_633, 0).saturating_mul(d.into())) + // Standard Error: 328_942 + .saturating_add(Weight::from_parts(3_115_167, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -367,19 +351,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) - /// The range of component `d` is `[0, 1]`. - fn release_proposal_cost(d: u32, ) -> Weight { + fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: - // Measured: `1752 + d * (212 ±0)` - // Estimated: `5217 + d * (1883 ±0)` - // Minimum execution time: 16_238_000 picoseconds. - Weight::from_parts(17_120_118, 5217) - // Standard Error: 49_551 - .saturating_add(Weight::from_parts(42_271_981, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + // Measured: `1964` + // Estimated: `5429` + // Minimum execution time: 577_000_000 picoseconds. + Weight::from_parts(588_000_000, 5429) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } } @@ -399,19 +378,19 @@ impl WeightInfo for () { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 14_908_000 picoseconds. - Weight::from_parts(15_068_000, 15894) - // Standard Error: 57_938 - .saturating_add(Weight::from_parts(4_395_036, 0).saturating_mul(m.into())) - // Standard Error: 57_938 - .saturating_add(Weight::from_parts(7_882_901, 0).saturating_mul(p.into())) + // Estimated: `32930 + m * (1964 ±85) + p * (4242 ±85)` + // Minimum execution time: 95_000_000 picoseconds. + Weight::from_parts(95_000_000, 32930) + // Standard Error: 1_319_711 + .saturating_add(Weight::from_parts(7_345_241, 0).saturating_mul(m.into())) + // Standard Error: 1_319_711 + .saturating_add(Weight::from_parts(45_344_411, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -421,16 +400,14 @@ impl WeightInfo for () { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn execute(b: u32, m: u32, ) -> Weight { + fn execute(_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_307_000 picoseconds. - Weight::from_parts(16_380_063, 3997) - // Standard Error: 26 - .saturating_add(Weight::from_parts(1_606, 0).saturating_mul(b.into())) - // Standard Error: 275 - .saturating_add(Weight::from_parts(16_346, 0).saturating_mul(m.into())) + // Minimum execution time: 163_000_000 picoseconds. + Weight::from_parts(175_361_364, 3997) + // Standard Error: 64_811 + .saturating_add(Weight::from_parts(55_369, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -444,16 +421,12 @@ impl WeightInfo for () { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { + fn propose_execute(_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_090_000 picoseconds. - Weight::from_parts(18_332_223, 3997) - // Standard Error: 30 - .saturating_add(Weight::from_parts(1_767, 0).saturating_mul(b.into())) - // Standard Error: 315 - .saturating_add(Weight::from_parts(27_065, 0).saturating_mul(m.into())) + // Minimum execution time: 185_000_000 picoseconds. + Weight::from_parts(198_658_525, 3997) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -476,18 +449,16 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `618 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 20_909_000 picoseconds. - Weight::from_parts(55_746_293, 3991) - // Standard Error: 424 - .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(b.into())) - // Standard Error: 4_428 - .saturating_add(Weight::from_parts(42_332, 0).saturating_mul(m.into())) - // Standard Error: 4_372 - .saturating_add(Weight::from_parts(231_808, 0).saturating_mul(p.into())) + // Measured: `688 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `4011 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 196_000_000 picoseconds. + Weight::from_parts(659_251_254, 4011) + // Standard Error: 26_959 + .saturating_add(Weight::from_parts(2_243, 0).saturating_mul(b.into())) + // Standard Error: 277_134 + .saturating_add(Weight::from_parts(2_708_228, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -498,12 +469,12 @@ impl WeightInfo for () { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1011 + m * (64 ±0)` + // Measured: `1010 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_947_000 picoseconds. - Weight::from_parts(23_913_673, 4475) - // Standard Error: 780 - .saturating_add(Weight::from_parts(38_053, 0).saturating_mul(m.into())) + // Minimum execution time: 166_000_000 picoseconds. + Weight::from_parts(180_136_842, 4475) + // Standard Error: 135_641 + .saturating_add(Weight::from_parts(72_631, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -520,18 +491,16 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `600 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 22_981_000 picoseconds. - Weight::from_parts(25_766_411, 4042) - // Standard Error: 1_610 - .saturating_add(Weight::from_parts(16_430, 0).saturating_mul(m.into())) - // Standard Error: 1_570 - .saturating_add(Weight::from_parts(202_896, 0).saturating_mul(p.into())) + // Measured: `637 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4005 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 215_000_000 picoseconds. + Weight::from_parts(245_242_161, 4005) + // Standard Error: 103_781 + .saturating_add(Weight::from_parts(2_059_924, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -550,20 +519,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_266_000 picoseconds. - Weight::from_parts(43_310_998, 4360) - // Standard Error: 162 - .saturating_add(Weight::from_parts(2_462, 0).saturating_mul(b.into())) - // Standard Error: 1_715 - .saturating_add(Weight::from_parts(29_231, 0).saturating_mul(m.into())) - // Standard Error: 1_671 - .saturating_add(Weight::from_parts(213_172, 0).saturating_mul(p.into())) + // Measured: `1092 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4407 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 385_000_000 picoseconds. + Weight::from_parts(61_638_538, 4407) + // Standard Error: 110_605 + .saturating_add(Weight::from_parts(163_938, 0).saturating_mul(b.into())) + // Standard Error: 1_175_118 + .saturating_add(Weight::from_parts(1_628_095, 0).saturating_mul(m.into())) + // Standard Error: 1_136_981 + .saturating_add(Weight::from_parts(3_512_979, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -580,18 +549,14 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `620 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 25_385_000 picoseconds. - Weight::from_parts(29_288_474, 4062) - // Standard Error: 1_477 - .saturating_add(Weight::from_parts(33_804, 0).saturating_mul(m.into())) - // Standard Error: 1_441 - .saturating_add(Weight::from_parts(182_270, 0).saturating_mul(p.into())) + // Measured: `657 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `4025 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 234_000_000 picoseconds. + Weight::from_parts(1_086_700_196, 4025) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -612,20 +577,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_816_000 picoseconds. - Weight::from_parts(45_174_137, 4380) - // Standard Error: 163 - .saturating_add(Weight::from_parts(2_359, 0).saturating_mul(b.into())) - // Standard Error: 1_729 - .saturating_add(Weight::from_parts(32_544, 0).saturating_mul(m.into())) - // Standard Error: 1_685 - .saturating_add(Weight::from_parts(214_308, 0).saturating_mul(p.into())) + // Measured: `1112 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4427 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 421_000_000 picoseconds. + Weight::from_parts(390_423_888, 4427) + // Standard Error: 22_167 + .saturating_add(Weight::from_parts(4_001, 0).saturating_mul(b.into())) + // Standard Error: 235_521 + .saturating_add(Weight::from_parts(290_446, 0).saturating_mul(m.into())) + // Standard Error: 227_877 + .saturating_add(Weight::from_parts(2_475_514, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -637,16 +602,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + p * (32 ±0)` + // Measured: `391 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 12_073_000 picoseconds. - Weight::from_parts(14_467_711, 1877) - // Standard Error: 1_267 - .saturating_add(Weight::from_parts(163_628, 0).saturating_mul(p.into())) + // Minimum execution time: 129_000_000 picoseconds. + Weight::from_parts(163_744_221, 1877) + // Standard Error: 2_390_355 + .saturating_add(Weight::from_parts(2_666_948, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Council::CostOf` (r:1 w:1) /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -657,26 +624,24 @@ impl WeightInfo for () { /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[0, 1]`. /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `613 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3986 + d * (1883 ±0) + p * (38 ±0)` - // Minimum execution time: 13_608_000 picoseconds. - Weight::from_parts(9_166_865, 3986) - // Standard Error: 332_782 - .saturating_add(Weight::from_parts(33_940_315, 0).saturating_mul(d.into())) - // Standard Error: 5_153 - .saturating_add(Weight::from_parts(257_590, 0).saturating_mul(p.into())) + // Measured: `1941 + d * (212 ±0) + p * (40 ±0)` + // Estimated: `5127 + d * (1883 ±70) + p * (43 ±0)` + // Minimum execution time: 184_000_000 picoseconds. + Weight::from_parts(119_683_217, 5127) + // Standard Error: 23_708_587 + .saturating_add(Weight::from_parts(326_152_633, 0).saturating_mul(d.into())) + // Standard Error: 328_942 + .saturating_add(Weight::from_parts(3_115_167, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -686,18 +651,13 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) - /// The range of component `d` is `[0, 1]`. - fn release_proposal_cost(d: u32, ) -> Weight { + fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: - // Measured: `1752 + d * (212 ±0)` - // Estimated: `5217 + d * (1883 ±0)` - // Minimum execution time: 16_238_000 picoseconds. - Weight::from_parts(17_120_118, 5217) - // Standard Error: 49_551 - .saturating_add(Weight::from_parts(42_271_981, 0).saturating_mul(d.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + // Measured: `1964` + // Estimated: `5429` + // Minimum execution time: 577_000_000 picoseconds. + Weight::from_parts(588_000_000, 5429) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } } From 692e62d1036b23112445e6c22075ce2f8f373c1f Mon Sep 17 00:00:00 2001 From: Muharem Date: Fri, 2 Aug 2024 12:52:07 +0200 Subject: [PATCH 28/49] Apply suggestions from code review Co-authored-by: Oliver Tale-Yazdi --- substrate/frame/collective/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index a8520ed1fba3..0920295f0a32 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -182,13 +182,13 @@ pub struct Votes { /// ### Example: /// /// 1. Linear increasing with helper types. -/// #[doc = docify::embed!("src/tests.rs", deposit_types_with_linear_work)] +#[doc = docify::embed!("src/tests.rs", deposit_types_with_linear_work)] /// /// 2. Geometrically increasing with helper types. -/// #[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] +#[doc = docify::embed!("src/tests.rs", deposit_types_with_geometric_work)] /// /// 3. Geometrically increasing with rounding. -/// #[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] +#[doc = docify::embed!("src/tests.rs", deposit_round_with_geometric_work)] pub mod deposit { use core::marker::PhantomData; use sp_core::Get; From 5ee243903a6161c56224877bfe9f1edcaa00adc5 Mon Sep 17 00:00:00 2001 From: muharem Date: Fri, 2 Aug 2024 13:18:44 +0200 Subject: [PATCH 29/49] fix weights --- .../collectives-westend/src/weights/pallet_collective.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index ec9fc62e28e5..e5e11d372526 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -341,7 +341,7 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Storage: `Balances::Holds` (r:1 w:1) /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. - fn release_proposal_cost(d: u32, ) -> Weight { + fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (212 ±0)` From fbddc7aa24d5405543a12226a774f72d798d56e4 Mon Sep 17 00:00:00 2001 From: muharem Date: Fri, 2 Aug 2024 14:44:47 +0200 Subject: [PATCH 30/49] fix weights --- .../collectives-westend/src/weights/pallet_collective.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index e5e11d372526..11e760429eac 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -342,6 +342,7 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 1]`. fn release_proposal_cost() -> Weight { + let d = 1u64; // Proof Size summary in bytes: // Measured: `1748 + d * (212 ±0)` // Estimated: `5213 + d * (212 ±0)` From 33965f884fdb8365a642f77fd5785840fe2a08cc Mon Sep 17 00:00:00 2001 From: muharem Date: Fri, 2 Aug 2024 16:36:22 +0200 Subject: [PATCH 31/49] collectives westend collective pallet weights --- .../src/weights/pallet_collective.rs | 287 ++++++++---------- 1 file changed, 126 insertions(+), 161 deletions(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index 11e760429eac..498cba3520d5 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -15,28 +15,24 @@ //! Autogenerated weights for `pallet_collective` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-08-02, STEPS: `20`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-polkadot-dev")`, DB CACHE: 1024 +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-westend-dev")`, DB CACHE: 1024 // Executed Command: -// ./target/production/polkadot-parachain +// ./target/debug/polkadot-parachain // benchmark // pallet -// --chain=collectives-polkadot-dev -// --wasm-execution=compiled -// --pallet=pallet_collective -// --no-storage-info -// --no-median-slopes -// --no-min-squares +// --chain=collectives-westend-dev +// --steps=20 +// --repeat=2 +// --pallet=pallet-collective // --extrinsic=* -// --steps=50 -// --repeat=20 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/ +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,20 +59,20 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15691 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 16_410_000 picoseconds. - Weight::from_parts(16_816_000, 0) - .saturating_add(Weight::from_parts(0, 15691)) - // Standard Error: 59_812 - .saturating_add(Weight::from_parts(4_516_537, 0).saturating_mul(m.into())) - // Standard Error: 59_812 - .saturating_add(Weight::from_parts(7_992_168, 0).saturating_mul(p.into())) + // Estimated: `32764 + m * (1964 ±96) + p * (4242 ±96)` + // Minimum execution time: 96_000_000 picoseconds. + Weight::from_parts(96_000_000, 0) + .saturating_add(Weight::from_parts(0, 32764)) + // Standard Error: 2_641_144 + .saturating_add(Weight::from_parts(6_072_464, 0).saturating_mul(m.into())) + // Standard Error: 2_641_144 + .saturating_add(Weight::from_parts(41_969_561, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Members` (r:1 w:0) /// Proof: `AllianceMotion::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -84,15 +80,13 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `32 + m * (32 ±0)` - // Estimated: `1518 + m * (32 ±0)` - // Minimum execution time: 14_418_000 picoseconds. - Weight::from_parts(13_588_617, 0) - .saturating_add(Weight::from_parts(0, 1518)) - // Standard Error: 21 - .saturating_add(Weight::from_parts(1_711, 0).saturating_mul(b.into())) - // Standard Error: 223 - .saturating_add(Weight::from_parts(13_836, 0).saturating_mul(m.into())) + // Measured: `69 + m * (32 ±0)` + // Estimated: `1554 + m * (32 ±0)` + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(119_828_337, 0) + .saturating_add(Weight::from_parts(0, 1554)) + // Standard Error: 2_218 + .saturating_add(Weight::from_parts(657, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -102,17 +96,13 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { + fn propose_execute(_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `32 + m * (32 ±0)` - // Estimated: `3498 + m * (32 ±0)` - // Minimum execution time: 17_174_000 picoseconds. - Weight::from_parts(16_192_764, 0) - .saturating_add(Weight::from_parts(0, 3498)) - // Standard Error: 27 - .saturating_add(Weight::from_parts(1_672, 0).saturating_mul(b.into())) - // Standard Error: 280 - .saturating_add(Weight::from_parts(24_343, 0).saturating_mul(m.into())) + // Measured: `69 + m * (32 ±0)` + // Estimated: `3534 + m * (32 ±0)` + // Minimum execution time: 134_000_000 picoseconds. + Weight::from_parts(147_058_362, 0) + .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -126,24 +116,24 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `AllianceMotion::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `AllianceMotion::Voting` (r:0 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::CostOf` (r:0 w:1) + /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `322 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3714 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 23_970_000 picoseconds. - Weight::from_parts(23_004_052, 0) - .saturating_add(Weight::from_parts(0, 3714)) - // Standard Error: 123 - .saturating_add(Weight::from_parts(2_728, 0).saturating_mul(b.into())) - // Standard Error: 1_291 - .saturating_add(Weight::from_parts(32_731, 0).saturating_mul(m.into())) - // Standard Error: 1_275 - .saturating_add(Weight::from_parts(199_537, 0).saturating_mul(p.into())) + // Measured: `466 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3803 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 205_000_000 picoseconds. + Weight::from_parts(276_229_342, 0) + .saturating_add(Weight::from_parts(0, 3803)) + // Standard Error: 29_842 + .saturating_add(Weight::from_parts(25_636, 0).saturating_mul(b.into())) + // Standard Error: 306_767 + .saturating_add(Weight::from_parts(2_075_139, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -154,13 +144,11 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `771 + m * (64 ±0)` - // Estimated: `4235 + m * (64 ±0)` - // Minimum execution time: 25_843_000 picoseconds. - Weight::from_parts(26_092_578, 0) - .saturating_add(Weight::from_parts(0, 4235)) - // Standard Error: 1_785 - .saturating_add(Weight::from_parts(67_298, 0).saturating_mul(m.into())) + // Measured: `844 + m * (64 ±0)` + // Estimated: `4309 + m * (64 ±0)` + // Minimum execution time: 161_000_000 picoseconds. + Weight::from_parts(180_878_947, 0) + .saturating_add(Weight::from_parts(0, 4309)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -177,19 +165,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `360 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3805 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_543_000 picoseconds. - Weight::from_parts(26_505_473, 0) - .saturating_add(Weight::from_parts(0, 3805)) - // Standard Error: 1_054 - .saturating_add(Weight::from_parts(35_295, 0).saturating_mul(m.into())) - // Standard Error: 1_028 - .saturating_add(Weight::from_parts(190_508, 0).saturating_mul(p.into())) + // Measured: `471 + m * (64 ±0) + p * (35 ±0)` + // Estimated: `3848 + m * (65 ±0) + p * (37 ±0)` + // Minimum execution time: 209_000_000 picoseconds. + Weight::from_parts(270_621_515, 0) + .saturating_add(Weight::from_parts(0, 3848)) + // Standard Error: 766_224 + .saturating_add(Weight::from_parts(2_167_428, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -204,21 +190,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `662 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `3979 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_375_000 picoseconds. - Weight::from_parts(34_081_294, 0) - .saturating_add(Weight::from_parts(0, 3979)) - // Standard Error: 196 - .saturating_add(Weight::from_parts(3_796, 0).saturating_mul(b.into())) - // Standard Error: 2_072 - .saturating_add(Weight::from_parts(50_954, 0).saturating_mul(m.into())) - // Standard Error: 2_020 - .saturating_add(Weight::from_parts(246_000, 0).saturating_mul(p.into())) + // Measured: `781 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4105 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 310_000_000 picoseconds. + Weight::from_parts(483_594_136, 0) + .saturating_add(Weight::from_parts(0, 4105)) + // Standard Error: 520_037 + .saturating_add(Weight::from_parts(1_901_254, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) @@ -235,19 +217,19 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `458 + m * (48 ±0) + p * (36 ±0)` - // Estimated: `3898 + m * (49 ±0) + p * (36 ±0)` - // Minimum execution time: 28_793_000 picoseconds. - Weight::from_parts(29_656_832, 0) - .saturating_add(Weight::from_parts(0, 3898)) - // Standard Error: 1_214 - .saturating_add(Weight::from_parts(22_148, 0).saturating_mul(m.into())) - // Standard Error: 1_184 - .saturating_add(Weight::from_parts(189_860, 0).saturating_mul(p.into())) + // Measured: `586 + m * (48 ±0) + p * (35 ±0)` + // Estimated: `3952 + m * (49 ±0) + p * (37 ±0)` + // Minimum execution time: 230_000_000 picoseconds. + Weight::from_parts(224_849_722, 0) + .saturating_add(Weight::from_parts(0, 3952)) + // Standard Error: 95_179 + .saturating_add(Weight::from_parts(81_183, 0).saturating_mul(m.into())) + // Standard Error: 92_074 + .saturating_add(Weight::from_parts(2_154_399, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -264,21 +246,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `682 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `3999 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_887_000 picoseconds. - Weight::from_parts(39_529_567, 0) - .saturating_add(Weight::from_parts(0, 3999)) - // Standard Error: 191 - .saturating_add(Weight::from_parts(2_802, 0).saturating_mul(b.into())) - // Standard Error: 2_021 - .saturating_add(Weight::from_parts(35_956, 0).saturating_mul(m.into())) - // Standard Error: 1_970 - .saturating_add(Weight::from_parts(235_154, 0).saturating_mul(p.into())) + // Measured: `801 + m * (64 ±0) + p * (39 ±0)` + // Estimated: `4125 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` + // Minimum execution time: 313_000_000 picoseconds. + Weight::from_parts(455_610_954, 0) + .saturating_add(Weight::from_parts(0, 4125)) + // Standard Error: 660_998 + .saturating_add(Weight::from_parts(2_191_935, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Proposals` (r:1 w:1) @@ -290,69 +268,56 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `189 + p * (32 ±0)` - // Estimated: `1674 + p * (32 ±0)` - // Minimum execution time: 14_040_000 picoseconds. - Weight::from_parts(15_075_964, 0) - .saturating_add(Weight::from_parts(0, 1674)) - // Standard Error: 854 - .saturating_add(Weight::from_parts(159_597, 0).saturating_mul(p.into())) + // Measured: `225 + p * (32 ±0)` + // Estimated: `1711 + p * (32 ±0)` + // Minimum execution time: 122_000_000 picoseconds. + Weight::from_parts(121_913_287, 0) + .saturating_add(Weight::from_parts(0, 1711)) + // Standard Error: 70_371 + .saturating_add(Weight::from_parts(1_931_302, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::ProposalOf` (r:1 w:1) + /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::CostOf` (r:1 w:1) + /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::Proposals` (r:1 w:1) + /// Proof: `AllianceMotion::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::Voting` (r:0 w:1) + /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[0, 1]`. /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `628 + d * (212 ±0) + p * (36 ±0)` - // Estimated: `3833 + d * (1820 ±73) + p * (39 ±0)` - // Minimum execution time: 141_000_000 picoseconds. - Weight::from_parts(12_681_542, 3833) - // Standard Error: 29_292_197 - .saturating_add(Weight::from_parts(293_163_636, 0).saturating_mul(d.into())) - // Standard Error: 396_965 - .saturating_add(Weight::from_parts(3_391_184, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1820).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(p.into())) + // Measured: `1778 + d * (38 ±0) + p * (40 ±0)` + // Estimated: `5046 + d * (259 ±60) + p * (42 ±0)` + // Minimum execution time: 214_000_000 picoseconds. + Weight::from_parts(38_793_624, 0) + .saturating_add(Weight::from_parts(0, 5046)) + // Standard Error: 72_183_295 + .saturating_add(Weight::from_parts(161_667_584, 0).saturating_mul(d.into())) + // Standard Error: 1_001_498 + .saturating_add(Weight::from_parts(3_712_063, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 259).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 42).saturating_mul(p.into())) } - /// Storage: `Council::ProposalOf` (r:1 w:0) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::DepositOf` (r:1 w:1) - /// Proof: `Council::DepositOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`) - /// The range of component `d` is `[0, 1]`. + /// Storage: `AllianceMotion::ProposalOf` (r:1 w:0) + /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AllianceMotion::CostOf` (r:1 w:1) + /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) fn release_proposal_cost() -> Weight { - let d = 1u64; // Proof Size summary in bytes: - // Measured: `1748 + d * (212 ±0)` - // Estimated: `5213 + d * (212 ±0)` - // Minimum execution time: 121_000_000 picoseconds. - Weight::from_parts(124_000_000, 5213) - // Standard Error: 1_897_366 - .saturating_add(Weight::from_parts(398_000_000, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 212).saturating_mul(d.into())) + // Measured: `1624` + // Estimated: `5089` + // Minimum execution time: 172_000_000 picoseconds. + Weight::from_parts(172_000_000, 0) + .saturating_add(Weight::from_parts(0, 5089)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } } From d3e76cbc29bcff20d4a37b8f0ce838e39881285d Mon Sep 17 00:00:00 2001 From: Muharem Date: Fri, 2 Aug 2024 16:36:53 +0200 Subject: [PATCH 32/49] Apply suggestions from code review --- prdoc/pr_3151.prdoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 598161f077a0..3c38380c9e5f 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -37,4 +37,5 @@ crates: bump: patch - name: pallet-preimage bump: patch - + - name: pallet-utility + bump: patch From 9b6dae2c4be60fd51d3932716a9681112f445721 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 5 Aug 2024 18:23:51 +0000 Subject: [PATCH 33/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 374 ++++++++++++---------- 1 file changed, 202 insertions(+), 172 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index a8fad66eef8c..73c2e2d1d239 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,23 +18,25 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-02, STEPS: `20`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `cob`, CPU: `` +//! HOSTNAME: `runner-696hpswk-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// ./target/debug/substrate-node +// target/production/substrate-node // benchmark // pallet -// --chain=dev -// --steps=20 -// --repeat=2 -// --pallet=pallet-collective +// --steps=50 +// --repeat=20 // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./substrate/frame/collective/src/._weights0.rs +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_collective +// --chain=dev +// --header=./substrate/HEADER-APACHE2 +// --output=./substrate/frame/collective/src/weights.rs // --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -78,19 +80,19 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `32930 + m * (1964 ±85) + p * (4242 ±85)` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(95_000_000, 32930) - // Standard Error: 1_319_711 - .saturating_add(Weight::from_parts(7_345_241, 0).saturating_mul(m.into())) - // Standard Error: 1_319_711 - .saturating_add(Weight::from_parts(45_344_411, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 14_366_000 picoseconds. + Weight::from_parts(14_700_000, 15894) + // Standard Error: 61_324 + .saturating_add(Weight::from_parts(4_652_692, 0).saturating_mul(m.into())) + // Standard Error: 61_324 + .saturating_add(Weight::from_parts(8_163_099, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -100,14 +102,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn execute(_b: u32, m: u32, ) -> Weight { + fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 163_000_000 picoseconds. - Weight::from_parts(175_361_364, 3997) - // Standard Error: 64_811 - .saturating_add(Weight::from_parts(55_369, 0).saturating_mul(m.into())) + // Minimum execution time: 17_253_000 picoseconds. + Weight::from_parts(16_325_671, 3997) + // Standard Error: 27 + .saturating_add(Weight::from_parts(1_623, 0).saturating_mul(b.into())) + // Standard Error: 281 + .saturating_add(Weight::from_parts(16_438, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -121,12 +125,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(_b: u32, m: u32, ) -> Weight { + fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 185_000_000 picoseconds. - Weight::from_parts(198_658_525, 3997) + // Minimum execution time: 19_013_000 picoseconds. + Weight::from_parts(18_358_483, 3997) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_576, 0).saturating_mul(b.into())) + // Standard Error: 370 + .saturating_add(Weight::from_parts(25_153, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -149,16 +157,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `688 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `4011 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 196_000_000 picoseconds. - Weight::from_parts(659_251_254, 4011) - // Standard Error: 26_959 - .saturating_add(Weight::from_parts(2_243, 0).saturating_mul(b.into())) - // Standard Error: 277_134 - .saturating_add(Weight::from_parts(2_708_228, 0).saturating_mul(p.into())) + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 20_120_000 picoseconds. + Weight::from_parts(52_868_753, 3991) + // Standard Error: 418 + .saturating_add(Weight::from_parts(3_489, 0).saturating_mul(b.into())) + // Standard Error: 4_368 + .saturating_add(Weight::from_parts(47_853, 0).saturating_mul(m.into())) + // Standard Error: 4_312 + .saturating_add(Weight::from_parts(245_221, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -169,12 +179,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1010 + m * (64 ±0)` + // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(180_136_842, 4475) - // Standard Error: 135_641 - .saturating_add(Weight::from_parts(72_631, 0).saturating_mul(m.into())) + // Minimum execution time: 22_634_000 picoseconds. + Weight::from_parts(23_587_202, 4475) + // Standard Error: 994 + .saturating_add(Weight::from_parts(45_472, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -191,16 +201,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `637 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4005 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 215_000_000 picoseconds. - Weight::from_parts(245_242_161, 4005) - // Standard Error: 103_781 - .saturating_add(Weight::from_parts(2_059_924, 0).saturating_mul(p.into())) + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 23_209_000 picoseconds. + Weight::from_parts(23_913_197, 4042) + // Standard Error: 1_184 + .saturating_add(Weight::from_parts(35_774, 0).saturating_mul(m.into())) + // Standard Error: 1_155 + .saturating_add(Weight::from_parts(175_992, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -219,20 +231,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1092 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4407 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 385_000_000 picoseconds. - Weight::from_parts(61_638_538, 4407) - // Standard Error: 110_605 - .saturating_add(Weight::from_parts(163_938, 0).saturating_mul(b.into())) - // Standard Error: 1_175_118 - .saturating_add(Weight::from_parts(1_628_095, 0).saturating_mul(m.into())) - // Standard Error: 1_136_981 - .saturating_add(Weight::from_parts(3_512_979, 0).saturating_mul(p.into())) + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_109_000 picoseconds. + Weight::from_parts(42_891_261, 4360) + // Standard Error: 225 + .saturating_add(Weight::from_parts(2_186, 0).saturating_mul(b.into())) + // Standard Error: 2_382 + .saturating_add(Weight::from_parts(27_251, 0).saturating_mul(m.into())) + // Standard Error: 2_322 + .saturating_add(Weight::from_parts(233_097, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -249,14 +261,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `657 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4025 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 234_000_000 picoseconds. - Weight::from_parts(1_086_700_196, 4025) + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 25_287_000 picoseconds. + Weight::from_parts(27_917_566, 4062) + // Standard Error: 1_643 + .saturating_add(Weight::from_parts(45_890, 0).saturating_mul(m.into())) + // Standard Error: 1_602 + .saturating_add(Weight::from_parts(179_446, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -277,20 +293,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1112 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4427 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 421_000_000 picoseconds. - Weight::from_parts(390_423_888, 4427) - // Standard Error: 22_167 - .saturating_add(Weight::from_parts(4_001, 0).saturating_mul(b.into())) - // Standard Error: 235_521 - .saturating_add(Weight::from_parts(290_446, 0).saturating_mul(m.into())) - // Standard Error: 227_877 - .saturating_add(Weight::from_parts(2_475_514, 0).saturating_mul(p.into())) + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 41_960_000 picoseconds. + Weight::from_parts(45_364_930, 4380) + // Standard Error: 199 + .saturating_add(Weight::from_parts(1_730, 0).saturating_mul(b.into())) + // Standard Error: 2_112 + .saturating_add(Weight::from_parts(31_890, 0).saturating_mul(m.into())) + // Standard Error: 2_058 + .saturating_add(Weight::from_parts(226_382, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -302,12 +318,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `391 + p * (32 ±0)` + // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 129_000_000 picoseconds. - Weight::from_parts(163_744_221, 1877) - // Standard Error: 2_390_355 - .saturating_add(Weight::from_parts(2_666_948, 0).saturating_mul(p.into())) + // Minimum execution time: 12_054_000 picoseconds. + Weight::from_parts(14_016_787, 1877) + // Standard Error: 1_192 + .saturating_add(Weight::from_parts(156_673, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -328,17 +344,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1941 + d * (212 ±0) + p * (40 ±0)` - // Estimated: `5127 + d * (1883 ±70) + p * (43 ±0)` - // Minimum execution time: 184_000_000 picoseconds. - Weight::from_parts(119_683_217, 5127) - // Standard Error: 23_708_587 - .saturating_add(Weight::from_parts(326_152_633, 0).saturating_mul(d.into())) - // Standard Error: 328_942 - .saturating_add(Weight::from_parts(3_115_167, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` + // Estimated: `5172 + d * (1883 ±14) + p * (43 ±0)` + // Minimum execution time: 17_791_000 picoseconds. + Weight::from_parts(18_951_908, 5172) + // Standard Error: 332_795 + .saturating_add(Weight::from_parts(29_380_055, 0).saturating_mul(d.into())) + // Standard Error: 5_153 + .saturating_add(Weight::from_parts(256_813, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) @@ -355,8 +371,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 577_000_000 picoseconds. - Weight::from_parts(588_000_000, 5429) + // Minimum execution time: 58_123_000 picoseconds. + Weight::from_parts(59_370_000, 5429) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -378,19 +394,19 @@ impl WeightInfo for () { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `32930 + m * (1964 ±85) + p * (4242 ±85)` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(95_000_000, 32930) - // Standard Error: 1_319_711 - .saturating_add(Weight::from_parts(7_345_241, 0).saturating_mul(m.into())) - // Standard Error: 1_319_711 - .saturating_add(Weight::from_parts(45_344_411, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 14_366_000 picoseconds. + Weight::from_parts(14_700_000, 15894) + // Standard Error: 61_324 + .saturating_add(Weight::from_parts(4_652_692, 0).saturating_mul(m.into())) + // Standard Error: 61_324 + .saturating_add(Weight::from_parts(8_163_099, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: `Council::Members` (r:1 w:0) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -400,14 +416,16 @@ impl WeightInfo for () { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn execute(_b: u32, m: u32, ) -> Weight { + fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 163_000_000 picoseconds. - Weight::from_parts(175_361_364, 3997) - // Standard Error: 64_811 - .saturating_add(Weight::from_parts(55_369, 0).saturating_mul(m.into())) + // Minimum execution time: 17_253_000 picoseconds. + Weight::from_parts(16_325_671, 3997) + // Standard Error: 27 + .saturating_add(Weight::from_parts(1_623, 0).saturating_mul(b.into())) + // Standard Error: 281 + .saturating_add(Weight::from_parts(16_438, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -421,12 +439,16 @@ impl WeightInfo for () { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(_b: u32, m: u32, ) -> Weight { + fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 185_000_000 picoseconds. - Weight::from_parts(198_658_525, 3997) + // Minimum execution time: 19_013_000 picoseconds. + Weight::from_parts(18_358_483, 3997) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_576, 0).saturating_mul(b.into())) + // Standard Error: 370 + .saturating_add(Weight::from_parts(25_153, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -449,16 +471,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `688 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `4011 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 196_000_000 picoseconds. - Weight::from_parts(659_251_254, 4011) - // Standard Error: 26_959 - .saturating_add(Weight::from_parts(2_243, 0).saturating_mul(b.into())) - // Standard Error: 277_134 - .saturating_add(Weight::from_parts(2_708_228, 0).saturating_mul(p.into())) + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 20_120_000 picoseconds. + Weight::from_parts(52_868_753, 3991) + // Standard Error: 418 + .saturating_add(Weight::from_parts(3_489, 0).saturating_mul(b.into())) + // Standard Error: 4_368 + .saturating_add(Weight::from_parts(47_853, 0).saturating_mul(m.into())) + // Standard Error: 4_312 + .saturating_add(Weight::from_parts(245_221, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -469,12 +493,12 @@ impl WeightInfo for () { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1010 + m * (64 ±0)` + // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 166_000_000 picoseconds. - Weight::from_parts(180_136_842, 4475) - // Standard Error: 135_641 - .saturating_add(Weight::from_parts(72_631, 0).saturating_mul(m.into())) + // Minimum execution time: 22_634_000 picoseconds. + Weight::from_parts(23_587_202, 4475) + // Standard Error: 994 + .saturating_add(Weight::from_parts(45_472, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -491,16 +515,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `637 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4005 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 215_000_000 picoseconds. - Weight::from_parts(245_242_161, 4005) - // Standard Error: 103_781 - .saturating_add(Weight::from_parts(2_059_924, 0).saturating_mul(p.into())) + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 23_209_000 picoseconds. + Weight::from_parts(23_913_197, 4042) + // Standard Error: 1_184 + .saturating_add(Weight::from_parts(35_774, 0).saturating_mul(m.into())) + // Standard Error: 1_155 + .saturating_add(Weight::from_parts(175_992, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -519,20 +545,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1092 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4407 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 385_000_000 picoseconds. - Weight::from_parts(61_638_538, 4407) - // Standard Error: 110_605 - .saturating_add(Weight::from_parts(163_938, 0).saturating_mul(b.into())) - // Standard Error: 1_175_118 - .saturating_add(Weight::from_parts(1_628_095, 0).saturating_mul(m.into())) - // Standard Error: 1_136_981 - .saturating_add(Weight::from_parts(3_512_979, 0).saturating_mul(p.into())) + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_109_000 picoseconds. + Weight::from_parts(42_891_261, 4360) + // Standard Error: 225 + .saturating_add(Weight::from_parts(2_186, 0).saturating_mul(b.into())) + // Standard Error: 2_382 + .saturating_add(Weight::from_parts(27_251, 0).saturating_mul(m.into())) + // Standard Error: 2_322 + .saturating_add(Weight::from_parts(233_097, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -549,14 +575,18 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `657 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `4025 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 234_000_000 picoseconds. - Weight::from_parts(1_086_700_196, 4025) + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 25_287_000 picoseconds. + Weight::from_parts(27_917_566, 4062) + // Standard Error: 1_643 + .saturating_add(Weight::from_parts(45_890, 0).saturating_mul(m.into())) + // Standard Error: 1_602 + .saturating_add(Weight::from_parts(179_446, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `Council::Voting` (r:1 w:1) /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -577,20 +607,20 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1112 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4427 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 421_000_000 picoseconds. - Weight::from_parts(390_423_888, 4427) - // Standard Error: 22_167 - .saturating_add(Weight::from_parts(4_001, 0).saturating_mul(b.into())) - // Standard Error: 235_521 - .saturating_add(Weight::from_parts(290_446, 0).saturating_mul(m.into())) - // Standard Error: 227_877 - .saturating_add(Weight::from_parts(2_475_514, 0).saturating_mul(p.into())) + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 41_960_000 picoseconds. + Weight::from_parts(45_364_930, 4380) + // Standard Error: 199 + .saturating_add(Weight::from_parts(1_730, 0).saturating_mul(b.into())) + // Standard Error: 2_112 + .saturating_add(Weight::from_parts(31_890, 0).saturating_mul(m.into())) + // Standard Error: 2_058 + .saturating_add(Weight::from_parts(226_382, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `Council::Proposals` (r:1 w:1) @@ -602,12 +632,12 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `391 + p * (32 ±0)` + // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 129_000_000 picoseconds. - Weight::from_parts(163_744_221, 1877) - // Standard Error: 2_390_355 - .saturating_add(Weight::from_parts(2_666_948, 0).saturating_mul(p.into())) + // Minimum execution time: 12_054_000 picoseconds. + Weight::from_parts(14_016_787, 1877) + // Standard Error: 1_192 + .saturating_add(Weight::from_parts(156_673, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -628,17 +658,17 @@ impl WeightInfo for () { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1941 + d * (212 ±0) + p * (40 ±0)` - // Estimated: `5127 + d * (1883 ±70) + p * (43 ±0)` - // Minimum execution time: 184_000_000 picoseconds. - Weight::from_parts(119_683_217, 5127) - // Standard Error: 23_708_587 - .saturating_add(Weight::from_parts(326_152_633, 0).saturating_mul(d.into())) - // Standard Error: 328_942 - .saturating_add(Weight::from_parts(3_115_167, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) + // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` + // Estimated: `5172 + d * (1883 ±14) + p * (43 ±0)` + // Minimum execution time: 17_791_000 picoseconds. + Weight::from_parts(18_951_908, 5172) + // Standard Error: 332_795 + .saturating_add(Weight::from_parts(29_380_055, 0).saturating_mul(d.into())) + // Standard Error: 5_153 + .saturating_add(Weight::from_parts(256_813, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) @@ -655,8 +685,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 577_000_000 picoseconds. - Weight::from_parts(588_000_000, 5429) + // Minimum execution time: 58_123_000 picoseconds. + Weight::from_parts(59_370_000, 5429) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } From f7a7742df6f3e0261e8aa7af4f661bccd994b3c6 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Tue, 6 Aug 2024 16:38:15 +0000 Subject: [PATCH 34/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 290 +++++++++++----------- 1 file changed, 145 insertions(+), 145 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 73c2e2d1d239..227629cf0c1d 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `runner-696hpswk-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` @@ -80,13 +80,13 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 14_366_000 picoseconds. - Weight::from_parts(14_700_000, 15894) - // Standard Error: 61_324 - .saturating_add(Weight::from_parts(4_652_692, 0).saturating_mul(m.into())) - // Standard Error: 61_324 - .saturating_add(Weight::from_parts(8_163_099, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 14_500_000 picoseconds. + Weight::from_parts(14_757_000, 15894) + // Standard Error: 59_477 + .saturating_add(Weight::from_parts(4_505_637, 0).saturating_mul(m.into())) + // Standard Error: 59_477 + .saturating_add(Weight::from_parts(7_968_384, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -106,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_253_000 picoseconds. - Weight::from_parts(16_325_671, 3997) - // Standard Error: 27 - .saturating_add(Weight::from_parts(1_623, 0).saturating_mul(b.into())) - // Standard Error: 281 - .saturating_add(Weight::from_parts(16_438, 0).saturating_mul(m.into())) + // Minimum execution time: 17_111_000 picoseconds. + Weight::from_parts(16_217_737, 3997) + // Standard Error: 28 + .saturating_add(Weight::from_parts(1_525, 0).saturating_mul(b.into())) + // Standard Error: 295 + .saturating_add(Weight::from_parts(17_164, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -129,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_013_000 picoseconds. - Weight::from_parts(18_358_483, 3997) - // Standard Error: 35 - .saturating_add(Weight::from_parts(1_576, 0).saturating_mul(b.into())) - // Standard Error: 370 - .saturating_add(Weight::from_parts(25_153, 0).saturating_mul(m.into())) + // Minimum execution time: 18_689_000 picoseconds. + Weight::from_parts(17_817_417, 3997) + // Standard Error: 32 + .saturating_add(Weight::from_parts(1_681, 0).saturating_mul(b.into())) + // Standard Error: 337 + .saturating_add(Weight::from_parts(27_384, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -159,14 +159,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 20_120_000 picoseconds. - Weight::from_parts(52_868_753, 3991) - // Standard Error: 418 - .saturating_add(Weight::from_parts(3_489, 0).saturating_mul(b.into())) - // Standard Error: 4_368 - .saturating_add(Weight::from_parts(47_853, 0).saturating_mul(m.into())) - // Standard Error: 4_312 - .saturating_add(Weight::from_parts(245_221, 0).saturating_mul(p.into())) + // Minimum execution time: 19_916_000 picoseconds. + Weight::from_parts(52_492_859, 3991) + // Standard Error: 424 + .saturating_add(Weight::from_parts(3_702, 0).saturating_mul(b.into())) + // Standard Error: 4_425 + .saturating_add(Weight::from_parts(57_614, 0).saturating_mul(m.into())) + // Standard Error: 4_369 + .saturating_add(Weight::from_parts(222_279, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -181,10 +181,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_634_000 picoseconds. - Weight::from_parts(23_587_202, 4475) - // Standard Error: 994 - .saturating_add(Weight::from_parts(45_472, 0).saturating_mul(m.into())) + // Minimum execution time: 22_683_000 picoseconds. + Weight::from_parts(23_460_909, 4475) + // Standard Error: 767 + .saturating_add(Weight::from_parts(40_650, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -203,12 +203,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 23_209_000 picoseconds. - Weight::from_parts(23_913_197, 4042) - // Standard Error: 1_184 - .saturating_add(Weight::from_parts(35_774, 0).saturating_mul(m.into())) - // Standard Error: 1_155 - .saturating_add(Weight::from_parts(175_992, 0).saturating_mul(p.into())) + // Minimum execution time: 22_803_000 picoseconds. + Weight::from_parts(23_719_300, 4042) + // Standard Error: 1_193 + .saturating_add(Weight::from_parts(36_042, 0).saturating_mul(m.into())) + // Standard Error: 1_163 + .saturating_add(Weight::from_parts(172_333, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -233,14 +233,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_109_000 picoseconds. - Weight::from_parts(42_891_261, 4360) - // Standard Error: 225 - .saturating_add(Weight::from_parts(2_186, 0).saturating_mul(b.into())) - // Standard Error: 2_382 - .saturating_add(Weight::from_parts(27_251, 0).saturating_mul(m.into())) - // Standard Error: 2_322 - .saturating_add(Weight::from_parts(233_097, 0).saturating_mul(p.into())) + // Minimum execution time: 39_482_000 picoseconds. + Weight::from_parts(40_477_351, 4360) + // Standard Error: 186 + .saturating_add(Weight::from_parts(3_573, 0).saturating_mul(b.into())) + // Standard Error: 1_972 + .saturating_add(Weight::from_parts(36_211, 0).saturating_mul(m.into())) + // Standard Error: 1_922 + .saturating_add(Weight::from_parts(205_109, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -263,12 +263,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 25_287_000 picoseconds. - Weight::from_parts(27_917_566, 4062) - // Standard Error: 1_643 - .saturating_add(Weight::from_parts(45_890, 0).saturating_mul(m.into())) - // Standard Error: 1_602 - .saturating_add(Weight::from_parts(179_446, 0).saturating_mul(p.into())) + // Minimum execution time: 24_721_000 picoseconds. + Weight::from_parts(28_482_318, 4062) + // Standard Error: 1_499 + .saturating_add(Weight::from_parts(38_125, 0).saturating_mul(m.into())) + // Standard Error: 1_462 + .saturating_add(Weight::from_parts(173_275, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -295,14 +295,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_960_000 picoseconds. - Weight::from_parts(45_364_930, 4380) - // Standard Error: 199 - .saturating_add(Weight::from_parts(1_730, 0).saturating_mul(b.into())) - // Standard Error: 2_112 - .saturating_add(Weight::from_parts(31_890, 0).saturating_mul(m.into())) - // Standard Error: 2_058 - .saturating_add(Weight::from_parts(226_382, 0).saturating_mul(p.into())) + // Minimum execution time: 41_520_000 picoseconds. + Weight::from_parts(44_345_807, 4380) + // Standard Error: 171 + .saturating_add(Weight::from_parts(2_576, 0).saturating_mul(b.into())) + // Standard Error: 1_810 + .saturating_add(Weight::from_parts(31_142, 0).saturating_mul(m.into())) + // Standard Error: 1_765 + .saturating_add(Weight::from_parts(203_408, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -320,10 +320,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 12_054_000 picoseconds. - Weight::from_parts(14_016_787, 1877) - // Standard Error: 1_192 - .saturating_add(Weight::from_parts(156_673, 0).saturating_mul(p.into())) + // Minimum execution time: 11_569_000 picoseconds. + Weight::from_parts(13_919_245, 1877) + // Standard Error: 1_294 + .saturating_add(Weight::from_parts(157_836, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -345,13 +345,13 @@ impl WeightInfo for SubstrateWeight { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1883 ±14) + p * (43 ±0)` - // Minimum execution time: 17_791_000 picoseconds. - Weight::from_parts(18_951_908, 5172) - // Standard Error: 332_795 - .saturating_add(Weight::from_parts(29_380_055, 0).saturating_mul(d.into())) - // Standard Error: 5_153 - .saturating_add(Weight::from_parts(256_813, 0).saturating_mul(p.into())) + // Estimated: `5172 + d * (1883 ±0) + p * (43 ±0)` + // Minimum execution time: 17_684_000 picoseconds. + Weight::from_parts(18_208_253, 5172) + // Standard Error: 335_331 + .saturating_add(Weight::from_parts(30_061_511, 0).saturating_mul(d.into())) + // Standard Error: 5_193 + .saturating_add(Weight::from_parts(252_666, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -371,8 +371,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 58_123_000 picoseconds. - Weight::from_parts(59_370_000, 5429) + // Minimum execution time: 56_117_000 picoseconds. + Weight::from_parts(57_676_000, 5429) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -394,13 +394,13 @@ impl WeightInfo for () { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 14_366_000 picoseconds. - Weight::from_parts(14_700_000, 15894) - // Standard Error: 61_324 - .saturating_add(Weight::from_parts(4_652_692, 0).saturating_mul(m.into())) - // Standard Error: 61_324 - .saturating_add(Weight::from_parts(8_163_099, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 14_500_000 picoseconds. + Weight::from_parts(14_757_000, 15894) + // Standard Error: 59_477 + .saturating_add(Weight::from_parts(4_505_637, 0).saturating_mul(m.into())) + // Standard Error: 59_477 + .saturating_add(Weight::from_parts(7_968_384, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -420,12 +420,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_253_000 picoseconds. - Weight::from_parts(16_325_671, 3997) - // Standard Error: 27 - .saturating_add(Weight::from_parts(1_623, 0).saturating_mul(b.into())) - // Standard Error: 281 - .saturating_add(Weight::from_parts(16_438, 0).saturating_mul(m.into())) + // Minimum execution time: 17_111_000 picoseconds. + Weight::from_parts(16_217_737, 3997) + // Standard Error: 28 + .saturating_add(Weight::from_parts(1_525, 0).saturating_mul(b.into())) + // Standard Error: 295 + .saturating_add(Weight::from_parts(17_164, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -443,12 +443,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 19_013_000 picoseconds. - Weight::from_parts(18_358_483, 3997) - // Standard Error: 35 - .saturating_add(Weight::from_parts(1_576, 0).saturating_mul(b.into())) - // Standard Error: 370 - .saturating_add(Weight::from_parts(25_153, 0).saturating_mul(m.into())) + // Minimum execution time: 18_689_000 picoseconds. + Weight::from_parts(17_817_417, 3997) + // Standard Error: 32 + .saturating_add(Weight::from_parts(1_681, 0).saturating_mul(b.into())) + // Standard Error: 337 + .saturating_add(Weight::from_parts(27_384, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -473,14 +473,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 20_120_000 picoseconds. - Weight::from_parts(52_868_753, 3991) - // Standard Error: 418 - .saturating_add(Weight::from_parts(3_489, 0).saturating_mul(b.into())) - // Standard Error: 4_368 - .saturating_add(Weight::from_parts(47_853, 0).saturating_mul(m.into())) - // Standard Error: 4_312 - .saturating_add(Weight::from_parts(245_221, 0).saturating_mul(p.into())) + // Minimum execution time: 19_916_000 picoseconds. + Weight::from_parts(52_492_859, 3991) + // Standard Error: 424 + .saturating_add(Weight::from_parts(3_702, 0).saturating_mul(b.into())) + // Standard Error: 4_425 + .saturating_add(Weight::from_parts(57_614, 0).saturating_mul(m.into())) + // Standard Error: 4_369 + .saturating_add(Weight::from_parts(222_279, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -495,10 +495,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_634_000 picoseconds. - Weight::from_parts(23_587_202, 4475) - // Standard Error: 994 - .saturating_add(Weight::from_parts(45_472, 0).saturating_mul(m.into())) + // Minimum execution time: 22_683_000 picoseconds. + Weight::from_parts(23_460_909, 4475) + // Standard Error: 767 + .saturating_add(Weight::from_parts(40_650, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -517,12 +517,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 23_209_000 picoseconds. - Weight::from_parts(23_913_197, 4042) - // Standard Error: 1_184 - .saturating_add(Weight::from_parts(35_774, 0).saturating_mul(m.into())) - // Standard Error: 1_155 - .saturating_add(Weight::from_parts(175_992, 0).saturating_mul(p.into())) + // Minimum execution time: 22_803_000 picoseconds. + Weight::from_parts(23_719_300, 4042) + // Standard Error: 1_193 + .saturating_add(Weight::from_parts(36_042, 0).saturating_mul(m.into())) + // Standard Error: 1_163 + .saturating_add(Weight::from_parts(172_333, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -547,14 +547,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 40_109_000 picoseconds. - Weight::from_parts(42_891_261, 4360) - // Standard Error: 225 - .saturating_add(Weight::from_parts(2_186, 0).saturating_mul(b.into())) - // Standard Error: 2_382 - .saturating_add(Weight::from_parts(27_251, 0).saturating_mul(m.into())) - // Standard Error: 2_322 - .saturating_add(Weight::from_parts(233_097, 0).saturating_mul(p.into())) + // Minimum execution time: 39_482_000 picoseconds. + Weight::from_parts(40_477_351, 4360) + // Standard Error: 186 + .saturating_add(Weight::from_parts(3_573, 0).saturating_mul(b.into())) + // Standard Error: 1_972 + .saturating_add(Weight::from_parts(36_211, 0).saturating_mul(m.into())) + // Standard Error: 1_922 + .saturating_add(Weight::from_parts(205_109, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -577,12 +577,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 25_287_000 picoseconds. - Weight::from_parts(27_917_566, 4062) - // Standard Error: 1_643 - .saturating_add(Weight::from_parts(45_890, 0).saturating_mul(m.into())) - // Standard Error: 1_602 - .saturating_add(Weight::from_parts(179_446, 0).saturating_mul(p.into())) + // Minimum execution time: 24_721_000 picoseconds. + Weight::from_parts(28_482_318, 4062) + // Standard Error: 1_499 + .saturating_add(Weight::from_parts(38_125, 0).saturating_mul(m.into())) + // Standard Error: 1_462 + .saturating_add(Weight::from_parts(173_275, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -609,14 +609,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_960_000 picoseconds. - Weight::from_parts(45_364_930, 4380) - // Standard Error: 199 - .saturating_add(Weight::from_parts(1_730, 0).saturating_mul(b.into())) - // Standard Error: 2_112 - .saturating_add(Weight::from_parts(31_890, 0).saturating_mul(m.into())) - // Standard Error: 2_058 - .saturating_add(Weight::from_parts(226_382, 0).saturating_mul(p.into())) + // Minimum execution time: 41_520_000 picoseconds. + Weight::from_parts(44_345_807, 4380) + // Standard Error: 171 + .saturating_add(Weight::from_parts(2_576, 0).saturating_mul(b.into())) + // Standard Error: 1_810 + .saturating_add(Weight::from_parts(31_142, 0).saturating_mul(m.into())) + // Standard Error: 1_765 + .saturating_add(Weight::from_parts(203_408, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -634,10 +634,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 12_054_000 picoseconds. - Weight::from_parts(14_016_787, 1877) - // Standard Error: 1_192 - .saturating_add(Weight::from_parts(156_673, 0).saturating_mul(p.into())) + // Minimum execution time: 11_569_000 picoseconds. + Weight::from_parts(13_919_245, 1877) + // Standard Error: 1_294 + .saturating_add(Weight::from_parts(157_836, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -659,13 +659,13 @@ impl WeightInfo for () { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1883 ±14) + p * (43 ±0)` - // Minimum execution time: 17_791_000 picoseconds. - Weight::from_parts(18_951_908, 5172) - // Standard Error: 332_795 - .saturating_add(Weight::from_parts(29_380_055, 0).saturating_mul(d.into())) - // Standard Error: 5_153 - .saturating_add(Weight::from_parts(256_813, 0).saturating_mul(p.into())) + // Estimated: `5172 + d * (1883 ±0) + p * (43 ±0)` + // Minimum execution time: 17_684_000 picoseconds. + Weight::from_parts(18_208_253, 5172) + // Standard Error: 335_331 + .saturating_add(Weight::from_parts(30_061_511, 0).saturating_mul(d.into())) + // Standard Error: 5_193 + .saturating_add(Weight::from_parts(252_666, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -685,8 +685,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 58_123_000 picoseconds. - Weight::from_parts(59_370_000, 5429) + // Minimum execution time: 56_117_000 picoseconds. + Weight::from_parts(57_676_000, 5429) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } From ddb8d23456b4480812931acf477071d2743637c3 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Tue, 6 Aug 2024 18:47:22 +0000 Subject: [PATCH 35/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=collectives-westend --runtime_dir=collectives --target_dir=cumulus --pallet=pallet_collective --- .../src/weights/pallet_collective.rs | 229 ++++++++++-------- 1 file changed, 126 insertions(+), 103 deletions(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index 498cba3520d5..af95de2fa21c 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -1,37 +1,40 @@ // Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// This file is part of Cumulus. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-02, STEPS: `20`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `cob`, CPU: `` +//! HOSTNAME: `runner-696hpswk-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-westend-dev")`, DB CACHE: 1024 // Executed Command: -// ./target/debug/polkadot-parachain +// target/production/polkadot-parachain // benchmark // pallet -// --chain=collectives-westend-dev -// --steps=20 -// --repeat=2 -// --pallet=pallet-collective +// --steps=50 +// --repeat=20 // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_collective +// --chain=collectives-westend-dev +// --header=./cumulus/file_header.txt // --output=./cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] @@ -59,20 +62,20 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `32764 + m * (1964 ±96) + p * (4242 ±96)` - // Minimum execution time: 96_000_000 picoseconds. - Weight::from_parts(96_000_000, 0) - .saturating_add(Weight::from_parts(0, 32764)) - // Standard Error: 2_641_144 - .saturating_add(Weight::from_parts(6_072_464, 0).saturating_mul(m.into())) - // Standard Error: 2_641_144 - .saturating_add(Weight::from_parts(41_969_561, 0).saturating_mul(p.into())) + // Estimated: `15765 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 14_272_000 picoseconds. + Weight::from_parts(14_402_000, 0) + .saturating_add(Weight::from_parts(0, 15765)) + // Standard Error: 61_242 + .saturating_add(Weight::from_parts(4_710_884, 0).saturating_mul(m.into())) + // Standard Error: 61_242 + .saturating_add(Weight::from_parts(8_170_656, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1964).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4242).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Members` (r:1 w:0) /// Proof: `AllianceMotion::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -81,12 +84,14 @@ impl pallet_collective::WeightInfo for WeightInfo { fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `69 + m * (32 ±0)` - // Estimated: `1554 + m * (32 ±0)` - // Minimum execution time: 113_000_000 picoseconds. - Weight::from_parts(119_828_337, 0) - .saturating_add(Weight::from_parts(0, 1554)) - // Standard Error: 2_218 - .saturating_add(Weight::from_parts(657, 0).saturating_mul(b.into())) + // Estimated: `1555 + m * (32 ±0)` + // Minimum execution time: 12_708_000 picoseconds. + Weight::from_parts(11_854_643, 0) + .saturating_add(Weight::from_parts(0, 1555)) + // Standard Error: 28 + .saturating_add(Weight::from_parts(1_640, 0).saturating_mul(b.into())) + // Standard Error: 294 + .saturating_add(Weight::from_parts(15_247, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -96,13 +101,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn propose_execute(_b: u32, m: u32, ) -> Weight { + fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `69 + m * (32 ±0)` - // Estimated: `3534 + m * (32 ±0)` - // Minimum execution time: 134_000_000 picoseconds. - Weight::from_parts(147_058_362, 0) - .saturating_add(Weight::from_parts(0, 3534)) + // Estimated: `3535 + m * (32 ±0)` + // Minimum execution time: 14_770_000 picoseconds. + Weight::from_parts(13_876_231, 0) + .saturating_add(Weight::from_parts(0, 3535)) + // Standard Error: 30 + .saturating_add(Weight::from_parts(1_665, 0).saturating_mul(b.into())) + // Standard Error: 311 + .saturating_add(Weight::from_parts(24_188, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -123,15 +132,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `466 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3803 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 205_000_000 picoseconds. - Weight::from_parts(276_229_342, 0) - .saturating_add(Weight::from_parts(0, 3803)) - // Standard Error: 29_842 - .saturating_add(Weight::from_parts(25_636, 0).saturating_mul(b.into())) - // Standard Error: 306_767 - .saturating_add(Weight::from_parts(2_075_139, 0).saturating_mul(p.into())) + // Measured: `396 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3784 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 21_553_000 picoseconds. + Weight::from_parts(22_006_282, 0) + .saturating_add(Weight::from_parts(0, 3784)) + // Standard Error: 143 + .saturating_add(Weight::from_parts(3_164, 0).saturating_mul(b.into())) + // Standard Error: 1_492 + .saturating_add(Weight::from_parts(10_963, 0).saturating_mul(m.into())) + // Standard Error: 1_473 + .saturating_add(Weight::from_parts(227_391, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -144,11 +155,13 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `844 + m * (64 ±0)` + // Measured: `845 + m * (64 ±0)` // Estimated: `4309 + m * (64 ±0)` - // Minimum execution time: 161_000_000 picoseconds. - Weight::from_parts(180_878_947, 0) + // Minimum execution time: 25_014_000 picoseconds. + Weight::from_parts(28_179_286, 0) .saturating_add(Weight::from_parts(0, 4309)) + // Standard Error: 2_138 + .saturating_add(Weight::from_parts(37_745, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -165,17 +178,19 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `471 + m * (64 ±0) + p * (35 ±0)` - // Estimated: `3848 + m * (65 ±0) + p * (37 ±0)` - // Minimum execution time: 209_000_000 picoseconds. - Weight::from_parts(270_621_515, 0) - .saturating_add(Weight::from_parts(0, 3848)) - // Standard Error: 766_224 - .saturating_add(Weight::from_parts(2_167_428, 0).saturating_mul(p.into())) + // Measured: `434 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3879 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 23_225_000 picoseconds. + Weight::from_parts(23_099_384, 0) + .saturating_add(Weight::from_parts(0, 3879)) + // Standard Error: 1_321 + .saturating_add(Weight::from_parts(35_416, 0).saturating_mul(m.into())) + // Standard Error: 1_288 + .saturating_add(Weight::from_parts(203_259, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -190,17 +205,21 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `781 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4105 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 310_000_000 picoseconds. - Weight::from_parts(483_594_136, 0) - .saturating_add(Weight::from_parts(0, 4105)) - // Standard Error: 520_037 - .saturating_add(Weight::from_parts(1_901_254, 0).saturating_mul(p.into())) + // Measured: `736 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4053 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 32_567_000 picoseconds. + Weight::from_parts(33_125_175, 0) + .saturating_add(Weight::from_parts(0, 4053)) + // Standard Error: 186 + .saturating_add(Weight::from_parts(2_905, 0).saturating_mul(b.into())) + // Standard Error: 1_966 + .saturating_add(Weight::from_parts(12_767, 0).saturating_mul(m.into())) + // Standard Error: 1_916 + .saturating_add(Weight::from_parts(257_858, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) @@ -217,19 +236,19 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `586 + m * (48 ±0) + p * (35 ±0)` - // Estimated: `3952 + m * (49 ±0) + p * (37 ±0)` - // Minimum execution time: 230_000_000 picoseconds. - Weight::from_parts(224_849_722, 0) - .saturating_add(Weight::from_parts(0, 3952)) - // Standard Error: 95_179 - .saturating_add(Weight::from_parts(81_183, 0).saturating_mul(m.into())) - // Standard Error: 92_074 - .saturating_add(Weight::from_parts(2_154_399, 0).saturating_mul(p.into())) + // Measured: `532 + m * (48 ±0) + p * (36 ±0)` + // Estimated: `3972 + m * (49 ±0) + p * (36 ±0)` + // Minimum execution time: 24_415_000 picoseconds. + Weight::from_parts(24_329_845, 0) + .saturating_add(Weight::from_parts(0, 3972)) + // Standard Error: 1_288 + .saturating_add(Weight::from_parts(31_798, 0).saturating_mul(m.into())) + // Standard Error: 1_256 + .saturating_add(Weight::from_parts(215_755, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Voting` (r:1 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -246,17 +265,21 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `801 + m * (64 ±0) + p * (39 ±0)` - // Estimated: `4125 + b * (1 ±0) + m * (65 ±0) + p * (40 ±0)` - // Minimum execution time: 313_000_000 picoseconds. - Weight::from_parts(455_610_954, 0) - .saturating_add(Weight::from_parts(0, 4125)) - // Standard Error: 660_998 - .saturating_add(Weight::from_parts(2_191_935, 0).saturating_mul(p.into())) + // Measured: `756 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4073 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 35_236_000 picoseconds. + Weight::from_parts(35_625_683, 0) + .saturating_add(Weight::from_parts(0, 4073)) + // Standard Error: 273 + .saturating_add(Weight::from_parts(3_304, 0).saturating_mul(b.into())) + // Standard Error: 2_889 + .saturating_add(Weight::from_parts(369, 0).saturating_mul(m.into())) + // Standard Error: 2_816 + .saturating_add(Weight::from_parts(293_453, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: `AllianceMotion::Proposals` (r:1 w:1) @@ -268,13 +291,13 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `225 + p * (32 ±0)` + // Measured: `226 + p * (32 ±0)` // Estimated: `1711 + p * (32 ±0)` - // Minimum execution time: 122_000_000 picoseconds. - Weight::from_parts(121_913_287, 0) + // Minimum execution time: 12_189_000 picoseconds. + Weight::from_parts(12_697_701, 0) .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 70_371 - .saturating_add(Weight::from_parts(1_931_302, 0).saturating_mul(p.into())) + // Standard Error: 1_203 + .saturating_add(Weight::from_parts(205_053, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -291,19 +314,19 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1778 + d * (38 ±0) + p * (40 ±0)` - // Estimated: `5046 + d * (259 ±60) + p * (42 ±0)` - // Minimum execution time: 214_000_000 picoseconds. - Weight::from_parts(38_793_624, 0) - .saturating_add(Weight::from_parts(0, 5046)) - // Standard Error: 72_183_295 - .saturating_add(Weight::from_parts(161_667_584, 0).saturating_mul(d.into())) - // Standard Error: 1_001_498 - .saturating_add(Weight::from_parts(3_712_063, 0).saturating_mul(p.into())) + // Measured: `1732 + d * (38 ±0) + p * (40 ±0)` + // Estimated: `5064 + d * (283 ±13) + p * (42 ±0)` + // Minimum execution time: 21_288_000 picoseconds. + Weight::from_parts(19_499_541, 0) + .saturating_add(Weight::from_parts(0, 5064)) + // Standard Error: 109_765 + .saturating_add(Weight::from_parts(5_586_813, 0).saturating_mul(d.into())) + // Standard Error: 1_699 + .saturating_add(Weight::from_parts(247_874, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 259).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 283).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 42).saturating_mul(p.into())) } /// Storage: `AllianceMotion::ProposalOf` (r:1 w:0) @@ -314,8 +337,8 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1624` // Estimated: `5089` - // Minimum execution time: 172_000_000 picoseconds. - Weight::from_parts(172_000_000, 0) + // Minimum execution time: 26_174_000 picoseconds. + Weight::from_parts(27_245_000, 0) .saturating_add(Weight::from_parts(0, 5089)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) From 0b09a4abbe5f122695740ad6095084bfc2e6cfc1 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 7 Aug 2024 11:21:16 +0200 Subject: [PATCH 36/49] update round type --- substrate/frame/collective/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 0920295f0a32..2c59fab9fcaa 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -251,8 +251,13 @@ pub mod deposit { fn convert(proposal_count: u32) -> Balance { let deposit = Deposit::convert(proposal_count); if !deposit.is_zero() { - let factor: Balance = 10u32.pow(Precision::get()).into(); - (deposit / factor) * factor + let factor: Balance = + Balance::from(10u32).saturating_pow(Precision::get() as usize); + if factor > deposit { + deposit + } else { + (deposit / factor) * factor + } } else { deposit } From 5f2fa9f4e37fff72f544067b1a9c1cf110279108 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 7 Aug 2024 11:21:40 +0200 Subject: [PATCH 37/49] update prdoc --- prdoc/pr_3151.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 3c38380c9e5f..385b5f2f98ae 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -20,6 +20,14 @@ doc: of the associated cost/consideration ticket. - release_proposal_cost(origin, proposal_hash): the release of the cost for a non-active proposal. + New config parameters: + - DisapproveOrigin: origin from which a proposal in any status may be disapproved without + associated cost for a proposer; + - KillOrigin: Origin from which any malicious proposal may be killed with associated cost + for a proposer; + - Consideration: mechanism to assess the necessity of some cost for publishing and storing + a proposal. Set to unit type to have not submission cost; + Additionally change: - benchmarks have been upgraded to benchmarks::v2 for collective pallet; - `ensure_successful` function added to the `Consideration` under `runtime-benchmarks` feature. From a0ddd4c5fd4928e2da008f2ee929d0136b2f089f Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 15 Aug 2024 13:22:25 +0200 Subject: [PATCH 38/49] not optional considerations --- substrate/frame/balances/src/impl_fungible.rs | 2 ++ .../frame/balances/src/tests/fungible_tests.rs | 14 ++++++++++++-- substrate/frame/collective/src/lib.rs | 5 ++--- substrate/frame/collective/src/tests.rs | 17 +++++++++-------- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/substrate/frame/balances/src/impl_fungible.rs b/substrate/frame/balances/src/impl_fungible.rs index 0f4e51f35012..96debd27bb12 100644 --- a/substrate/frame/balances/src/impl_fungible.rs +++ b/substrate/frame/balances/src/impl_fungible.rs @@ -238,10 +238,12 @@ impl, I: 'static> fungible::InspectHold for Pallet bool { if frame_system::Pallet::::providers(who) == 0 { + println!("hold_available: providers(who) == 0"); return false } let holds = Holds::::get(who); if holds.is_full() && !holds.iter().any(|x| &x.id == reason) { + println!("hold_available: holds.is_full() && !holds.iter().any(|x| &x.id == reason)"); return false } true diff --git a/substrate/frame/balances/src/tests/fungible_tests.rs b/substrate/frame/balances/src/tests/fungible_tests.rs index e1c1be9b1335..7e58973f3e2c 100644 --- a/substrate/frame/balances/src/tests/fungible_tests.rs +++ b/substrate/frame/balances/src/tests/fungible_tests.rs @@ -518,12 +518,21 @@ fn freeze_consideration_works() { let who = 4; // freeze amount taken somewhere outside of our (Consideration) scope. let extend_freeze = 15; + let zero = 0; let zero_ticket = Consideration::new(&who, Footprint::from_parts(0, 0)).unwrap(); + + println!("zero_ticket: {:?}", zero_ticket.encode()); + println!("zero: {:?}", zero.encode()); + assert_eq!(Balances::balance_frozen(&TestId::Foo, &who), 0); let ticket = Consideration::new(&who, Footprint::from_parts(10, 1)).unwrap(); assert_eq!(Balances::balance_frozen(&TestId::Foo, &who), 10); + let ten = 10; + println!("ten: {:?}", ten.encode()); + println!("ten: {:?}", ticket.encode()); + let ticket = ticket.update(&who, Footprint::from_parts(4, 1)).unwrap(); assert_eq!(Balances::balance_frozen(&TestId::Foo, &who), 4); @@ -562,10 +571,10 @@ fn hold_consideration_works() { // hold amount taken somewhere outside of our (Consideration) scope. let extend_hold = 15; - let zero_ticket = Consideration::new(&who, Footprint::from_parts(0, 0)).unwrap(); + let ticket = Consideration::new(&who, Footprint::from_parts(0, 0)).unwrap(); assert_eq!(Balances::balance_on_hold(&TestId::Foo, &who), 0); - let ticket = Consideration::new(&who, Footprint::from_parts(10, 1)).unwrap(); + let ticket = ticket.update(&who, Footprint::from_parts(10, 1)).unwrap(); assert_eq!(Balances::balance_on_hold(&TestId::Foo, &who), 10); let ticket = ticket.update(&who, Footprint::from_parts(4, 1)).unwrap(); @@ -577,6 +586,7 @@ fn hold_consideration_works() { let ticket = ticket.update(&who, Footprint::from_parts(8, 1)).unwrap(); assert_eq!(Balances::balance_on_hold(&TestId::Foo, &who), 8 + extend_hold); + let zero_ticket = Consideration::new(&who, Footprint::from_parts(0, 0)).unwrap(); assert_eq!(ticket.update(&who, Footprint::from_parts(0, 0)).unwrap(), zero_ticket); assert_eq!(Balances::balance_on_hold(&TestId::Foo, &who), 0 + extend_hold); diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 2c59fab9fcaa..0bbc576dcec3 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -954,9 +954,8 @@ impl, I: 'static> Pallet { Ok(proposals.len()) })?; - if let Some(cost) = T::Consideration::new(&who, active_proposals as u32 - 1)? { - >::insert(proposal_hash, (who.clone(), cost)); - } + let cost = T::Consideration::new(&who, active_proposals as u32 - 1)?; + >::insert(proposal_hash, (who.clone(), cost)); let index = ProposalCount::::get(); diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index ed179e9891c2..1740d9a35180 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -203,7 +203,8 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { system: frame_system::GenesisConfig::default(), - balances: pallet_balances::GenesisConfig::default(), + // balances: pallet_balances::GenesisConfig::default(), + balances: pallet_balances::GenesisConfig { balances: vec![(1, 100), (2, 200)] }, collective: pallet_collective::GenesisConfig { members: self.collective_members, phantom: Default::default(), @@ -605,16 +606,16 @@ fn close_with_no_prime_but_majority_works() { let deposit = >::convert(0); let ed = Balances::minimum_balance(); - let _ = Balances::mint_into(&1, ed + deposit); + let _ = Balances::mint_into(&5, ed + deposit); System::reset_events(); assert_ok!(CollectiveMajority::propose( - RuntimeOrigin::signed(1), + RuntimeOrigin::signed(5), 5, Box::new(proposal.clone()), proposal_len )); - assert_eq!(Balances::balance(&1), ed); + assert_eq!(Balances::balance(&5), ed); assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(1), hash, 0, true)); assert_ok!(CollectiveMajority::vote(RuntimeOrigin::signed(2), hash, 0, true)); @@ -634,14 +635,14 @@ fn close_with_no_prime_but_majority_works() { proposal_len )); - assert_ok!(CollectiveMajority::release_proposal_cost(RuntimeOrigin::signed(1), hash)); - assert_eq!(Balances::balance(&1), ed + deposit); + assert_ok!(CollectiveMajority::release_proposal_cost(RuntimeOrigin::signed(5), hash)); + assert_eq!(Balances::balance(&5), ed + deposit); assert_eq!( System::events(), vec![ record(RuntimeEvent::CollectiveMajority(CollectiveEvent::Proposed { - account: 1, + account: 5, proposal_index: 0, proposal_hash: hash, threshold: 5 @@ -681,7 +682,7 @@ fn close_with_no_prime_but_majority_works() { })), record(RuntimeEvent::CollectiveMajority(CollectiveEvent::ProposalCostReleased { proposal_hash: hash, - who: 1, + who: 5, })) ] ); From 82e6889292bf406b53bf66557ddd964fd2e2f36c Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 15 Aug 2024 14:46:49 +0200 Subject: [PATCH 39/49] remove debug outputs --- substrate/frame/balances/src/impl_fungible.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/substrate/frame/balances/src/impl_fungible.rs b/substrate/frame/balances/src/impl_fungible.rs index 96debd27bb12..0f4e51f35012 100644 --- a/substrate/frame/balances/src/impl_fungible.rs +++ b/substrate/frame/balances/src/impl_fungible.rs @@ -238,12 +238,10 @@ impl, I: 'static> fungible::InspectHold for Pallet bool { if frame_system::Pallet::::providers(who) == 0 { - println!("hold_available: providers(who) == 0"); return false } let holds = Holds::::get(who); if holds.is_full() && !holds.iter().any(|x| &x.id == reason) { - println!("hold_available: holds.is_full() && !holds.iter().any(|x| &x.id == reason)"); return false } true From 3f8a76cf83304a0b4ae47fa6477fad9bd6bfa5b4 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 28 Aug 2024 11:55:46 +0200 Subject: [PATCH 40/49] maybe consideration --- substrate/frame/collective/Cargo.toml | 2 +- substrate/frame/collective/src/lib.rs | 8 +++++--- substrate/frame/collective/src/tests.rs | 7 +++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/substrate/frame/collective/Cargo.toml b/substrate/frame/collective/Cargo.toml index cf1b141e4d5a..59a9d23f7b19 100644 --- a/substrate/frame/collective/Cargo.toml +++ b/substrate/frame/collective/Cargo.toml @@ -21,7 +21,7 @@ docify = { workspace = true } log = { workspace = true } scale-info = { features = ["derive"], workspace = true } frame-benchmarking = { optional = true, workspace = true } -frame-support = { workspace = true } +frame-support = { features = ["experimental"], workspace = true } frame-system = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 0bbc576dcec3..e003b04009c3 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -60,7 +60,7 @@ use frame_support::{ ensure, impl_ensure_origin_with_arg_ignoring_arg, traits::{ Backing, ChangeMembers, Consideration, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking, - InitializeMembers, StorageVersion, + InitializeMembers, MaybeConsideration, StorageVersion, }, weights::Weight, }; @@ -386,7 +386,7 @@ pub mod pallet { /// Note: If the resulting deposits are excessively high and cause benchmark failures, /// consider using a constant cost (e.g., [`crate::deposit::Constant`]) equal to the minimum /// balance under the `runtime-benchmarks` feature. - type Consideration: Consideration; + type Consideration: MaybeConsideration; } #[pallet::genesis_config] @@ -955,7 +955,9 @@ impl, I: 'static> Pallet { })?; let cost = T::Consideration::new(&who, active_proposals as u32 - 1)?; - >::insert(proposal_hash, (who.clone(), cost)); + if !cost.is_none() { + >::insert(proposal_hash, (who.clone(), cost)); + } let index = ProposalCount::::get(); diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 1740d9a35180..70ce221f10d0 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -31,7 +31,7 @@ use frame_system::{EnsureRoot, EventRecord, Phase}; use sp_core::{ConstU128, H256}; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, Convert}, + traits::{BlakeTwo256, Convert, Zero}, BuildStorage, FixedU128, }; @@ -129,7 +129,6 @@ impl Config for Test { type WeightInfo = (); type SetMembersOrigin = EnsureRoot; type MaxProposalWeight = MaxProposalWeight; - // type ProposalDeposit = CollectiveDeposit; type DisapproveOrigin = EnsureRoot; type KillOrigin = EnsureRoot; type Consideration = @@ -1598,6 +1597,10 @@ fn kill_proposal_with_deposit() { Box::new(proposal.clone()), proposal_len )); + assert_eq!( + CostOf::::get(last_hash.unwrap()).is_none(), + deposit.is_zero() + ); } let balance = Balances::total_balance(&1); System::reset_events(); From d92f622d8b499471021212b1856aeac9a348f3f3 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 28 Aug 2024 12:26:23 +0200 Subject: [PATCH 41/49] prdoc fix --- prdoc/pr_3151.prdoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 385b5f2f98ae..11fd0625db4f 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -35,15 +35,13 @@ doc: crates: - name: pallet-collective bump: major - - name: frame-support - bump: major - name: collectives-westend-runtime bump: major - name: kitchensink-runtime bump: major - name: pallet-alliance bump: patch - - name: pallet-preimage + - name: pallet-balances bump: patch - name: pallet-utility bump: patch From 0246fa8eb4b769d74b9cc03d384a1b315f6aa705 Mon Sep 17 00:00:00 2001 From: muharem Date: Wed, 28 Aug 2024 12:45:59 +0200 Subject: [PATCH 42/49] fix benches --- substrate/frame/collective/src/benchmarking.rs | 10 +++++++--- substrate/frame/collective/src/lib.rs | 15 ++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/substrate/frame/collective/src/benchmarking.rs b/substrate/frame/collective/src/benchmarking.rs index 684c10eb7461..baf7cce8437f 100644 --- a/substrate/frame/collective/src/benchmarking.rs +++ b/substrate/frame/collective/src/benchmarking.rs @@ -875,13 +875,17 @@ mod benchmarks { let _ = Collective::::remove_proposal(last_hash); assert_eq!(Proposals::::get().len(), (p - 1) as usize); + let cost_present = CostOf::::get(last_hash).is_some(); + #[extrinsic_call] _(SystemOrigin::Signed(caller.clone()), last_hash); assert_eq!(CostOf::::get(last_hash), None); - assert_last_event::( - Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), - ); + if cost_present { + assert_last_event::( + Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(), + ); + } Ok(()) } diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index e003b04009c3..06f4daf7c7b2 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -518,8 +518,6 @@ pub mod pallet { PrimeAccountNotMember, /// Proposal is still active. ProposalActive, - /// No associated cost for the proposal. - NoCost, } #[pallet::hooks] @@ -862,6 +860,8 @@ pub mod pallet { /// Release the cost held for storing a proposal once the given proposal is completed. /// + /// If there is no associated cost for the given proposal, this call will have no effect. + /// /// Parameters: /// - `origin`: must be `Signed` or `Root`. /// - `proposal_hash`: The hash of the proposal. @@ -872,17 +872,18 @@ pub mod pallet { pub fn release_proposal_cost( origin: OriginFor, proposal_hash: T::Hash, - ) -> DispatchResultWithPostInfo { + ) -> DispatchResult { let _ = ensure_signed_or_root(origin)?; ensure!( ProposalOf::::get(&proposal_hash).is_none(), Error::::ProposalActive ); - let (who, cost) = >::take(proposal_hash).ok_or(Error::::NoCost)?; - let _ = cost.drop(&who)?; - Self::deposit_event(Event::ProposalCostReleased { proposal_hash, who }); + if let Some((who, cost)) = >::take(proposal_hash) { + let _ = cost.drop(&who)?; + Self::deposit_event(Event::ProposalCostReleased { proposal_hash, who }); + } - Ok(Some(T::WeightInfo::release_proposal_cost()).into()) + Ok(()) } } } From 9e89a725befb11e6bd89958c26888c26c71afc54 Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 29 Aug 2024 14:30:30 +0200 Subject: [PATCH 43/49] update pr doc --- prdoc/pr_3151.prdoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prdoc/pr_3151.prdoc b/prdoc/pr_3151.prdoc index 11fd0625db4f..5e43b86a9753 100644 --- a/prdoc/pr_3151.prdoc +++ b/prdoc/pr_3151.prdoc @@ -4,7 +4,9 @@ title: Dynamic deposit based on number of proposals doc: - - audience: Runtime User + - audience: + - Runtime User + - Runtime Dev description: | Introduce a dynamic proposal deposit mechanism influenced by the total number of active proposals, with the option to set the deposit to none. From 7884b85f5d301937ab88b9584d870c4e2df6825f Mon Sep 17 00:00:00 2001 From: muharem Date: Thu, 29 Aug 2024 14:36:21 +0200 Subject: [PATCH 44/49] improve doc --- substrate/frame/collective/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 06f4daf7c7b2..79428689caaf 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -430,8 +430,10 @@ pub mod pallet { pub type ProposalOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, >::Proposal, OptionQuery>; - /// Consideration cost created for publishing and storing a proposal. Determined by - /// [Config::Consideration] and may not be applicable for certain proposals. + /// Consideration cost created for publishing and storing a proposal. + /// + /// Determined by [Config::Consideration] and may be not present for certain proposals (e.g. if + /// the proposal count at the time of creation was below threshold N). #[pallet::storage] pub type CostOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, (T::AccountId, T::Consideration), OptionQuery>; From 4f04c4b626333c1181d4755cad62fd0f8e719eb8 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Thu, 29 Aug 2024 16:00:58 +0000 Subject: [PATCH 45/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=collectives-westend --runtime_dir=collectives --target_dir=cumulus --pallet=pallet_collective --- .../src/weights/pallet_collective.rs | 210 +++++++++--------- 1 file changed, 103 insertions(+), 107 deletions(-) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs index af95de2fa21c..d456f5b8c460 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collective.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-696hpswk-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-svzsllib-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-westend-dev")`, DB CACHE: 1024 // Executed Command: @@ -62,14 +62,14 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15765 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 14_272_000 picoseconds. - Weight::from_parts(14_402_000, 0) - .saturating_add(Weight::from_parts(0, 15765)) - // Standard Error: 61_242 - .saturating_add(Weight::from_parts(4_710_884, 0).saturating_mul(m.into())) - // Standard Error: 61_242 - .saturating_add(Weight::from_parts(8_170_656, 0).saturating_mul(p.into())) + // Estimated: `15728 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 16_539_000 picoseconds. + Weight::from_parts(16_884_000, 0) + .saturating_add(Weight::from_parts(0, 15728)) + // Standard Error: 65_205 + .saturating_add(Weight::from_parts(4_926_489, 0).saturating_mul(m.into())) + // Standard Error: 65_205 + .saturating_add(Weight::from_parts(9_044_204, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,13 +85,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `69 + m * (32 ±0)` // Estimated: `1555 + m * (32 ±0)` - // Minimum execution time: 12_708_000 picoseconds. - Weight::from_parts(11_854_643, 0) + // Minimum execution time: 16_024_000 picoseconds. + Weight::from_parts(15_295_443, 0) .saturating_add(Weight::from_parts(0, 1555)) - // Standard Error: 28 - .saturating_add(Weight::from_parts(1_640, 0).saturating_mul(b.into())) - // Standard Error: 294 - .saturating_add(Weight::from_parts(15_247, 0).saturating_mul(m.into())) + // Standard Error: 22 + .saturating_add(Weight::from_parts(1_501, 0).saturating_mul(b.into())) + // Standard Error: 229 + .saturating_add(Weight::from_parts(12_430, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -105,13 +105,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `69 + m * (32 ±0)` // Estimated: `3535 + m * (32 ±0)` - // Minimum execution time: 14_770_000 picoseconds. - Weight::from_parts(13_876_231, 0) + // Minimum execution time: 18_277_000 picoseconds. + Weight::from_parts(17_322_061, 0) .saturating_add(Weight::from_parts(0, 3535)) - // Standard Error: 30 - .saturating_add(Weight::from_parts(1_665, 0).saturating_mul(b.into())) - // Standard Error: 311 - .saturating_add(Weight::from_parts(24_188, 0).saturating_mul(m.into())) + // Standard Error: 29 + .saturating_add(Weight::from_parts(1_725, 0).saturating_mul(b.into())) + // Standard Error: 309 + .saturating_add(Weight::from_parts(25_640, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -125,26 +125,24 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `AllianceMotion::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `AllianceMotion::Voting` (r:0 w:1) /// Proof: `AllianceMotion::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `AllianceMotion::CostOf` (r:0 w:1) - /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `396 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3784 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 21_553_000 picoseconds. - Weight::from_parts(22_006_282, 0) - .saturating_add(Weight::from_parts(0, 3784)) - // Standard Error: 143 - .saturating_add(Weight::from_parts(3_164, 0).saturating_mul(b.into())) - // Standard Error: 1_492 - .saturating_add(Weight::from_parts(10_963, 0).saturating_mul(m.into())) - // Standard Error: 1_473 - .saturating_add(Weight::from_parts(227_391, 0).saturating_mul(p.into())) + // Measured: `359 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3751 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 23_915_000 picoseconds. + Weight::from_parts(22_895_005, 0) + .saturating_add(Weight::from_parts(0, 3751)) + // Standard Error: 116 + .saturating_add(Weight::from_parts(4_047, 0).saturating_mul(b.into())) + // Standard Error: 1_211 + .saturating_add(Weight::from_parts(37_038, 0).saturating_mul(m.into())) + // Standard Error: 1_196 + .saturating_add(Weight::from_parts(203_435, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -155,13 +153,13 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `845 + m * (64 ±0)` - // Estimated: `4309 + m * (64 ±0)` - // Minimum execution time: 25_014_000 picoseconds. - Weight::from_parts(28_179_286, 0) - .saturating_add(Weight::from_parts(0, 4309)) - // Standard Error: 2_138 - .saturating_add(Weight::from_parts(37_745, 0).saturating_mul(m.into())) + // Measured: `808 + m * (64 ±0)` + // Estimated: `4272 + m * (64 ±0)` + // Minimum execution time: 28_571_000 picoseconds. + Weight::from_parts(29_711_839, 0) + .saturating_add(Weight::from_parts(0, 4272)) + // Standard Error: 825 + .saturating_add(Weight::from_parts(39_661, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -178,15 +176,15 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `434 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3879 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 23_225_000 picoseconds. - Weight::from_parts(23_099_384, 0) - .saturating_add(Weight::from_parts(0, 3879)) - // Standard Error: 1_321 - .saturating_add(Weight::from_parts(35_416, 0).saturating_mul(m.into())) - // Standard Error: 1_288 - .saturating_add(Weight::from_parts(203_259, 0).saturating_mul(p.into())) + // Measured: `397 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3842 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 27_742_000 picoseconds. + Weight::from_parts(28_014_736, 0) + .saturating_add(Weight::from_parts(0, 3842)) + // Standard Error: 1_221 + .saturating_add(Weight::from_parts(35_335, 0).saturating_mul(m.into())) + // Standard Error: 1_191 + .saturating_add(Weight::from_parts(193_513, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -205,17 +203,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `736 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4053 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 32_567_000 picoseconds. - Weight::from_parts(33_125_175, 0) - .saturating_add(Weight::from_parts(0, 4053)) - // Standard Error: 186 - .saturating_add(Weight::from_parts(2_905, 0).saturating_mul(b.into())) - // Standard Error: 1_966 - .saturating_add(Weight::from_parts(12_767, 0).saturating_mul(m.into())) - // Standard Error: 1_916 - .saturating_add(Weight::from_parts(257_858, 0).saturating_mul(p.into())) + // Measured: `699 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4016 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 38_274_000 picoseconds. + Weight::from_parts(37_886_500, 0) + .saturating_add(Weight::from_parts(0, 4016)) + // Standard Error: 165 + .saturating_add(Weight::from_parts(3_242, 0).saturating_mul(b.into())) + // Standard Error: 1_753 + .saturating_add(Weight::from_parts(33_851, 0).saturating_mul(m.into())) + // Standard Error: 1_709 + .saturating_add(Weight::from_parts(229_245, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -236,15 +234,15 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `532 + m * (48 ±0) + p * (36 ±0)` - // Estimated: `3972 + m * (49 ±0) + p * (36 ±0)` - // Minimum execution time: 24_415_000 picoseconds. - Weight::from_parts(24_329_845, 0) - .saturating_add(Weight::from_parts(0, 3972)) - // Standard Error: 1_288 - .saturating_add(Weight::from_parts(31_798, 0).saturating_mul(m.into())) - // Standard Error: 1_256 - .saturating_add(Weight::from_parts(215_755, 0).saturating_mul(p.into())) + // Measured: `495 + m * (48 ±0) + p * (36 ±0)` + // Estimated: `3935 + m * (49 ±0) + p * (36 ±0)` + // Minimum execution time: 29_178_000 picoseconds. + Weight::from_parts(28_752_686, 0) + .saturating_add(Weight::from_parts(0, 3935)) + // Standard Error: 1_230 + .saturating_add(Weight::from_parts(42_254, 0).saturating_mul(m.into())) + // Standard Error: 1_200 + .saturating_add(Weight::from_parts(210_610, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(m.into())) @@ -265,17 +263,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `756 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4073 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 35_236_000 picoseconds. - Weight::from_parts(35_625_683, 0) - .saturating_add(Weight::from_parts(0, 4073)) - // Standard Error: 273 - .saturating_add(Weight::from_parts(3_304, 0).saturating_mul(b.into())) - // Standard Error: 2_889 - .saturating_add(Weight::from_parts(369, 0).saturating_mul(m.into())) - // Standard Error: 2_816 - .saturating_add(Weight::from_parts(293_453, 0).saturating_mul(p.into())) + // Measured: `719 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4036 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 40_296_000 picoseconds. + Weight::from_parts(41_629_338, 0) + .saturating_add(Weight::from_parts(0, 4036)) + // Standard Error: 162 + .saturating_add(Weight::from_parts(2_608, 0).saturating_mul(b.into())) + // Standard Error: 1_717 + .saturating_add(Weight::from_parts(29_637, 0).saturating_mul(m.into())) + // Standard Error: 1_674 + .saturating_add(Weight::from_parts(230_371, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -293,18 +291,18 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `226 + p * (32 ±0)` // Estimated: `1711 + p * (32 ±0)` - // Minimum execution time: 12_189_000 picoseconds. - Weight::from_parts(12_697_701, 0) + // Minimum execution time: 15_385_000 picoseconds. + Weight::from_parts(17_009_286, 0) .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 1_203 - .saturating_add(Weight::from_parts(205_053, 0).saturating_mul(p.into())) + // Standard Error: 1_192 + .saturating_add(Weight::from_parts(170_070, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } /// Storage: `AllianceMotion::ProposalOf` (r:1 w:1) /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `AllianceMotion::CostOf` (r:1 w:1) + /// Storage: `AllianceMotion::CostOf` (r:1 w:0) /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `AllianceMotion::Proposals` (r:1 w:1) /// Proof: `AllianceMotion::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -314,33 +312,31 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1732 + d * (38 ±0) + p * (40 ±0)` - // Estimated: `5064 + d * (283 ±13) + p * (42 ±0)` - // Minimum execution time: 21_288_000 picoseconds. - Weight::from_parts(19_499_541, 0) - .saturating_add(Weight::from_parts(0, 5064)) - // Standard Error: 109_765 - .saturating_add(Weight::from_parts(5_586_813, 0).saturating_mul(d.into())) - // Standard Error: 1_699 - .saturating_add(Weight::from_parts(247_874, 0).saturating_mul(p.into())) + // Measured: `1497 + p * (36 ±0)` + // Estimated: `4896 + d * (123 ±6) + p * (37 ±0)` + // Minimum execution time: 22_455_000 picoseconds. + Weight::from_parts(24_273_426, 0) + .saturating_add(Weight::from_parts(0, 4896)) + // Standard Error: 82_114 + .saturating_add(Weight::from_parts(996_567, 0).saturating_mul(d.into())) + // Standard Error: 1_271 + .saturating_add(Weight::from_parts(213_968, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 283).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 42).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 123).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `AllianceMotion::ProposalOf` (r:1 w:0) /// Proof: `AllianceMotion::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `AllianceMotion::CostOf` (r:1 w:1) + /// Storage: `AllianceMotion::CostOf` (r:1 w:0) /// Proof: `AllianceMotion::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: - // Measured: `1624` - // Estimated: `5089` - // Minimum execution time: 26_174_000 picoseconds. - Weight::from_parts(27_245_000, 0) - .saturating_add(Weight::from_parts(0, 5089)) + // Measured: `911` + // Estimated: `4376` + // Minimum execution time: 18_273_000 picoseconds. + Weight::from_parts(19_196_000, 0) + .saturating_add(Weight::from_parts(0, 4376)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) } } From da151e18ab0c69d560b984336b1cb6d41467fcb8 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Sat, 31 Aug 2024 11:29:14 +0000 Subject: [PATCH 46/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 304 +++++++++++----------- 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 227629cf0c1d..6d6fb63bd7c7 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-696hpswk-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-svzsllib-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -81,12 +81,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 14_500_000 picoseconds. - Weight::from_parts(14_757_000, 15894) - // Standard Error: 59_477 - .saturating_add(Weight::from_parts(4_505_637, 0).saturating_mul(m.into())) - // Standard Error: 59_477 - .saturating_add(Weight::from_parts(7_968_384, 0).saturating_mul(p.into())) + // Minimum execution time: 16_709_000 picoseconds. + Weight::from_parts(16_854_000, 15894) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -106,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_111_000 picoseconds. - Weight::from_parts(16_217_737, 3997) - // Standard Error: 28 - .saturating_add(Weight::from_parts(1_525, 0).saturating_mul(b.into())) - // Standard Error: 295 - .saturating_add(Weight::from_parts(17_164, 0).saturating_mul(m.into())) + // Minimum execution time: 21_961_000 picoseconds. + Weight::from_parts(21_485_413, 3997) + // Standard Error: 34 + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) + // Standard Error: 359 + .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -129,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 18_689_000 picoseconds. - Weight::from_parts(17_817_417, 3997) - // Standard Error: 32 - .saturating_add(Weight::from_parts(1_681, 0).saturating_mul(b.into())) - // Standard Error: 337 - .saturating_add(Weight::from_parts(27_384, 0).saturating_mul(m.into())) + // Minimum execution time: 24_402_000 picoseconds. + Weight::from_parts(23_848_310, 3997) + // Standard Error: 38 + .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) + // Standard Error: 392 + .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -145,7 +145,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -159,14 +159,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 19_916_000 picoseconds. - Weight::from_parts(52_492_859, 3991) - // Standard Error: 424 - .saturating_add(Weight::from_parts(3_702, 0).saturating_mul(b.into())) - // Standard Error: 4_425 - .saturating_add(Weight::from_parts(57_614, 0).saturating_mul(m.into())) - // Standard Error: 4_369 - .saturating_add(Weight::from_parts(222_279, 0).saturating_mul(p.into())) + // Minimum execution time: 46_428_000 picoseconds. + Weight::from_parts(63_383_942, 3991) + // Standard Error: 354 + .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) + // Standard Error: 3_701 + .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) + // Standard Error: 3_654 + .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -181,10 +181,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_683_000 picoseconds. - Weight::from_parts(23_460_909, 4475) - // Standard Error: 767 - .saturating_add(Weight::from_parts(40_650, 0).saturating_mul(m.into())) + // Minimum execution time: 28_189_000 picoseconds. + Weight::from_parts(29_433_167, 4475) + // Standard Error: 1_047 + .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -203,12 +203,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 22_803_000 picoseconds. - Weight::from_parts(23_719_300, 4042) - // Standard Error: 1_193 - .saturating_add(Weight::from_parts(36_042, 0).saturating_mul(m.into())) - // Standard Error: 1_163 - .saturating_add(Weight::from_parts(172_333, 0).saturating_mul(p.into())) + // Minimum execution time: 27_685_000 picoseconds. + Weight::from_parts(30_678_718, 4042) + // Standard Error: 1_508 + .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) + // Standard Error: 1_471 + .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -233,14 +233,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 39_482_000 picoseconds. - Weight::from_parts(40_477_351, 4360) - // Standard Error: 186 - .saturating_add(Weight::from_parts(3_573, 0).saturating_mul(b.into())) - // Standard Error: 1_972 - .saturating_add(Weight::from_parts(36_211, 0).saturating_mul(m.into())) - // Standard Error: 1_922 - .saturating_add(Weight::from_parts(205_109, 0).saturating_mul(p.into())) + // Minimum execution time: 48_762_000 picoseconds. + Weight::from_parts(52_238_365, 4360) + // Standard Error: 215 + .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) + // Standard Error: 2_281 + .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -263,12 +263,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 24_721_000 picoseconds. - Weight::from_parts(28_482_318, 4062) - // Standard Error: 1_499 - .saturating_add(Weight::from_parts(38_125, 0).saturating_mul(m.into())) - // Standard Error: 1_462 - .saturating_add(Weight::from_parts(173_275, 0).saturating_mul(p.into())) + // Minimum execution time: 30_966_000 picoseconds. + Weight::from_parts(35_972_493, 4062) + // Standard Error: 2_006 + .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) + // Standard Error: 1_956 + .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -295,14 +295,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_520_000 picoseconds. - Weight::from_parts(44_345_807, 4380) - // Standard Error: 171 - .saturating_add(Weight::from_parts(2_576, 0).saturating_mul(b.into())) - // Standard Error: 1_810 - .saturating_add(Weight::from_parts(31_142, 0).saturating_mul(m.into())) - // Standard Error: 1_765 - .saturating_add(Weight::from_parts(203_408, 0).saturating_mul(p.into())) + // Minimum execution time: 52_523_000 picoseconds. + Weight::from_parts(57_791_105, 4380) + // Standard Error: 230 + .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) + // Standard Error: 2_431 + .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) + // Standard Error: 2_369 + .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -320,10 +320,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 11_569_000 picoseconds. - Weight::from_parts(13_919_245, 1877) - // Standard Error: 1_294 - .saturating_add(Weight::from_parts(157_836, 0).saturating_mul(p.into())) + // Minimum execution time: 14_738_000 picoseconds. + Weight::from_parts(17_394_689, 1877) + // Standard Error: 1_440 + .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -335,7 +335,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -345,18 +345,18 @@ impl WeightInfo for SubstrateWeight { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1883 ±0) + p * (43 ±0)` - // Minimum execution time: 17_684_000 picoseconds. - Weight::from_parts(18_208_253, 5172) - // Standard Error: 335_331 - .saturating_add(Weight::from_parts(30_061_511, 0).saturating_mul(d.into())) - // Standard Error: 5_193 - .saturating_add(Weight::from_parts(252_666, 0).saturating_mul(p.into())) + // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` + // Minimum execution time: 22_400_000 picoseconds. + Weight::from_parts(25_367_180, 5172) + // Standard Error: 402_814 + .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) + // Standard Error: 6_238 + .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) @@ -366,13 +366,13 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 56_117_000 picoseconds. - Weight::from_parts(57_676_000, 5429) + // Minimum execution time: 68_484_000 picoseconds. + Weight::from_parts(69_652_000, 5429) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -395,12 +395,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 14_500_000 picoseconds. - Weight::from_parts(14_757_000, 15894) - // Standard Error: 59_477 - .saturating_add(Weight::from_parts(4_505_637, 0).saturating_mul(m.into())) - // Standard Error: 59_477 - .saturating_add(Weight::from_parts(7_968_384, 0).saturating_mul(p.into())) + // Minimum execution time: 16_709_000 picoseconds. + Weight::from_parts(16_854_000, 15894) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -420,12 +420,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 17_111_000 picoseconds. - Weight::from_parts(16_217_737, 3997) - // Standard Error: 28 - .saturating_add(Weight::from_parts(1_525, 0).saturating_mul(b.into())) - // Standard Error: 295 - .saturating_add(Weight::from_parts(17_164, 0).saturating_mul(m.into())) + // Minimum execution time: 21_961_000 picoseconds. + Weight::from_parts(21_485_413, 3997) + // Standard Error: 34 + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) + // Standard Error: 359 + .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -443,12 +443,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 18_689_000 picoseconds. - Weight::from_parts(17_817_417, 3997) - // Standard Error: 32 - .saturating_add(Weight::from_parts(1_681, 0).saturating_mul(b.into())) - // Standard Error: 337 - .saturating_add(Weight::from_parts(27_384, 0).saturating_mul(m.into())) + // Minimum execution time: 24_402_000 picoseconds. + Weight::from_parts(23_848_310, 3997) + // Standard Error: 38 + .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) + // Standard Error: 392 + .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -459,7 +459,7 @@ impl WeightInfo for () { /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) /// Storage: `Council::ProposalCount` (r:1 w:1) /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -473,14 +473,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 19_916_000 picoseconds. - Weight::from_parts(52_492_859, 3991) - // Standard Error: 424 - .saturating_add(Weight::from_parts(3_702, 0).saturating_mul(b.into())) - // Standard Error: 4_425 - .saturating_add(Weight::from_parts(57_614, 0).saturating_mul(m.into())) - // Standard Error: 4_369 - .saturating_add(Weight::from_parts(222_279, 0).saturating_mul(p.into())) + // Minimum execution time: 46_428_000 picoseconds. + Weight::from_parts(63_383_942, 3991) + // Standard Error: 354 + .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) + // Standard Error: 3_701 + .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) + // Standard Error: 3_654 + .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -495,10 +495,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 22_683_000 picoseconds. - Weight::from_parts(23_460_909, 4475) - // Standard Error: 767 - .saturating_add(Weight::from_parts(40_650, 0).saturating_mul(m.into())) + // Minimum execution time: 28_189_000 picoseconds. + Weight::from_parts(29_433_167, 4475) + // Standard Error: 1_047 + .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -517,12 +517,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 22_803_000 picoseconds. - Weight::from_parts(23_719_300, 4042) - // Standard Error: 1_193 - .saturating_add(Weight::from_parts(36_042, 0).saturating_mul(m.into())) - // Standard Error: 1_163 - .saturating_add(Weight::from_parts(172_333, 0).saturating_mul(p.into())) + // Minimum execution time: 27_685_000 picoseconds. + Weight::from_parts(30_678_718, 4042) + // Standard Error: 1_508 + .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) + // Standard Error: 1_471 + .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -547,14 +547,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 39_482_000 picoseconds. - Weight::from_parts(40_477_351, 4360) - // Standard Error: 186 - .saturating_add(Weight::from_parts(3_573, 0).saturating_mul(b.into())) - // Standard Error: 1_972 - .saturating_add(Weight::from_parts(36_211, 0).saturating_mul(m.into())) - // Standard Error: 1_922 - .saturating_add(Weight::from_parts(205_109, 0).saturating_mul(p.into())) + // Minimum execution time: 48_762_000 picoseconds. + Weight::from_parts(52_238_365, 4360) + // Standard Error: 215 + .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) + // Standard Error: 2_281 + .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -577,12 +577,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 24_721_000 picoseconds. - Weight::from_parts(28_482_318, 4062) - // Standard Error: 1_499 - .saturating_add(Weight::from_parts(38_125, 0).saturating_mul(m.into())) - // Standard Error: 1_462 - .saturating_add(Weight::from_parts(173_275, 0).saturating_mul(p.into())) + // Minimum execution time: 30_966_000 picoseconds. + Weight::from_parts(35_972_493, 4062) + // Standard Error: 2_006 + .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) + // Standard Error: 1_956 + .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -609,14 +609,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 41_520_000 picoseconds. - Weight::from_parts(44_345_807, 4380) - // Standard Error: 171 - .saturating_add(Weight::from_parts(2_576, 0).saturating_mul(b.into())) - // Standard Error: 1_810 - .saturating_add(Weight::from_parts(31_142, 0).saturating_mul(m.into())) - // Standard Error: 1_765 - .saturating_add(Weight::from_parts(203_408, 0).saturating_mul(p.into())) + // Minimum execution time: 52_523_000 picoseconds. + Weight::from_parts(57_791_105, 4380) + // Standard Error: 230 + .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) + // Standard Error: 2_431 + .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) + // Standard Error: 2_369 + .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -634,10 +634,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 11_569_000 picoseconds. - Weight::from_parts(13_919_245, 1877) - // Standard Error: 1_294 - .saturating_add(Weight::from_parts(157_836, 0).saturating_mul(p.into())) + // Minimum execution time: 14_738_000 picoseconds. + Weight::from_parts(17_394_689, 1877) + // Standard Error: 1_440 + .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -649,7 +649,7 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) /// Storage: `Council::Proposals` (r:1 w:1) /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Voting` (r:0 w:1) @@ -659,18 +659,18 @@ impl WeightInfo for () { fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1883 ±0) + p * (43 ±0)` - // Minimum execution time: 17_684_000 picoseconds. - Weight::from_parts(18_208_253, 5172) - // Standard Error: 335_331 - .saturating_add(Weight::from_parts(30_061_511, 0).saturating_mul(d.into())) - // Standard Error: 5_193 - .saturating_add(Weight::from_parts(252_666, 0).saturating_mul(p.into())) + // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` + // Minimum execution time: 22_400_000 picoseconds. + Weight::from_parts(25_367_180, 5172) + // Standard Error: 402_814 + .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) + // Standard Error: 6_238 + .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1883).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:0) @@ -680,13 +680,13 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(301), added: 2776, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 56_117_000 picoseconds. - Weight::from_parts(57_676_000, 5429) + // Minimum execution time: 68_484_000 picoseconds. + Weight::from_parts(69_652_000, 5429) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } From e6b58918e3c49c9b0233afd8536323368057c00d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 31 Aug 2024 12:13:06 +0000 Subject: [PATCH 47/49] Update from mordamax running command 'bench --runtime dev --pallet pallet_collective' --- substrate/frame/collective/src/weights.rs | 602 +++++----------------- 1 file changed, 143 insertions(+), 459 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 6d6fb63bd7c7..ecec65d68579 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -17,55 +17,41 @@ //! Autogenerated weights for `pallet_collective` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 //! DATE: 2024-08-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-svzsllib-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! HOSTNAME: `573902f93b88`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// target/production/substrate-node +// frame-omni-bencher +// v1 // benchmark // pallet -// --steps=50 -// --repeat=20 // --extrinsic=* +// --runtime=target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm +// --pallet=pallet_collective +// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2 +// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/collective/src/weights.rs // --wasm-execution=compiled +// --steps=50 +// --repeat=20 // --heap-pages=4096 -// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json -// --pallet=pallet_collective -// --chain=dev -// --header=./substrate/HEADER-APACHE2 -// --output=./substrate/frame/collective/src/weights.rs -// --template=./substrate/.maintain/frame-weight-template.hbs +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions needed for `pallet_collective`. -pub trait WeightInfo { - fn set_members(m: u32, n: u32, p: u32, ) -> Weight; - fn execute(b: u32, m: u32, ) -> Weight; - fn propose_execute(b: u32, m: u32, ) -> Weight; - fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight; - fn vote(m: u32, ) -> Weight; - fn close_early_disapproved(m: u32, p: u32, ) -> Weight; - fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight; - fn close_disapproved(m: u32, p: u32, ) -> Weight; - fn close_approved(b: u32, m: u32, p: u32, ) -> Weight; - fn disapprove_proposal(p: u32, ) -> Weight; - fn kill(d: u32, p: u32, ) -> Weight; - fn release_proposal_cost() -> Weight; -} - -/// Weights for `pallet_collective` using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { /// Storage: `Council::Members` (r:1 w:1) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Proposals` (r:1 w:0) @@ -80,16 +66,17 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 16_709_000 picoseconds. - Weight::from_parts(16_854_000, 15894) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Estimated: `15670 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 18_092_000 picoseconds. + Weight::from_parts(18_580_000, 0) + .saturating_add(Weight::from_parts(0, 15670)) + // Standard Error: 69_024 + .saturating_add(Weight::from_parts(5_019_573, 0).saturating_mul(m.into())) + // Standard Error: 69_024 + .saturating_add(Weight::from_parts(11_054_194, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) @@ -104,15 +91,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `380 + m * (32 ±0)` + // Measured: `7 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_961_000 picoseconds. - Weight::from_parts(21_485_413, 3997) - // Standard Error: 34 - .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) - // Standard Error: 359 - .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) + // Minimum execution time: 21_928_000 picoseconds. + Weight::from_parts(20_958_454, 0) + .saturating_add(Weight::from_parts(0, 3997)) + // Standard Error: 94 + .saturating_add(Weight::from_parts(2_102, 0).saturating_mul(b.into())) + // Standard Error: 977 + .saturating_add(Weight::from_parts(21_990, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: `Council::Members` (r:1 w:0) @@ -127,15 +115,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `380 + m * (32 ±0)` + // Measured: `7 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 24_402_000 picoseconds. - Weight::from_parts(23_848_310, 3997) - // Standard Error: 38 - .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) - // Standard Error: 392 - .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Minimum execution time: 24_865_000 picoseconds. + Weight::from_parts(24_467_915, 0) + .saturating_add(Weight::from_parts(0, 3997)) + // Standard Error: 101 + .saturating_add(Weight::from_parts(2_093, 0).saturating_mul(b.into())) + // Standard Error: 1_046 + .saturating_add(Weight::from_parts(27_334, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: `Council::Members` (r:1 w:0) @@ -157,18 +146,19 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `618 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 46_428_000 picoseconds. - Weight::from_parts(63_383_942, 3991) - // Standard Error: 354 - .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) - // Standard Error: 3_701 - .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) - // Standard Error: 3_654 - .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + // Measured: `392 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3802 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 61_725_000 picoseconds. + Weight::from_parts(78_401_878, 0) + .saturating_add(Weight::from_parts(0, 3802)) + // Standard Error: 628 + .saturating_add(Weight::from_parts(13_504, 0).saturating_mul(b.into())) + // Standard Error: 6_555 + .saturating_add(Weight::from_parts(81_321, 0).saturating_mul(m.into())) + // Standard Error: 6_472 + .saturating_add(Weight::from_parts(540_119, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(6)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -179,14 +169,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1011 + m * (64 ±0)` - // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 28_189_000 picoseconds. - Weight::from_parts(29_433_167, 4475) - // Standard Error: 1_047 - .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `787 + m * (64 ±0)` + // Estimated: `4251 + m * (64 ±0)` + // Minimum execution time: 39_310_000 picoseconds. + Weight::from_parts(45_729_710, 0) + .saturating_add(Weight::from_parts(0, 4251)) + // Standard Error: 4_257 + .saturating_add(Weight::from_parts(49_236, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -201,16 +192,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `600 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_685_000 picoseconds. - Weight::from_parts(30_678_718, 4042) - // Standard Error: 1_508 - .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) - // Standard Error: 1_471 - .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `371 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3818 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 33_507_000 picoseconds. + Weight::from_parts(35_839_306, 0) + .saturating_add(Weight::from_parts(0, 3818)) + // Standard Error: 4_541 + .saturating_add(Weight::from_parts(54_956, 0).saturating_mul(m.into())) + // Standard Error: 4_428 + .saturating_add(Weight::from_parts(451_955, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -231,18 +223,19 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 48_762_000 picoseconds. - Weight::from_parts(52_238_365, 4360) - // Standard Error: 215 - .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) - // Standard Error: 2_281 - .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) - // Standard Error: 2_223 - .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `662 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `3997 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 53_275_000 picoseconds. + Weight::from_parts(58_740_612, 0) + .saturating_add(Weight::from_parts(0, 3997)) + // Standard Error: 652 + .saturating_add(Weight::from_parts(8_946, 0).saturating_mul(b.into())) + // Standard Error: 6_895 + .saturating_add(Weight::from_parts(9_639, 0).saturating_mul(m.into())) + // Standard Error: 6_721 + .saturating_add(Weight::from_parts(551_232, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) @@ -261,16 +254,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `620 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 30_966_000 picoseconds. - Weight::from_parts(35_972_493, 4062) - // Standard Error: 2_006 - .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) - // Standard Error: 1_956 - .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `391 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3838 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 35_870_000 picoseconds. + Weight::from_parts(40_146_526, 0) + .saturating_add(Weight::from_parts(0, 3838)) + // Standard Error: 4_568 + .saturating_add(Weight::from_parts(56_723, 0).saturating_mul(m.into())) + // Standard Error: 4_454 + .saturating_add(Weight::from_parts(432_403, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -293,18 +287,19 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 52_523_000 picoseconds. - Weight::from_parts(57_791_105, 4380) - // Standard Error: 230 - .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) - // Standard Error: 2_431 - .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) - // Standard Error: 2_369 - .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `682 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4010 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 57_223_000 picoseconds. + Weight::from_parts(56_504_155, 0) + .saturating_add(Weight::from_parts(0, 4010)) + // Standard Error: 629 + .saturating_add(Weight::from_parts(6_604, 0).saturating_mul(b.into())) + // Standard Error: 6_654 + .saturating_add(Weight::from_parts(82_295, 0).saturating_mul(m.into())) + // Standard Error: 6_486 + .saturating_add(Weight::from_parts(553_461, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) @@ -318,14 +313,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + p * (32 ±0)` - // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 14_738_000 picoseconds. - Weight::from_parts(17_394_689, 1877) - // Standard Error: 1_440 - .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `168 + p * (32 ±0)` + // Estimated: `1653 + p * (32 ±0)` + // Minimum execution time: 17_422_000 picoseconds. + Weight::from_parts(22_041_424, 0) + .saturating_add(Weight::from_parts(0, 1653)) + // Standard Error: 4_886 + .saturating_add(Weight::from_parts(395_215, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:1) @@ -344,17 +340,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` - // Minimum execution time: 22_400_000 picoseconds. - Weight::from_parts(25_367_180, 5172) - // Standard Error: 402_814 - .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) - // Standard Error: 6_238 - .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) + // Measured: `1635 + d * (163 ±0) + p * (41 ±0)` + // Estimated: `4954 + d * (1901 ±14) + p * (43 ±0)` + // Minimum execution time: 26_166_000 picoseconds. + Weight::from_parts(20_551_852, 0) + .saturating_add(Weight::from_parts(0, 4954)) + // Standard Error: 564_640 + .saturating_add(Weight::from_parts(49_116_606, 0).saturating_mul(d.into())) + // Standard Error: 8_744 + .saturating_add(Weight::from_parts(610_080, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) @@ -369,325 +366,12 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: - // Measured: `1964` - // Estimated: `5429` - // Minimum execution time: 68_484_000 picoseconds. - Weight::from_parts(69_652_000, 5429) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } -} - -// For backwards compatibility and tests. -impl WeightInfo for () { - /// Storage: `Council::Members` (r:1 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:100 w:100) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:0 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[0, 100]`. - /// The range of component `n` is `[0, 100]`. - /// The range of component `p` is `[0, 100]`. - fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 16_709_000 picoseconds. - Weight::from_parts(16_854_000, 15894) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) - /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `TxPause::PausedCalls` (r:1 w:0) - /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `380 + m * (32 ±0)` - // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_961_000 picoseconds. - Weight::from_parts(21_485_413, 3997) - // Standard Error: 34 - .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) - // Standard Error: 359 - .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:0) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) - /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `TxPause::PausedCalls` (r:1 w:0) - /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `380 + m * (32 ±0)` - // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 24_402_000 picoseconds. - Weight::from_parts(23_848_310, 3997) - // Standard Error: 38 - .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) - // Standard Error: 392 - .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) - /// Storage: `Council::ProposalCount` (r:1 w:1) - /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::CostOf` (r:0 w:1) - /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[2, 100]`. - /// The range of component `p` is `[1, 100]`. - fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `618 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 46_428_000 picoseconds. - Weight::from_parts(63_383_942, 3991) - // Standard Error: 354 - .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) - // Standard Error: 3_701 - .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) - // Standard Error: 3_654 - .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[5, 100]`. - fn vote(m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1011 + m * (64 ±0)` - // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 28_189_000 picoseconds. - Weight::from_parts(29_433_167, 4475) - // Standard Error: 1_047 - .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `600 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_685_000 picoseconds. - Weight::from_parts(30_678_718, 4042) - // Standard Error: 1_508 - .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) - // Standard Error: 1_471 - .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) - /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `TxPause::PausedCalls` (r:1 w:0) - /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 48_762_000 picoseconds. - Weight::from_parts(52_238_365, 4360) - // Standard Error: 215 - .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) - // Standard Error: 2_281 - .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) - // Standard Error: 2_223 - .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(6_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `620 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 30_966_000 picoseconds. - Weight::from_parts(35_972_493, 4062) - // Standard Error: 2_006 - .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) - // Standard Error: 1_956 - .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) - /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `TxPause::PausedCalls` (r:1 w:0) - /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 52_523_000 picoseconds. - Weight::from_parts(57_791_105, 4380) - // Standard Error: 230 - .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) - // Standard Error: 2_431 - .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) - // Standard Error: 2_369 - .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[1, 100]`. - fn disapprove_proposal(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `392 + p * (32 ±0)` - // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 14_738_000 picoseconds. - Weight::from_parts(17_394_689, 1877) - // Standard Error: 1_440 - .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) - } - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::CostOf` (r:1 w:1) - /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `d` is `[0, 1]`. - /// The range of component `p` is `[1, 100]`. - fn kill(d: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` - // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` - // Minimum execution time: 22_400_000 picoseconds. - Weight::from_parts(25_367_180, 5172) - // Standard Error: 402_814 - .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) - // Standard Error: 6_238 - .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) - } - /// Storage: `Council::ProposalOf` (r:1 w:0) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::CostOf` (r:1 w:1) - /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) - fn release_proposal_cost() -> Weight { - // Proof Size summary in bytes: - // Measured: `1964` - // Estimated: `5429` - // Minimum execution time: 68_484_000 picoseconds. - Weight::from_parts(69_652_000, 5429) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `1691` + // Estimated: `5156` + // Minimum execution time: 93_498_000 picoseconds. + Weight::from_parts(100_218_000, 0) + .saturating_add(Weight::from_parts(0, 5156)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } } From fbb88c9a18f343498c4e76123fc2eb259364f7ff Mon Sep 17 00:00:00 2001 From: muharem Date: Mon, 2 Sep 2024 10:54:30 +0200 Subject: [PATCH 48/49] fix weights --- substrate/frame/collective/src/weights.rs | 602 +++++++++++++++++----- 1 file changed, 459 insertions(+), 143 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index ecec65d68579..6d6fb63bd7c7 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -17,41 +17,55 @@ //! Autogenerated weights for `pallet_collective` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-08-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `573902f93b88`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 +//! HOSTNAME: `runner-svzsllib-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// frame-omni-bencher -// v1 +// target/production/substrate-node // benchmark // pallet -// --extrinsic=* -// --runtime=target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm -// --pallet=pallet_collective -// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2 -// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/collective/src/weights.rs -// --wasm-execution=compiled // --steps=50 // --repeat=20 +// --extrinsic=* +// --wasm-execution=compiled // --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_collective +// --chain=dev +// --header=./substrate/HEADER-APACHE2 +// --output=./substrate/frame/collective/src/weights.rs +// --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions for `pallet_collective`. -pub struct WeightInfo(PhantomData); -impl pallet_collective::WeightInfo for WeightInfo { +/// Weight functions needed for `pallet_collective`. +pub trait WeightInfo { + fn set_members(m: u32, n: u32, p: u32, ) -> Weight; + fn execute(b: u32, m: u32, ) -> Weight; + fn propose_execute(b: u32, m: u32, ) -> Weight; + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight; + fn vote(m: u32, ) -> Weight; + fn close_early_disapproved(m: u32, p: u32, ) -> Weight; + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight; + fn close_disapproved(m: u32, p: u32, ) -> Weight; + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight; + fn disapprove_proposal(p: u32, ) -> Weight; + fn kill(d: u32, p: u32, ) -> Weight; + fn release_proposal_cost() -> Weight; +} + +/// Weights for `pallet_collective` using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { /// Storage: `Council::Members` (r:1 w:1) /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Council::Proposals` (r:1 w:0) @@ -66,17 +80,16 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15670 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 18_092_000 picoseconds. - Weight::from_parts(18_580_000, 0) - .saturating_add(Weight::from_parts(0, 15670)) - // Standard Error: 69_024 - .saturating_add(Weight::from_parts(5_019_573, 0).saturating_mul(m.into())) - // Standard Error: 69_024 - .saturating_add(Weight::from_parts(11_054_194, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 16_709_000 picoseconds. + Weight::from_parts(16_854_000, 15894) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) @@ -91,16 +104,15 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `7 + m * (32 ±0)` + // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_928_000 picoseconds. - Weight::from_parts(20_958_454, 0) - .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 94 - .saturating_add(Weight::from_parts(2_102, 0).saturating_mul(b.into())) - // Standard Error: 977 - .saturating_add(Weight::from_parts(21_990, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Minimum execution time: 21_961_000 picoseconds. + Weight::from_parts(21_485_413, 3997) + // Standard Error: 34 + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) + // Standard Error: 359 + .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: `Council::Members` (r:1 w:0) @@ -115,16 +127,15 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `7 + m * (32 ±0)` + // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 24_865_000 picoseconds. - Weight::from_parts(24_467_915, 0) - .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 101 - .saturating_add(Weight::from_parts(2_093, 0).saturating_mul(b.into())) - // Standard Error: 1_046 - .saturating_add(Weight::from_parts(27_334, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Minimum execution time: 24_402_000 picoseconds. + Weight::from_parts(23_848_310, 3997) + // Standard Error: 38 + .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) + // Standard Error: 392 + .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: `Council::Members` (r:1 w:0) @@ -146,19 +157,18 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3802 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 61_725_000 picoseconds. - Weight::from_parts(78_401_878, 0) - .saturating_add(Weight::from_parts(0, 3802)) - // Standard Error: 628 - .saturating_add(Weight::from_parts(13_504, 0).saturating_mul(b.into())) - // Standard Error: 6_555 - .saturating_add(Weight::from_parts(81_321, 0).saturating_mul(m.into())) - // Standard Error: 6_472 - .saturating_add(Weight::from_parts(540_119, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(6)) + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 46_428_000 picoseconds. + Weight::from_parts(63_383_942, 3991) + // Standard Error: 354 + .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) + // Standard Error: 3_701 + .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) + // Standard Error: 3_654 + .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -169,15 +179,14 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `787 + m * (64 ±0)` - // Estimated: `4251 + m * (64 ±0)` - // Minimum execution time: 39_310_000 picoseconds. - Weight::from_parts(45_729_710, 0) - .saturating_add(Weight::from_parts(0, 4251)) - // Standard Error: 4_257 - .saturating_add(Weight::from_parts(49_236, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `1011 + m * (64 ±0)` + // Estimated: `4475 + m * (64 ±0)` + // Minimum execution time: 28_189_000 picoseconds. + Weight::from_parts(29_433_167, 4475) + // Standard Error: 1_047 + .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: `Council::Voting` (r:1 w:1) @@ -192,17 +201,16 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `371 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3818 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 33_507_000 picoseconds. - Weight::from_parts(35_839_306, 0) - .saturating_add(Weight::from_parts(0, 3818)) - // Standard Error: 4_541 - .saturating_add(Weight::from_parts(54_956, 0).saturating_mul(m.into())) - // Standard Error: 4_428 - .saturating_add(Weight::from_parts(451_955, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 27_685_000 picoseconds. + Weight::from_parts(30_678_718, 4042) + // Standard Error: 1_508 + .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) + // Standard Error: 1_471 + .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -223,19 +231,18 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `662 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `3997 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 53_275_000 picoseconds. - Weight::from_parts(58_740_612, 0) - .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 652 - .saturating_add(Weight::from_parts(8_946, 0).saturating_mul(b.into())) - // Standard Error: 6_895 - .saturating_add(Weight::from_parts(9_639, 0).saturating_mul(m.into())) - // Standard Error: 6_721 - .saturating_add(Weight::from_parts(551_232, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 48_762_000 picoseconds. + Weight::from_parts(52_238_365, 4360) + // Standard Error: 215 + .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) + // Standard Error: 2_281 + .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) @@ -254,17 +261,16 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `391 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3838 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 35_870_000 picoseconds. - Weight::from_parts(40_146_526, 0) - .saturating_add(Weight::from_parts(0, 3838)) - // Standard Error: 4_568 - .saturating_add(Weight::from_parts(56_723, 0).saturating_mul(m.into())) - // Standard Error: 4_454 - .saturating_add(Weight::from_parts(432_403, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 30_966_000 picoseconds. + Weight::from_parts(35_972_493, 4062) + // Standard Error: 2_006 + .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) + // Standard Error: 1_956 + .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } @@ -287,19 +293,18 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `682 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4010 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 57_223_000 picoseconds. - Weight::from_parts(56_504_155, 0) - .saturating_add(Weight::from_parts(0, 4010)) - // Standard Error: 629 - .saturating_add(Weight::from_parts(6_604, 0).saturating_mul(b.into())) - // Standard Error: 6_654 - .saturating_add(Weight::from_parts(82_295, 0).saturating_mul(m.into())) - // Standard Error: 6_486 - .saturating_add(Weight::from_parts(553_461, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 52_523_000 picoseconds. + Weight::from_parts(57_791_105, 4380) + // Standard Error: 230 + .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) + // Standard Error: 2_431 + .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) + // Standard Error: 2_369 + .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) @@ -313,15 +318,14 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `168 + p * (32 ±0)` - // Estimated: `1653 + p * (32 ±0)` - // Minimum execution time: 17_422_000 picoseconds. - Weight::from_parts(22_041_424, 0) - .saturating_add(Weight::from_parts(0, 1653)) - // Standard Error: 4_886 - .saturating_add(Weight::from_parts(395_215, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `392 + p * (32 ±0)` + // Estimated: `1877 + p * (32 ±0)` + // Minimum execution time: 14_738_000 picoseconds. + Weight::from_parts(17_394_689, 1877) + // Standard Error: 1_440 + .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } /// Storage: `Council::ProposalOf` (r:1 w:1) @@ -340,18 +344,17 @@ impl pallet_collective::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 100]`. fn kill(d: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1635 + d * (163 ±0) + p * (41 ±0)` - // Estimated: `4954 + d * (1901 ±14) + p * (43 ±0)` - // Minimum execution time: 26_166_000 picoseconds. - Weight::from_parts(20_551_852, 0) - .saturating_add(Weight::from_parts(0, 4954)) - // Standard Error: 564_640 - .saturating_add(Weight::from_parts(49_116_606, 0).saturating_mul(d.into())) - // Standard Error: 8_744 - .saturating_add(Weight::from_parts(610_080, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` + // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` + // Minimum execution time: 22_400_000 picoseconds. + Weight::from_parts(25_367_180, 5172) + // Standard Error: 402_814 + .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) + // Standard Error: 6_238 + .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) @@ -366,12 +369,325 @@ impl pallet_collective::WeightInfo for WeightInfo { /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) fn release_proposal_cost() -> Weight { // Proof Size summary in bytes: - // Measured: `1691` - // Estimated: `5156` - // Minimum execution time: 93_498_000 picoseconds. - Weight::from_parts(100_218_000, 0) - .saturating_add(Weight::from_parts(0, 5156)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `1964` + // Estimated: `5429` + // Minimum execution time: 68_484_000 picoseconds. + Weight::from_parts(69_652_000, 5429) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: `Council::Members` (r:1 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:100 w:100) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:0 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 16_709_000 picoseconds. + Weight::from_parts(16_854_000, 15894) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) + // Standard Error: 67_035 + .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 21_961_000 picoseconds. + Weight::from_parts(21_485_413, 3997) + // Standard Error: 34 + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) + // Standard Error: 359 + .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `380 + m * (32 ±0)` + // Estimated: `3997 + m * (32 ±0)` + // Minimum execution time: 24_402_000 picoseconds. + Weight::from_parts(23_848_310, 3997) + // Standard Error: 38 + .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) + // Standard Error: 392 + .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) + /// Storage: `Council::ProposalCount` (r:1 w:1) + /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:0 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `618 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 46_428_000 picoseconds. + Weight::from_parts(63_383_942, 3991) + // Standard Error: 354 + .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) + // Standard Error: 3_701 + .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) + // Standard Error: 3_654 + .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1011 + m * (64 ±0)` + // Estimated: `4475 + m * (64 ±0)` + // Minimum execution time: 28_189_000 picoseconds. + Weight::from_parts(29_433_167, 4475) + // Standard Error: 1_047 + .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `600 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 27_685_000 picoseconds. + Weight::from_parts(30_678_718, 4042) + // Standard Error: 1_508 + .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) + // Standard Error: 1_471 + .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 48_762_000 picoseconds. + Weight::from_parts(52_238_365, 4360) + // Standard Error: 215 + .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) + // Standard Error: 2_281 + .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) + // Standard Error: 2_223 + .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `620 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 30_966_000 picoseconds. + Weight::from_parts(35_972_493, 4062) + // Standard Error: 2_006 + .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) + // Standard Error: 1_956 + .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: `Council::Voting` (r:1 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:1 w:0) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:0) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 52_523_000 picoseconds. + Weight::from_parts(57_791_105, 4380) + // Standard Error: 230 + .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) + // Standard Error: 2_431 + .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) + // Standard Error: 2_369 + .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::ProposalOf` (r:0 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `392 + p * (32 ±0)` + // Estimated: `1877 + p * (32 ±0)` + // Minimum execution time: 14_738_000 picoseconds. + Weight::from_parts(17_394_689, 1877) + // Standard Error: 1_440 + .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } + /// Storage: `Council::ProposalOf` (r:1 w:1) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) + /// Storage: `Council::Proposals` (r:1 w:1) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Voting` (r:0 w:1) + /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `d` is `[0, 1]`. + /// The range of component `p` is `[1, 100]`. + fn kill(d: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` + // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` + // Minimum execution time: 22_400_000 picoseconds. + Weight::from_parts(25_367_180, 5172) + // Standard Error: 402_814 + .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) + // Standard Error: 6_238 + .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into()))) + .saturating_add(Weight::from_parts(0, 1901).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into())) + } + /// Storage: `Council::ProposalOf` (r:1 w:0) + /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::CostOf` (r:1 w:1) + /// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(337), added: 2812, mode: `MaxEncodedLen`) + fn release_proposal_cost() -> Weight { + // Proof Size summary in bytes: + // Measured: `1964` + // Estimated: `5429` + // Minimum execution time: 68_484_000 picoseconds. + Weight::from_parts(69_652_000, 5429) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } } From 452095081c104d68cc0f79c96d09d78124c91741 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 2 Sep 2024 09:49:05 +0000 Subject: [PATCH 49/49] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective --- substrate/frame/collective/src/weights.rs | 282 +++++++++++----------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/substrate/frame/collective/src/weights.rs b/substrate/frame/collective/src/weights.rs index 6d6fb63bd7c7..1a7485b4ab7b 100644 --- a/substrate/frame/collective/src/weights.rs +++ b/substrate/frame/collective/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-09-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `runner-svzsllib-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` @@ -80,13 +80,13 @@ impl WeightInfo for SubstrateWeight { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 16_709_000 picoseconds. - Weight::from_parts(16_854_000, 15894) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 16_699_000 picoseconds. + Weight::from_parts(17_015_000, 15894) + // Standard Error: 63_844 + .saturating_add(Weight::from_parts(4_593_256, 0).saturating_mul(m.into())) + // Standard Error: 63_844 + .saturating_add(Weight::from_parts(8_935_845, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -106,12 +106,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_961_000 picoseconds. - Weight::from_parts(21_485_413, 3997) + // Minimum execution time: 22_010_000 picoseconds. + Weight::from_parts(21_392_812, 3997) // Standard Error: 34 - .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) - // Standard Error: 359 - .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(1_533, 0).saturating_mul(b.into())) + // Standard Error: 354 + .saturating_add(Weight::from_parts(15_866, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -129,12 +129,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 24_402_000 picoseconds. - Weight::from_parts(23_848_310, 3997) - // Standard Error: 38 - .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) - // Standard Error: 392 - .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) + // Minimum execution time: 24_250_000 picoseconds. + Weight::from_parts(23_545_893, 3997) + // Standard Error: 40 + .saturating_add(Weight::from_parts(1_646, 0).saturating_mul(b.into())) + // Standard Error: 421 + .saturating_add(Weight::from_parts(26_248, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -159,14 +159,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 46_428_000 picoseconds. - Weight::from_parts(63_383_942, 3991) - // Standard Error: 354 - .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) - // Standard Error: 3_701 - .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) - // Standard Error: 3_654 - .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) + // Minimum execution time: 46_538_000 picoseconds. + Weight::from_parts(63_900_448, 3991) + // Standard Error: 350 + .saturating_add(Weight::from_parts(2_827, 0).saturating_mul(b.into())) + // Standard Error: 3_658 + .saturating_add(Weight::from_parts(53_340, 0).saturating_mul(m.into())) + // Standard Error: 3_611 + .saturating_add(Weight::from_parts(213_719, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -181,10 +181,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 28_189_000 picoseconds. - Weight::from_parts(29_433_167, 4475) - // Standard Error: 1_047 - .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) + // Minimum execution time: 28_413_000 picoseconds. + Weight::from_parts(28_981_832, 4475) + // Standard Error: 665 + .saturating_add(Weight::from_parts(43_005, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -203,12 +203,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_685_000 picoseconds. - Weight::from_parts(30_678_718, 4042) - // Standard Error: 1_508 - .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) - // Standard Error: 1_471 - .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) + // Minimum execution time: 27_725_000 picoseconds. + Weight::from_parts(30_174_093, 4042) + // Standard Error: 1_458 + .saturating_add(Weight::from_parts(41_100, 0).saturating_mul(m.into())) + // Standard Error: 1_422 + .saturating_add(Weight::from_parts(177_303, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -233,14 +233,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 48_762_000 picoseconds. - Weight::from_parts(52_238_365, 4360) - // Standard Error: 215 - .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) - // Standard Error: 2_281 - .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) - // Standard Error: 2_223 - .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) + // Minimum execution time: 48_882_000 picoseconds. + Weight::from_parts(51_938_773, 4360) + // Standard Error: 208 + .saturating_add(Weight::from_parts(3_559, 0).saturating_mul(b.into())) + // Standard Error: 2_201 + .saturating_add(Weight::from_parts(38_678, 0).saturating_mul(m.into())) + // Standard Error: 2_145 + .saturating_add(Weight::from_parts(214_061, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -263,12 +263,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 30_966_000 picoseconds. - Weight::from_parts(35_972_493, 4062) - // Standard Error: 2_006 - .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) - // Standard Error: 1_956 - .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) + // Minimum execution time: 30_613_000 picoseconds. + Weight::from_parts(36_174_190, 4062) + // Standard Error: 1_899 + .saturating_add(Weight::from_parts(46_781, 0).saturating_mul(m.into())) + // Standard Error: 1_851 + .saturating_add(Weight::from_parts(185_875, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -295,14 +295,14 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 52_523_000 picoseconds. - Weight::from_parts(57_791_105, 4380) - // Standard Error: 230 - .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) - // Standard Error: 2_431 - .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) - // Standard Error: 2_369 - .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) + // Minimum execution time: 51_253_000 picoseconds. + Weight::from_parts(56_399_941, 4380) + // Standard Error: 218 + .saturating_add(Weight::from_parts(2_920, 0).saturating_mul(b.into())) + // Standard Error: 2_310 + .saturating_add(Weight::from_parts(30_473, 0).saturating_mul(m.into())) + // Standard Error: 2_252 + .saturating_add(Weight::from_parts(208_468, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -320,10 +320,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 14_738_000 picoseconds. - Weight::from_parts(17_394_689, 1877) - // Standard Error: 1_440 - .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) + // Minimum execution time: 14_646_000 picoseconds. + Weight::from_parts(17_305_497, 1877) + // Standard Error: 1_331 + .saturating_add(Weight::from_parts(156_038, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -346,12 +346,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` - // Minimum execution time: 22_400_000 picoseconds. - Weight::from_parts(25_367_180, 5172) - // Standard Error: 402_814 - .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) - // Standard Error: 6_238 - .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) + // Minimum execution time: 22_164_000 picoseconds. + Weight::from_parts(24_932_256, 5172) + // Standard Error: 404_014 + .saturating_add(Weight::from_parts(33_833_807, 0).saturating_mul(d.into())) + // Standard Error: 6_256 + .saturating_add(Weight::from_parts(281_910, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -371,8 +371,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 68_484_000 picoseconds. - Weight::from_parts(69_652_000, 5429) + // Minimum execution time: 69_220_000 picoseconds. + Weight::from_parts(70_215_000, 5429) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -394,13 +394,13 @@ impl WeightInfo for () { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15894 + m * (1967 ±24) + p * (4332 ±24)` - // Minimum execution time: 16_709_000 picoseconds. - Weight::from_parts(16_854_000, 15894) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(4_753_718, 0).saturating_mul(m.into())) - // Standard Error: 67_035 - .saturating_add(Weight::from_parts(9_194_638, 0).saturating_mul(p.into())) + // Estimated: `15894 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 16_699_000 picoseconds. + Weight::from_parts(17_015_000, 15894) + // Standard Error: 63_844 + .saturating_add(Weight::from_parts(4_593_256, 0).saturating_mul(m.into())) + // Standard Error: 63_844 + .saturating_add(Weight::from_parts(8_935_845, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -420,12 +420,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 21_961_000 picoseconds. - Weight::from_parts(21_485_413, 3997) + // Minimum execution time: 22_010_000 picoseconds. + Weight::from_parts(21_392_812, 3997) // Standard Error: 34 - .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(b.into())) - // Standard Error: 359 - .saturating_add(Weight::from_parts(16_911, 0).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(1_533, 0).saturating_mul(b.into())) + // Standard Error: 354 + .saturating_add(Weight::from_parts(15_866, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -443,12 +443,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `380 + m * (32 ±0)` // Estimated: `3997 + m * (32 ±0)` - // Minimum execution time: 24_402_000 picoseconds. - Weight::from_parts(23_848_310, 3997) - // Standard Error: 38 - .saturating_add(Weight::from_parts(1_558, 0).saturating_mul(b.into())) - // Standard Error: 392 - .saturating_add(Weight::from_parts(24_747, 0).saturating_mul(m.into())) + // Minimum execution time: 24_250_000 picoseconds. + Weight::from_parts(23_545_893, 3997) + // Standard Error: 40 + .saturating_add(Weight::from_parts(1_646, 0).saturating_mul(b.into())) + // Standard Error: 421 + .saturating_add(Weight::from_parts(26_248, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -473,14 +473,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `618 + m * (32 ±0) + p * (36 ±0)` // Estimated: `3991 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 46_428_000 picoseconds. - Weight::from_parts(63_383_942, 3991) - // Standard Error: 354 - .saturating_add(Weight::from_parts(2_917, 0).saturating_mul(b.into())) - // Standard Error: 3_701 - .saturating_add(Weight::from_parts(60_903, 0).saturating_mul(m.into())) - // Standard Error: 3_654 - .saturating_add(Weight::from_parts(213_816, 0).saturating_mul(p.into())) + // Minimum execution time: 46_538_000 picoseconds. + Weight::from_parts(63_900_448, 3991) + // Standard Error: 350 + .saturating_add(Weight::from_parts(2_827, 0).saturating_mul(b.into())) + // Standard Error: 3_658 + .saturating_add(Weight::from_parts(53_340, 0).saturating_mul(m.into())) + // Standard Error: 3_611 + .saturating_add(Weight::from_parts(213_719, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) @@ -495,10 +495,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1011 + m * (64 ±0)` // Estimated: `4475 + m * (64 ±0)` - // Minimum execution time: 28_189_000 picoseconds. - Weight::from_parts(29_433_167, 4475) - // Standard Error: 1_047 - .saturating_add(Weight::from_parts(44_181, 0).saturating_mul(m.into())) + // Minimum execution time: 28_413_000 picoseconds. + Weight::from_parts(28_981_832, 4475) + // Standard Error: 665 + .saturating_add(Weight::from_parts(43_005, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) @@ -517,12 +517,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `600 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4042 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 27_685_000 picoseconds. - Weight::from_parts(30_678_718, 4042) - // Standard Error: 1_508 - .saturating_add(Weight::from_parts(40_184, 0).saturating_mul(m.into())) - // Standard Error: 1_471 - .saturating_add(Weight::from_parts(176_240, 0).saturating_mul(p.into())) + // Minimum execution time: 27_725_000 picoseconds. + Weight::from_parts(30_174_093, 4042) + // Standard Error: 1_458 + .saturating_add(Weight::from_parts(41_100, 0).saturating_mul(m.into())) + // Standard Error: 1_422 + .saturating_add(Weight::from_parts(177_303, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -547,14 +547,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1047 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4360 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 48_762_000 picoseconds. - Weight::from_parts(52_238_365, 4360) - // Standard Error: 215 - .saturating_add(Weight::from_parts(3_761, 0).saturating_mul(b.into())) - // Standard Error: 2_281 - .saturating_add(Weight::from_parts(39_399, 0).saturating_mul(m.into())) - // Standard Error: 2_223 - .saturating_add(Weight::from_parts(215_081, 0).saturating_mul(p.into())) + // Minimum execution time: 48_882_000 picoseconds. + Weight::from_parts(51_938_773, 4360) + // Standard Error: 208 + .saturating_add(Weight::from_parts(3_559, 0).saturating_mul(b.into())) + // Standard Error: 2_201 + .saturating_add(Weight::from_parts(38_678, 0).saturating_mul(m.into())) + // Standard Error: 2_145 + .saturating_add(Weight::from_parts(214_061, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -577,12 +577,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `620 + m * (64 ±0) + p * (36 ±0)` // Estimated: `4062 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 30_966_000 picoseconds. - Weight::from_parts(35_972_493, 4062) - // Standard Error: 2_006 - .saturating_add(Weight::from_parts(48_936, 0).saturating_mul(m.into())) - // Standard Error: 1_956 - .saturating_add(Weight::from_parts(194_626, 0).saturating_mul(p.into())) + // Minimum execution time: 30_613_000 picoseconds. + Weight::from_parts(36_174_190, 4062) + // Standard Error: 1_899 + .saturating_add(Weight::from_parts(46_781, 0).saturating_mul(m.into())) + // Standard Error: 1_851 + .saturating_add(Weight::from_parts(185_875, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) @@ -609,14 +609,14 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1067 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` // Estimated: `4380 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 52_523_000 picoseconds. - Weight::from_parts(57_791_105, 4380) - // Standard Error: 230 - .saturating_add(Weight::from_parts(2_464, 0).saturating_mul(b.into())) - // Standard Error: 2_431 - .saturating_add(Weight::from_parts(27_026, 0).saturating_mul(m.into())) - // Standard Error: 2_369 - .saturating_add(Weight::from_parts(210_767, 0).saturating_mul(p.into())) + // Minimum execution time: 51_253_000 picoseconds. + Weight::from_parts(56_399_941, 4380) + // Standard Error: 218 + .saturating_add(Weight::from_parts(2_920, 0).saturating_mul(b.into())) + // Standard Error: 2_310 + .saturating_add(Weight::from_parts(30_473, 0).saturating_mul(m.into())) + // Standard Error: 2_252 + .saturating_add(Weight::from_parts(208_468, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -634,10 +634,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `392 + p * (32 ±0)` // Estimated: `1877 + p * (32 ±0)` - // Minimum execution time: 14_738_000 picoseconds. - Weight::from_parts(17_394_689, 1877) - // Standard Error: 1_440 - .saturating_add(Weight::from_parts(162_358, 0).saturating_mul(p.into())) + // Minimum execution time: 14_646_000 picoseconds. + Weight::from_parts(17_305_497, 1877) + // Standard Error: 1_331 + .saturating_add(Weight::from_parts(156_038, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) @@ -660,12 +660,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1863 + d * (212 ±0) + p * (41 ±0)` // Estimated: `5172 + d * (1901 ±14) + p * (43 ±0)` - // Minimum execution time: 22_400_000 picoseconds. - Weight::from_parts(25_367_180, 5172) - // Standard Error: 402_814 - .saturating_add(Weight::from_parts(33_378_179, 0).saturating_mul(d.into())) - // Standard Error: 6_238 - .saturating_add(Weight::from_parts(282_575, 0).saturating_mul(p.into())) + // Minimum execution time: 22_164_000 picoseconds. + Weight::from_parts(24_932_256, 5172) + // Standard Error: 404_014 + .saturating_add(Weight::from_parts(33_833_807, 0).saturating_mul(d.into())) + // Standard Error: 6_256 + .saturating_add(Weight::from_parts(281_910, 0).saturating_mul(p.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -685,8 +685,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1964` // Estimated: `5429` - // Minimum execution time: 68_484_000 picoseconds. - Weight::from_parts(69_652_000, 5429) + // Minimum execution time: 69_220_000 picoseconds. + Weight::from_parts(70_215_000, 5429) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) }