Governance v2 (Kusama only) (#5205)

* First bits

* Create new origins

* Repot governance configs

* Tests for treasury spends

* Integrate treasury spend threshold origins

* Bump deps

* Add whitelist, configure treasury spend origins

* Add governance curves

* Enable curve's ceil to be configured

* Make compile

* Rest of new governance params

* Build fixes

* Fixes

* Fix warning

* Use new EnsureOrigin::try_successful_origin

* Some repotting

* Add files

* Ready for initial review

* Fixes

* Formatting

* Bump

* rename

* Derive MEL for Origin enum

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting

* Update Cargo.lock

* Update runtime/kusama/src/governance/origins.rs

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* allow root to demote and promote, fixing benchmarks

* fix whitelist origin benchmarks

* typo

* cargo update -p sp-io

* add second referenda instance to benchmarks

* allow root to act as a 9th dan in track

* feature flag it

* cargo update -p sp-io

* fix merge

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting

* allow root to create auction

* Update mod.rs

* more origin fixes

* root isnt needed actually

* cargo update -p sp-io

* allow root to cancel slash

* initial stuff

* make copy data from kusama

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda

* Update Cargo.lock

* commit new weight files

* more files

* use weight files

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda

* Update Cargo.lock

* Update to latest master

* Formatting

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_ranked_collective

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_conviction_voting

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_whitelist

* Rename Origin -> RuntimeOrigin

This was done in Substrate and is now needed here as well.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Tech Committee can promote to VI Dan

* Update runtime/kusama/src/governance/mod.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Formatting

* Update runtime/kusama/src/governance/fellowship.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Fixes

* Avoid updating extraneous deps

* Fix broken stuff

* ".git/.scripts/bench-bot.sh" runtime kusama-dev pallet_referenda

* Update runtime/kusama/src/governance/fellowship.rs

* Reorder EitherOf origins

Zero logic change to make the benchmarking work.
It uses the first successful origin which can only promote to rank 6.
By swapping the order we use Root which can always promote.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert param change and update doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This commit is contained in:
Gavin Wood
2022-10-03 17:33:46 +01:00
committed by GitHub
parent 32ccf86a43
commit 5d2f81035f
20 changed files with 1946 additions and 66 deletions
@@ -23,6 +23,7 @@ pub mod pallet_bounties;
pub mod pallet_child_bounties;
pub mod pallet_collective_council;
pub mod pallet_collective_technical_committee;
pub mod pallet_conviction_voting;
pub mod pallet_democracy;
pub mod pallet_election_provider_multi_phase;
pub mod pallet_elections_phragmen;
@@ -36,6 +37,9 @@ pub mod pallet_multisig;
pub mod pallet_nomination_pools;
pub mod pallet_preimage;
pub mod pallet_proxy;
pub mod pallet_ranked_collective;
pub mod pallet_referenda_fellowship_referenda;
pub mod pallet_referenda_referenda;
pub mod pallet_scheduler;
pub mod pallet_session;
pub mod pallet_staking;
@@ -44,6 +48,7 @@ pub mod pallet_tips;
pub mod pallet_treasury;
pub mod pallet_utility;
pub mod pallet_vesting;
pub mod pallet_whitelist;
pub mod runtime_common_auctions;
pub mod runtime_common_claims;
pub mod runtime_common_crowdloan;
@@ -27,7 +27,6 @@
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=pallet_collective
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
@@ -27,7 +27,6 @@
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=pallet_collective
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
@@ -0,0 +1,119 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_conviction_voting`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --pallet=pallet_conviction_voting
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::{Weight}};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_conviction_voting`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_conviction_voting::WeightInfo for WeightInfo<T> {
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: ConvictionVoting VotingFor (r:1 w:1)
// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn vote_new() -> Weight {
Weight::from_ref_time(5_652_326_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: ConvictionVoting VotingFor (r:1 w:1)
// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn vote_existing() -> Weight {
Weight::from_ref_time(509_859_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: ConvictionVoting VotingFor (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn remove_vote() -> Weight {
Weight::from_ref_time(486_638_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: ConvictionVoting VotingFor (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:1 w:0)
fn remove_other_vote() -> Weight {
Weight::from_ref_time(74_517_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: ConvictionVoting VotingFor (r:2 w:2)
// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:10 w:10)
// Storage: Scheduler Agenda (r:2 w:2)
/// The range of component `r` is `[0, 512]`.
fn delegate(r: u32, ) -> Weight {
Weight::from_ref_time(78_376_000 as u64)
// Standard Error: 2_253_708
.saturating_add(Weight::from_ref_time(221_428_037 as u64).saturating_mul(r as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64)))
.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64)))
}
// Storage: ConvictionVoting VotingFor (r:2 w:2)
// Storage: Referenda ReferendumInfoFor (r:10 w:10)
// Storage: Scheduler Agenda (r:2 w:2)
/// The range of component `r` is `[0, 512]`.
fn undelegate(r: u32, ) -> Weight {
Weight::from_ref_time(55_946_000 as u64)
// Standard Error: 2_268_396
.saturating_add(Weight::from_ref_time(221_648_859 as u64).saturating_mul(r as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64)))
.saturating_add(T::DbWeight::get().writes(2 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64)))
}
// Storage: ConvictionVoting VotingFor (r:1 w:1)
// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn unlock() -> Weight {
Weight::from_ref_time(93_068_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
}
@@ -0,0 +1,116 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_ranked_collective`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --pallet=pallet_ranked_collective
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::{Weight}};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_ranked_collective`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_ranked_collective::WeightInfo for WeightInfo<T> {
// Storage: FellowshipCollective Members (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:1)
// Storage: FellowshipCollective IndexToId (r:0 w:1)
// Storage: FellowshipCollective IdToIndex (r:0 w:1)
fn add_member() -> Weight {
Weight::from_ref_time(20_797_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipCollective Members (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:1)
// Storage: FellowshipCollective IdToIndex (r:1 w:1)
// Storage: FellowshipCollective IndexToId (r:1 w:1)
/// The range of component `r` is `[0, 10]`.
fn remove_member(r: u32, ) -> Weight {
Weight::from_ref_time(30_196_000 as u64)
// Standard Error: 10_539
.saturating_add(Weight::from_ref_time(9_633_382 as u64).saturating_mul(r as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(r as u64)))
.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(r as u64)))
}
// Storage: FellowshipCollective Members (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:1)
// Storage: FellowshipCollective IndexToId (r:0 w:1)
// Storage: FellowshipCollective IdToIndex (r:0 w:1)
/// The range of component `r` is `[0, 10]`.
fn promote_member(r: u32, ) -> Weight {
Weight::from_ref_time(21_958_000 as u64)
// Standard Error: 3_398
.saturating_add(Weight::from_ref_time(527_087 as u64).saturating_mul(r as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipCollective Members (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:1)
// Storage: FellowshipCollective IdToIndex (r:1 w:1)
// Storage: FellowshipCollective IndexToId (r:1 w:1)
/// The range of component `r` is `[0, 10]`.
fn demote_member(r: u32, ) -> Weight {
Weight::from_ref_time(29_934_000 as u64)
// Standard Error: 11_453
.saturating_add(Weight::from_ref_time(884_044 as u64).saturating_mul(r as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipCollective Members (r:1 w:0)
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective Voting (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn vote() -> Weight {
Weight::from_ref_time(45_989_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0)
// Storage: FellowshipCollective VotingCleanup (r:1 w:0)
// Storage: FellowshipCollective Voting (r:0 w:1)
/// The range of component `n` is `[1, 100]`.
fn cleanup_poll(n: u32, ) -> Weight {
Weight::from_ref_time(17_842_000 as u64)
// Standard Error: 733
.saturating_add(Weight::from_ref_time(892_322 as u64).saturating_mul(n as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(n as u64)))
}
}
@@ -0,0 +1,264 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_referenda`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --pallet=pallet_referenda
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_referenda`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_referenda::WeightInfo for WeightInfo<T> {
// Storage: FellowshipCollective Members (r:1 w:0)
// Storage: FellowshipReferenda ReferendumCount (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: FellowshipReferenda ReferendumInfoFor (r:0 w:1)
fn submit() -> Weight {
Weight::from_ref_time(32_438_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn place_decision_deposit_preparing() -> Weight {
Weight::from_ref_time(48_476_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
fn place_decision_deposit_queued() -> Weight {
Weight::from_ref_time(94_751_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
fn place_decision_deposit_not_queued() -> Weight {
Weight::from_ref_time(94_975_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:2 w:2)
fn place_decision_deposit_passing() -> Weight {
Weight::from_ref_time(194_931_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
fn place_decision_deposit_failing() -> Weight {
Weight::from_ref_time(42_888_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
fn refund_decision_deposit() -> Weight {
Weight::from_ref_time(30_949_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn cancel() -> Weight {
Weight::from_ref_time(38_960_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn kill() -> Weight {
Weight::from_ref_time(67_836_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda TrackQueue (r:1 w:0)
// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
fn one_fewer_deciding_queue_empty() -> Weight {
Weight::from_ref_time(11_204_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:2 w:2)
fn one_fewer_deciding_failing() -> Weight {
Weight::from_ref_time(224_465_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:2 w:2)
fn one_fewer_deciding_passing() -> Weight {
Weight::from_ref_time(224_764_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_requeued_insertion() -> Weight {
Weight::from_ref_time(91_727_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_requeued_slide() -> Weight {
Weight::from_ref_time(91_868_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_queued() -> Weight {
Weight::from_ref_time(94_520_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_not_queued() -> Weight {
Weight::from_ref_time(93_483_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_no_deposit() -> Weight {
Weight::from_ref_time(29_294_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_preparing() -> Weight {
Weight::from_ref_time(30_363_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
fn nudge_referendum_timed_out() -> Weight {
Weight::from_ref_time(22_703_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_deciding_failing() -> Weight {
Weight::from_ref_time(40_760_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_deciding_passing() -> Weight {
Weight::from_ref_time(91_300_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_confirming() -> Weight {
Weight::from_ref_time(165_577_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_end_confirming() -> Weight {
Weight::from_ref_time(166_188_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_continue_not_confirming() -> Weight {
Weight::from_ref_time(159_324_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_continue_confirming() -> Weight {
Weight::from_ref_time(82_615_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:2 w:2)
// Storage: Scheduler Lookup (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn nudge_referendum_approved() -> Weight {
Weight::from_ref_time(185_354_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
// Storage: FellowshipCollective MemberCount (r:1 w:0)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_rejected() -> Weight {
Weight::from_ref_time(165_963_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}
@@ -0,0 +1,251 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_referenda`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --pallet=pallet_referenda
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_referenda`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_referenda::WeightInfo for WeightInfo<T> {
// Storage: Referenda ReferendumCount (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:0 w:1)
fn submit() -> Weight {
Weight::from_ref_time(37_366_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn place_decision_deposit_preparing() -> Weight {
Weight::from_ref_time(47_931_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:0)
// Storage: Referenda TrackQueue (r:1 w:1)
fn place_decision_deposit_queued() -> Weight {
Weight::from_ref_time(48_799_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:0)
// Storage: Referenda TrackQueue (r:1 w:1)
fn place_decision_deposit_not_queued() -> Weight {
Weight::from_ref_time(48_899_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn place_decision_deposit_passing() -> Weight {
Weight::from_ref_time(61_981_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:1)
fn place_decision_deposit_failing() -> Weight {
Weight::from_ref_time(42_318_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
fn refund_decision_deposit() -> Weight {
Weight::from_ref_time(30_391_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn cancel() -> Weight {
Weight::from_ref_time(38_601_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn kill() -> Weight {
Weight::from_ref_time(78_111_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda TrackQueue (r:1 w:0)
// Storage: Referenda DecidingCount (r:1 w:1)
fn one_fewer_deciding_queue_empty() -> Weight {
Weight::from_ref_time(11_132_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn one_fewer_deciding_failing() -> Weight {
Weight::from_ref_time(161_624_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
fn one_fewer_deciding_passing() -> Weight {
Weight::from_ref_time(167_193_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_requeued_insertion() -> Weight {
Weight::from_ref_time(44_257_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_requeued_slide() -> Weight {
Weight::from_ref_time(43_981_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:0)
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_queued() -> Weight {
Weight::from_ref_time(45_931_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:0)
// Storage: Referenda TrackQueue (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_not_queued() -> Weight {
Weight::from_ref_time(45_854_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_no_deposit() -> Weight {
Weight::from_ref_time(28_641_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_preparing() -> Weight {
Weight::from_ref_time(29_629_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
fn nudge_referendum_timed_out() -> Weight {
Weight::from_ref_time(21_852_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_deciding_failing() -> Weight {
Weight::from_ref_time(41_478_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Referenda DecidingCount (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_deciding_passing() -> Weight {
Weight::from_ref_time(44_198_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_begin_confirming() -> Weight {
Weight::from_ref_time(38_978_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_end_confirming() -> Weight {
Weight::from_ref_time(40_123_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_continue_not_confirming() -> Weight {
Weight::from_ref_time(36_868_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_continue_confirming() -> Weight {
Weight::from_ref_time(36_835_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:2 w:2)
// Storage: Scheduler Lookup (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn nudge_referendum_approved() -> Weight {
Weight::from_ref_time(56_130_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Referenda ReferendumInfoFor (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1)
fn nudge_referendum_rejected() -> Weight {
Weight::from_ref_time(38_997_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}
@@ -0,0 +1,82 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_whitelist`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// /home/benchbot/cargo_target_dir/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --pallet=pallet_whitelist
// --chain=kusama-dev
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::{Weight}};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_whitelist`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_whitelist::WeightInfo for WeightInfo<T> {
// Storage: Whitelist WhitelistedCall (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn whitelist_call() -> Weight {
Weight::from_ref_time(21_808_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Whitelist WhitelistedCall (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
// Storage: Preimage PreimageFor (r:0 w:1)
fn remove_whitelisted_call() -> Weight {
Weight::from_ref_time(24_193_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Whitelist WhitelistedCall (r:1 w:1)
// Storage: Preimage PreimageFor (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn dispatch_whitelisted_call() -> Weight {
Weight::from_ref_time(7_327_364_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Whitelist WhitelistedCall (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
// Storage: Preimage PreimageFor (r:0 w:1)
/// The range of component `n` is `[1, 10000]`.
fn dispatch_whitelisted_call_with_preimage(n: u32, ) -> Weight {
Weight::from_ref_time(26_992_000 as u64)
// Standard Error: 4
.saturating_add(Weight::from_ref_time(1_621 as u64).saturating_mul(n as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
}