OpenGov in Westend and Rococo (#1177)

Migrating [PR from the archived polkadot
repo](https://github.com/paritytech/polkadot/pull/7272)

As per
https://github.com/paritytech/polkadot/pull/7272#issuecomment-1559240466,
the changes in this MR include the following pallets into [x] Rococo and
[x] Westend runtimes:

    pallet_conviction_voting
    pallet_referenda
    pallet_ranked_collective
    pallet_custom_origins
    pallet_whitelist

And only for westend-runtime:

    pallet_treasury

Following [Kusama runtime
config](https://github.com/paritytech/polkadot/tree/dbae30efe080a1d41fe54ef4da8af47614c9ca93/runtime/kusama/src)
as a baseline.

Benchmarking of the following pallets done for both Rococo and Westend:

    pallet_conviction_voting
    pallet_referenda
    pallet_ranked_collective (only on Rococo)
    pallet_whitelist

And only for Westend:

    pallet_treasury

Removed Gov1 from Rococo as in
https://github.com/paritytech/polkadot/pull/6701

Rococo Gov1 storage will be cleaned in a different PR - [issue ](https://github.com/paritytech/polkadot-sdk/issues/1618)

---------

Co-authored-by: Giles Cope <gilescope@gmail.com>
This commit is contained in:
Alejandro Martinez Andres
2023-09-27 16:37:00 +02:00
committed by GitHub
parent 8b061a5c5d
commit 69ed3087e1
35 changed files with 4964 additions and 2385 deletions
Generated
+24 -15
View File
@@ -1152,7 +1152,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
]
[[package]]
@@ -1193,7 +1193,7 @@ dependencies = [
"futures-sink",
"futures-util",
"memchr",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
]
[[package]]
@@ -5601,7 +5601,7 @@ dependencies = [
"futures-io",
"memchr",
"parking",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"waker-fn",
]
@@ -5658,7 +5658,7 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"pin-utils",
"slab",
]
@@ -6067,7 +6067,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
"bytes",
"http",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
]
[[package]]
@@ -6110,7 +6110,7 @@ dependencies = [
"httparse",
"httpdate",
"itoa",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"socket2 0.4.9",
"tokio",
"tower-service",
@@ -11366,9 +11366,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
[[package]]
name = "pin-project-lite"
version = "0.2.12"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05"
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
[[package]]
name = "pin-utils"
@@ -13172,7 +13172,7 @@ dependencies = [
"concurrent-queue",
"libc",
"log",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"windows-sys 0.48.0",
]
@@ -13951,7 +13951,7 @@ dependencies = [
"mime",
"once_cell",
"percent-encoding",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"rustls 0.21.6",
"rustls-pemfile",
"serde",
@@ -14128,6 +14128,7 @@ dependencies = [
"pallet-bounties",
"pallet-child-bounties",
"pallet-collective",
"pallet-conviction-voting",
"pallet-democracy",
"pallet-elections-phragmen",
"pallet-grandpa",
@@ -14142,7 +14143,9 @@ dependencies = [
"pallet-offences",
"pallet-preimage",
"pallet-proxy",
"pallet-ranked-collective",
"pallet-recovery",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-society",
@@ -14156,6 +14159,7 @@ dependencies = [
"pallet-treasury",
"pallet-utility",
"pallet-vesting",
"pallet-whitelist",
"pallet-xcm",
"pallet-xcm-benchmarks",
"parity-scale-codec",
@@ -14171,6 +14175,7 @@ dependencies = [
"serde_json",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-authority-discovery",
"sp-block-builder",
"sp-consensus-babe",
@@ -18789,7 +18794,7 @@ dependencies = [
"mio",
"num_cpus",
"parking_lot 0.12.1",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"signal-hook-registry",
"socket2 0.5.3",
"tokio-macros",
@@ -18835,7 +18840,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842"
dependencies = [
"futures-core",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"tokio",
"tokio-util",
]
@@ -18875,7 +18880,7 @@ dependencies = [
"futures-core",
"futures-io",
"futures-sink",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"tokio",
"tracing",
]
@@ -18947,7 +18952,7 @@ dependencies = [
"http",
"http-body",
"http-range-header",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"tower-layer",
"tower-service",
]
@@ -18972,7 +18977,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
"log",
"pin-project-lite 0.2.12",
"pin-project-lite 0.2.13",
"tracing-attributes",
"tracing-core",
]
@@ -20257,6 +20262,7 @@ dependencies = [
"pallet-beefy",
"pallet-beefy-mmr",
"pallet-collective",
"pallet-conviction-voting",
"pallet-democracy",
"pallet-election-provider-multi-phase",
"pallet-election-provider-support-benchmarking",
@@ -20278,6 +20284,7 @@ dependencies = [
"pallet-preimage",
"pallet-proxy",
"pallet-recovery",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-session-benchmarking",
@@ -20293,6 +20300,7 @@ dependencies = [
"pallet-treasury",
"pallet-utility",
"pallet-vesting",
"pallet-whitelist",
"pallet-xcm",
"pallet-xcm-benchmarks",
"parity-scale-codec",
@@ -20308,6 +20316,7 @@ dependencies = [
"smallvec",
"sp-api",
"sp-application-crypto",
"sp-arithmetic",
"sp-authority-discovery",
"sp-block-builder",
"sp-consensus-babe",
+2 -16
View File
@@ -425,6 +425,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Runtim
vesting: westend::VestingConfig { vesting: vec![] },
sudo: westend::SudoConfig { key: Some(endowed_accounts[0].clone()) },
hrmp: Default::default(),
treasury: Default::default(),
configuration: westend::ConfigurationConfig {
config: default_parachains_host_configuration(),
},
@@ -716,7 +717,6 @@ fn rococo_staging_testnet_config_genesis(
})
.collect::<Vec<_>>(),
},
phragmen_election: Default::default(),
babe: rococo_runtime::BabeConfig {
authorities: Default::default(),
epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG),
@@ -724,13 +724,6 @@ fn rococo_staging_testnet_config_genesis(
},
grandpa: Default::default(),
im_online: Default::default(),
democracy: rococo_runtime::DemocracyConfig::default(),
council: rococo::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: rococo::TechnicalCommitteeConfig {
members: vec![],
phantom: Default::default(),
},
technical_membership: Default::default(),
treasury: Default::default(),
authority_discovery: rococo_runtime::AuthorityDiscoveryConfig {
keys: vec![],
@@ -992,6 +985,7 @@ pub fn westend_testnet_genesis(
vesting: westend::VestingConfig { vesting: vec![] },
sudo: westend::SudoConfig { key: Some(root_key) },
hrmp: Default::default(),
treasury: Default::default(),
configuration: westend::ConfigurationConfig {
config: default_parachains_host_configuration(),
},
@@ -1062,14 +1056,6 @@ pub fn rococo_testnet_genesis(
},
grandpa: Default::default(),
im_online: Default::default(),
phragmen_election: Default::default(),
democracy: rococo::DemocracyConfig::default(),
council: rococo::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: rococo::TechnicalCommitteeConfig {
members: vec![],
phantom: Default::default(),
},
technical_membership: Default::default(),
treasury: Default::default(),
claims: rococo::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: rococo::VestingConfig { vesting: vec![] },
+18
View File
@@ -24,6 +24,7 @@ sp-api = { path = "../../../substrate/primitives/api", default-features = false
sp-genesis-builder = { path = "../../../substrate/primitives/genesis-builder", default-features = false }
inherents = { package = "sp-inherents", path = "../../../substrate/primitives/inherents", default-features = false }
offchain-primitives = { package = "sp-offchain", path = "../../../substrate/primitives/offchain", default-features = false }
sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false }
sp-std = { package = "sp-std", path = "../../../substrate/primitives/std", default-features = false }
sp-io = { path = "../../../substrate/primitives/io", default-features = false }
sp-mmr-primitives = { path = "../../../substrate/primitives/merkle-mountain-range", default-features = false }
@@ -48,6 +49,7 @@ pallet-state-trie-migration = { path = "../../../substrate/frame/state-trie-migr
pallet-transaction-payment = { path = "../../../substrate/frame/transaction-payment", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { path = "../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false }
pallet-collective = { path = "../../../substrate/frame/collective", default-features = false }
pallet-conviction-voting = { path = "../../../substrate/frame/conviction-voting", default-features = false }
pallet-democracy = { path = "../../../substrate/frame/democracy", default-features = false }
pallet-elections-phragmen = { path = "../../../substrate/frame/elections-phragmen", default-features = false }
frame-executive = { path = "../../../substrate/frame/executive", default-features = false }
@@ -63,7 +65,9 @@ pallet-nis = { path = "../../../substrate/frame/nis", default-features = false }
pallet-offences = { path = "../../../substrate/frame/offences", default-features = false }
pallet-preimage = { path = "../../../substrate/frame/preimage", default-features = false }
pallet-proxy = { path = "../../../substrate/frame/proxy", default-features = false }
pallet-ranked-collective = { path = "../../../substrate/frame/ranked-collective", default-features = false }
pallet-recovery = { path = "../../../substrate/frame/recovery", default-features = false }
pallet-referenda = { path = "../../../substrate/frame/referenda", default-features = false }
pallet-scheduler = { path = "../../../substrate/frame/scheduler", default-features = false }
pallet-session = { path = "../../../substrate/frame/session", default-features = false }
pallet-society = { path = "../../../substrate/frame/society", default-features = false }
@@ -77,6 +81,7 @@ pallet-tips = { path = "../../../substrate/frame/tips", default-features = false
pallet-treasury = { path = "../../../substrate/frame/treasury", default-features = false }
pallet-utility = { path = "../../../substrate/frame/utility", default-features = false }
pallet-vesting = { path = "../../../substrate/frame/vesting", default-features = false }
pallet-whitelist = { path = "../../../substrate/frame/whitelist", default-features = false }
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
@@ -135,6 +140,7 @@ std = [
"pallet-bounties/std",
"pallet-child-bounties/std",
"pallet-collective/std",
"pallet-conviction-voting/std",
"pallet-democracy/std",
"pallet-elections-phragmen/std",
"pallet-grandpa/std",
@@ -149,7 +155,9 @@ std = [
"pallet-offences/std",
"pallet-preimage/std",
"pallet-proxy/std",
"pallet-ranked-collective/std",
"pallet-recovery/std",
"pallet-referenda/std",
"pallet-scheduler/std",
"pallet-session/std",
"pallet-society/std",
@@ -163,6 +171,7 @@ std = [
"pallet-treasury/std",
"pallet-utility/std",
"pallet-vesting/std",
"pallet-whitelist/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm/std",
"parity-scale-codec/std",
@@ -175,6 +184,7 @@ std = [
"serde/std",
"serde_derive",
"sp-api/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-io/std",
@@ -201,6 +211,7 @@ runtime-benchmarks = [
"pallet-bounties/runtime-benchmarks",
"pallet-child-bounties/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
@@ -215,7 +226,9 @@ runtime-benchmarks = [
"pallet-offences/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-ranked-collective/runtime-benchmarks",
"pallet-recovery/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-society/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
@@ -226,6 +239,7 @@ runtime-benchmarks = [
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
@@ -252,6 +266,7 @@ try-runtime = [
"pallet-bounties/try-runtime",
"pallet-child-bounties/try-runtime",
"pallet-collective/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-democracy/try-runtime",
"pallet-elections-phragmen/try-runtime",
"pallet-grandpa/try-runtime",
@@ -266,7 +281,9 @@ try-runtime = [
"pallet-offences/try-runtime",
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
"pallet-ranked-collective/try-runtime",
"pallet-recovery/try-runtime",
"pallet-referenda/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-session/try-runtime",
"pallet-society/try-runtime",
@@ -279,6 +296,7 @@ try-runtime = [
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-whitelist/try-runtime",
"pallet-xcm/try-runtime",
"runtime-common/try-runtime",
"runtime-parachains/try-runtime",
@@ -0,0 +1,343 @@
// Copyright (C) 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/>.
//! Elements of governance concerning the Rococo Fellowship.
use frame_support::traits::{MapSuccess, TryMapSuccess};
use sp_runtime::traits::{CheckedReduceBy, ConstU16, Replace};
use super::*;
use crate::{CENTS, DAYS};
parameter_types! {
pub const AlarmInterval: BlockNumber = 1;
pub const SubmissionDeposit: Balance = 0;
pub const UndecidingTimeout: BlockNumber = 7 * DAYS;
}
pub struct TracksInfo;
impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
type Id = u16;
type RuntimeOrigin = <RuntimeOrigin as frame_support::traits::OriginTrait>::PalletsOrigin;
fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo<Balance, BlockNumber>)] {
static DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 10] = [
(
0u16,
pallet_referenda::TrackInfo {
name: "candidates",
max_deciding: 10,
decision_deposit: 100 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
1u16,
pallet_referenda::TrackInfo {
name: "members",
max_deciding: 10,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
2u16,
pallet_referenda::TrackInfo {
name: "proficients",
max_deciding: 10,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
3u16,
pallet_referenda::TrackInfo {
name: "fellows",
max_deciding: 10,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
4u16,
pallet_referenda::TrackInfo {
name: "senior fellows",
max_deciding: 10,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
5u16,
pallet_referenda::TrackInfo {
name: "experts",
max_deciding: 10,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
6u16,
pallet_referenda::TrackInfo {
name: "senior experts",
max_deciding: 10,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
7u16,
pallet_referenda::TrackInfo {
name: "masters",
max_deciding: 10,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
8u16,
pallet_referenda::TrackInfo {
name: "senior masters",
max_deciding: 10,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
(
9u16,
pallet_referenda::TrackInfo {
name: "grand masters",
max_deciding: 10,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
ceil: Perbill::from_percent(100),
},
min_support: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(0),
ceil: Perbill::from_percent(50),
},
},
),
];
&DATA[..]
}
fn track_for(id: &Self::RuntimeOrigin) -> Result<Self::Id, ()> {
use super::origins::Origin;
#[cfg(feature = "runtime-benchmarks")]
{
// For benchmarks, we enable a root origin.
// It is important that this is not available in production!
let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into();
if &root == id {
return Ok(9)
}
}
match Origin::try_from(id.clone()) {
Ok(Origin::FellowshipInitiates) => Ok(0),
Ok(Origin::Fellowship1Dan) => Ok(1),
Ok(Origin::Fellowship2Dan) => Ok(2),
Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(3),
Ok(Origin::Fellowship4Dan) => Ok(4),
Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(5),
Ok(Origin::Fellowship6Dan) => Ok(6),
Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(7),
Ok(Origin::Fellowship8Dan) => Ok(8),
Ok(Origin::Fellowship9Dan) => Ok(9),
_ => Err(()),
}
}
}
pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber);
pub type FellowshipReferendaInstance = pallet_referenda::Instance2;
impl pallet_referenda::Config<FellowshipReferendaInstance> for Runtime {
type WeightInfo = weights::pallet_referenda_fellowship_referenda::WeightInfo<Self>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Scheduler = Scheduler;
type Currency = Balances;
type SubmitOrigin =
pallet_ranked_collective::EnsureMember<Runtime, FellowshipCollectiveInstance, 1>;
type CancelOrigin = FellowshipExperts;
type KillOrigin = FellowshipMasters;
type Slash = Treasury;
type Votes = pallet_ranked_collective::Votes;
type Tally = pallet_ranked_collective::TallyOf<Runtime, FellowshipCollectiveInstance>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}
pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1;
impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime {
type WeightInfo = weights::pallet_ranked_collective::WeightInfo<Self>;
type RuntimeEvent = RuntimeEvent;
// Promotion is by any of:
// - Root can demote arbitrarily.
// - the FellowshipAdmin origin (i.e. token holder referendum);
// - a vote by the rank *above* the new rank.
type PromoteOrigin = EitherOf<
frame_system::EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
EitherOf<
MapSuccess<FellowshipAdmin, Replace<ConstU16<9>>>,
TryMapSuccess<origins::EnsureFellowship, CheckedReduceBy<ConstU16<1>>>,
>,
>;
// Demotion is by any of:
// - Root can demote arbitrarily.
// - the FellowshipAdmin origin (i.e. token holder referendum);
// - a vote by the rank two above the current rank.
type DemoteOrigin = EitherOf<
frame_system::EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
EitherOf<
MapSuccess<FellowshipAdmin, Replace<ConstU16<9>>>,
TryMapSuccess<origins::EnsureFellowship, CheckedReduceBy<ConstU16<2>>>,
>,
>;
type Polls = FellowshipReferenda;
type MinRankOfClass = sp_runtime::traits::Identity;
type VoteWeight = pallet_ranked_collective::Geometric;
}
@@ -0,0 +1,93 @@
// Copyright (C) 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/>.
//! New governance configurations for the Rococo runtime.
use super::*;
use frame_support::{
parameter_types,
traits::{ConstU16, EitherOf},
};
use frame_system::EnsureRootWithSuccess;
mod origins;
pub use origins::{
pallet_custom_origins, AuctionAdmin, Fellows, FellowshipAdmin, FellowshipExperts,
FellowshipInitiates, FellowshipMasters, GeneralAdmin, LeaseAdmin, ReferendumCanceller,
ReferendumKiller, Spender, StakingAdmin, Treasurer, WhitelistedCaller,
};
mod tracks;
pub use tracks::TracksInfo;
mod fellowship;
pub use fellowship::{FellowshipCollectiveInstance, FellowshipReferendaInstance};
parameter_types! {
pub const VoteLockingPeriod: BlockNumber = 7 * DAYS;
}
impl pallet_conviction_voting::Config for Runtime {
type WeightInfo = weights::pallet_conviction_voting::WeightInfo<Self>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type VoteLockingPeriod = VoteLockingPeriod;
type MaxVotes = ConstU32<512>;
type MaxTurnout =
frame_support::traits::tokens::currency::ActiveIssuanceOf<Balances, Self::AccountId>;
type Polls = Referenda;
}
parameter_types! {
pub const AlarmInterval: BlockNumber = 1;
pub const SubmissionDeposit: Balance = 1 * 3 * CENTS;
pub const UndecidingTimeout: BlockNumber = 14 * DAYS;
}
parameter_types! {
pub const MaxBalance: Balance = Balance::max_value();
}
pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;
impl origins::pallet_custom_origins::Config for Runtime {}
impl pallet_whitelist::Config for Runtime {
type WeightInfo = weights::pallet_whitelist::WeightInfo<Self>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WhitelistOrigin =
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Fellows>;
type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
type Preimages = Preimage;
}
impl pallet_referenda::Config for Runtime {
type WeightInfo = weights::pallet_referenda_referenda::WeightInfo<Self>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Scheduler = Scheduler;
type Currency = Balances;
type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
type CancelOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumCanceller>;
type KillOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumKiller>;
type Slash = Treasury;
type Votes = pallet_conviction_voting::VotesOf<Runtime>;
type Tally = pallet_conviction_voting::TallyOf<Runtime>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}
@@ -0,0 +1,194 @@
// Copyright (C) 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/>.
//! Custom origins for governance interventions.
pub use pallet_custom_origins::*;
#[frame_support::pallet]
pub mod pallet_custom_origins {
use crate::{Balance, CENTS, GRAND};
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)]
#[pallet::origin]
pub enum Origin {
/// Origin for cancelling slashes.
StakingAdmin,
/// Origin for spending (any amount of) funds.
Treasurer,
/// Origin for managing the composition of the fellowship.
FellowshipAdmin,
/// Origin for managing the registrar.
GeneralAdmin,
/// Origin for starting auctions.
AuctionAdmin,
/// Origin able to force slot leases.
LeaseAdmin,
/// Origin able to cancel referenda.
ReferendumCanceller,
/// Origin able to kill referenda.
ReferendumKiller,
/// Origin able to spend up to 1 KSM from the treasury at once.
SmallTipper,
/// Origin able to spend up to 5 KSM from the treasury at once.
BigTipper,
/// Origin able to spend up to 50 KSM from the treasury at once.
SmallSpender,
/// Origin able to spend up to 500 KSM from the treasury at once.
MediumSpender,
/// Origin able to spend up to 5,000 KSM from the treasury at once.
BigSpender,
/// Origin able to dispatch a whitelisted call.
WhitelistedCaller,
/// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed).
FellowshipInitiates,
/// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater).
Fellows,
/// Origin commanded by Polkadot Experts (5th Dan fellows or greater).
FellowshipExperts,
/// Origin commanded by Polkadot Masters (7th Dan fellows of greater).
FellowshipMasters,
/// Origin commanded by rank 1 of the Polkadot Fellowship and with a success of 1.
Fellowship1Dan,
/// Origin commanded by rank 2 of the Polkadot Fellowship and with a success of 2.
Fellowship2Dan,
/// Origin commanded by rank 3 of the Polkadot Fellowship and with a success of 3.
Fellowship3Dan,
/// Origin commanded by rank 4 of the Polkadot Fellowship and with a success of 4.
Fellowship4Dan,
/// Origin commanded by rank 5 of the Polkadot Fellowship and with a success of 5.
Fellowship5Dan,
/// Origin commanded by rank 6 of the Polkadot Fellowship and with a success of 6.
Fellowship6Dan,
/// Origin commanded by rank 7 of the Polkadot Fellowship and with a success of 7.
Fellowship7Dan,
/// Origin commanded by rank 8 of the Polkadot Fellowship and with a success of 8.
Fellowship8Dan,
/// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9.
Fellowship9Dan,
}
macro_rules! decl_unit_ensures {
( $name:ident: $success_type:ty = $success:expr ) => {
pub struct $name;
impl<O: Into<Result<Origin, O>> + From<Origin>>
EnsureOrigin<O> for $name
{
type Success = $success_type;
fn try_origin(o: O) -> Result<Self::Success, O> {
o.into().and_then(|o| match o {
Origin::$name => Ok($success),
r => Err(O::from(r)),
})
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<O, ()> {
Ok(O::from(Origin::$name))
}
}
};
( $name:ident ) => { decl_unit_ensures! { $name : () = () } };
( $name:ident: $success_type:ty = $success:expr, $( $rest:tt )* ) => {
decl_unit_ensures! { $name: $success_type = $success }
decl_unit_ensures! { $( $rest )* }
};
( $name:ident, $( $rest:tt )* ) => {
decl_unit_ensures! { $name }
decl_unit_ensures! { $( $rest )* }
};
() => {}
}
decl_unit_ensures!(
StakingAdmin,
Treasurer,
FellowshipAdmin,
GeneralAdmin,
AuctionAdmin,
LeaseAdmin,
ReferendumCanceller,
ReferendumKiller,
WhitelistedCaller,
FellowshipInitiates: u16 = 0,
Fellows: u16 = 3,
FellowshipExperts: u16 = 5,
FellowshipMasters: u16 = 7,
);
macro_rules! decl_ensure {
(
$vis:vis type $name:ident: EnsureOrigin<Success = $success_type:ty> {
$( $item:ident = $success:expr, )*
}
) => {
$vis struct $name;
impl<O: Into<Result<Origin, O>> + From<Origin>>
EnsureOrigin<O> for $name
{
type Success = $success_type;
fn try_origin(o: O) -> Result<Self::Success, O> {
o.into().and_then(|o| match o {
$(
Origin::$item => Ok($success),
)*
r => Err(O::from(r)),
})
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<O, ()> {
// By convention the more privileged origins go later, so for greatest chance
// of success, we want the last one.
let _result: Result<O, ()> = Err(());
$(
let _result: Result<O, ()> = Ok(O::from(Origin::$item));
)*
_result
}
}
}
}
decl_ensure! {
pub type Spender: EnsureOrigin<Success = Balance> {
SmallTipper = 250 * 3 * CENTS,
BigTipper = 1 * GRAND,
SmallSpender = 10 * GRAND,
MediumSpender = 100 * GRAND,
BigSpender = 1_000 * GRAND,
Treasurer = 10_000 * GRAND,
}
}
decl_ensure! {
pub type EnsureFellowship: EnsureOrigin<Success = u16> {
Fellowship1Dan = 1,
Fellowship2Dan = 2,
Fellowship3Dan = 3,
Fellowship4Dan = 4,
Fellowship5Dan = 5,
Fellowship6Dan = 6,
Fellowship7Dan = 7,
Fellowship8Dan = 8,
Fellowship9Dan = 9,
}
}
}
@@ -0,0 +1,320 @@
// Copyright (C) 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/>.
//! Track configurations for governance.
use super::*;
const fn percent(x: i32) -> sp_arithmetic::FixedI64 {
sp_arithmetic::FixedI64::from_rational(x as u128, 100)
}
use pallet_referenda::Curve;
const APP_ROOT: Curve = Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_ROOT: Curve = Curve::make_linear(28, 28, percent(0), percent(50));
const APP_STAKING_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_STAKING_ADMIN: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_TREASURER: Curve = Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_TREASURER: Curve = Curve::make_linear(28, 28, percent(0), percent(50));
const APP_FELLOWSHIP_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_FELLOWSHIP_ADMIN: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_GENERAL_ADMIN: Curve =
Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_GENERAL_ADMIN: Curve =
Curve::make_reciprocal(7, 28, percent(10), percent(0), percent(50));
const APP_AUCTION_ADMIN: Curve =
Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_AUCTION_ADMIN: Curve =
Curve::make_reciprocal(7, 28, percent(10), percent(0), percent(50));
const APP_LEASE_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_LEASE_ADMIN: Curve = Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_REFERENDUM_CANCELLER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_REFERENDUM_CANCELLER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_REFERENDUM_KILLER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_REFERENDUM_KILLER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_SMALL_TIPPER: Curve = Curve::make_linear(10, 28, percent(50), percent(100));
const SUP_SMALL_TIPPER: Curve = Curve::make_reciprocal(1, 28, percent(4), percent(0), percent(50));
const APP_BIG_TIPPER: Curve = Curve::make_linear(10, 28, percent(50), percent(100));
const SUP_BIG_TIPPER: Curve = Curve::make_reciprocal(8, 28, percent(1), percent(0), percent(50));
const APP_SMALL_SPENDER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_SMALL_SPENDER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_MEDIUM_SPENDER: Curve = Curve::make_linear(23, 28, percent(50), percent(100));
const SUP_MEDIUM_SPENDER: Curve =
Curve::make_reciprocal(16, 28, percent(1), percent(0), percent(50));
const APP_BIG_SPENDER: Curve = Curve::make_linear(28, 28, percent(50), percent(100));
const SUP_BIG_SPENDER: Curve = Curve::make_reciprocal(20, 28, percent(1), percent(0), percent(50));
const APP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(16, 28 * 24, percent(96), percent(50), percent(100));
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15] = [
(
0,
pallet_referenda::TrackInfo {
name: "root",
max_deciding: 1,
decision_deposit: 100 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
),
(
1,
pallet_referenda::TrackInfo {
name: "whitelisted_caller",
max_deciding: 100,
decision_deposit: 10 * GRAND,
prepare_period: 6 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
min_support: SUP_WHITELISTED_CALLER,
},
),
(
10,
pallet_referenda::TrackInfo {
name: "staking_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_STAKING_ADMIN,
min_support: SUP_STAKING_ADMIN,
},
),
(
11,
pallet_referenda::TrackInfo {
name: "treasurer",
max_deciding: 10,
decision_deposit: 1 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_TREASURER,
min_support: SUP_TREASURER,
},
),
(
12,
pallet_referenda::TrackInfo {
name: "lease_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_LEASE_ADMIN,
min_support: SUP_LEASE_ADMIN,
},
),
(
13,
pallet_referenda::TrackInfo {
name: "fellowship_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_FELLOWSHIP_ADMIN,
min_support: SUP_FELLOWSHIP_ADMIN,
},
),
(
14,
pallet_referenda::TrackInfo {
name: "general_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_GENERAL_ADMIN,
min_support: SUP_GENERAL_ADMIN,
},
),
(
15,
pallet_referenda::TrackInfo {
name: "auction_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_AUCTION_ADMIN,
min_support: SUP_AUCTION_ADMIN,
},
),
(
20,
pallet_referenda::TrackInfo {
name: "referendum_canceller",
max_deciding: 1_000,
decision_deposit: 10 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
min_support: SUP_REFERENDUM_CANCELLER,
},
),
(
21,
pallet_referenda::TrackInfo {
name: "referendum_killer",
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
min_support: SUP_REFERENDUM_KILLER,
},
),
(
30,
pallet_referenda::TrackInfo {
name: "small_tipper",
max_deciding: 200,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 1 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: APP_SMALL_TIPPER,
min_support: SUP_SMALL_TIPPER,
},
),
(
31,
pallet_referenda::TrackInfo {
name: "big_tipper",
max_deciding: 100,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 4 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_BIG_TIPPER,
min_support: SUP_BIG_TIPPER,
},
),
(
32,
pallet_referenda::TrackInfo {
name: "small_spender",
max_deciding: 50,
decision_deposit: 100 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 10 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_SMALL_SPENDER,
min_support: SUP_SMALL_SPENDER,
},
),
(
33,
pallet_referenda::TrackInfo {
name: "medium_spender",
max_deciding: 50,
decision_deposit: 200 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_MEDIUM_SPENDER,
min_support: SUP_MEDIUM_SPENDER,
},
),
(
34,
pallet_referenda::TrackInfo {
name: "big_spender",
max_deciding: 50,
decision_deposit: 400 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 14 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_BIG_SPENDER,
min_support: SUP_BIG_SPENDER,
},
),
];
pub struct TracksInfo;
impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
type Id = u16;
type RuntimeOrigin = <RuntimeOrigin as frame_support::traits::OriginTrait>::PalletsOrigin;
fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo<Balance, BlockNumber>)] {
&TRACKS_DATA[..]
}
fn track_for(id: &Self::RuntimeOrigin) -> Result<Self::Id, ()> {
if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) {
match system_origin {
frame_system::RawOrigin::Root => Ok(0),
_ => Err(()),
}
} else if let Ok(custom_origin) = origins::Origin::try_from(id.clone()) {
match custom_origin {
origins::Origin::WhitelistedCaller => Ok(1),
// General admin
origins::Origin::StakingAdmin => Ok(10),
origins::Origin::Treasurer => Ok(11),
origins::Origin::LeaseAdmin => Ok(12),
origins::Origin::FellowshipAdmin => Ok(13),
origins::Origin::GeneralAdmin => Ok(14),
origins::Origin::AuctionAdmin => Ok(15),
// Referendum admins
origins::Origin::ReferendumCanceller => Ok(20),
origins::Origin::ReferendumKiller => Ok(21),
// Limited treasury spenders
origins::Origin::SmallTipper => Ok(30),
origins::Origin::BigTipper => Ok(31),
origins::Origin::SmallSpender => Ok(32),
origins::Origin::MediumSpender => Ok(33),
origins::Origin::BigSpender => Ok(34),
_ => Err(()),
}
} else {
Err(())
}
}
}
pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber);
+63 -248
View File
@@ -62,8 +62,8 @@ use frame_support::{
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
fungible::HoldConsideration, Contains, EitherOfDiverse, EverythingBut, InstanceFilter,
KeyOwnerProofSystem, LinearStoragePrice, LockIdentifier, PrivilegeCmp, ProcessMessage,
fungible::HoldConsideration, Contains, EitherOf, EitherOfDiverse, EverythingBut,
InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage,
ProcessMessageError, StorageMapShim, WithdrawReasons,
},
weights::{ConstantMultiplier, WeightMeter},
@@ -88,7 +88,6 @@ use sp_staking::SessionIndex;
#[cfg(any(feature = "std", test))]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use static_assertions::const_assert;
use xcm::latest::Junction;
pub use frame_system::Call as SystemCall;
@@ -103,6 +102,13 @@ mod weights;
// XCM configurations.
pub mod xcm_config;
// Governance and configurations.
pub mod governance;
use governance::{
pallet_custom_origins, AuctionAdmin, Fellows, GeneralAdmin, LeaseAdmin, Treasurer,
TreasurySpender,
};
mod validator_manager;
impl_runtime_weights!(rococo_runtime_constants);
@@ -117,7 +123,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("rococo"),
impl_name: create_runtime_str!("parity-rococo-v2.0"),
authoring_version: 0,
spec_version: 9430,
spec_version: 10020,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 22,
@@ -186,11 +192,6 @@ parameter_types! {
pub const NoPreimagePostponement: Option<u32> = Some(10);
}
type ScheduleOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
>;
/// Used the compare the privilege of an origin inside the scheduler.
pub struct OriginPrivilegeCmp;
@@ -203,11 +204,6 @@ impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {
match (left, right) {
// Root is greater than anything.
(OriginCaller::system(frame_system::RawOrigin::Root), _) => Some(Ordering::Greater),
// Check which one has more yes votes.
(
OriginCaller::Council(pallet_collective::RawOrigin::Members(l_yes_votes, l_count)),
OriginCaller::Council(pallet_collective::RawOrigin::Members(r_yes_votes, r_count)),
) => Some((l_yes_votes * r_count).cmp(&(r_yes_votes * l_count))),
// For every other origin we don't care, as they are not used for `ScheduleOrigin`.
_ => None,
}
@@ -220,7 +216,9 @@ impl pallet_scheduler::Config for Runtime {
type PalletsOrigin = OriginCaller;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = ScheduleOrigin;
// The goal of having ScheduleOrigin include AuctionAdmin is to allow the auctions track of
// OpenGov to schedule periodic auctions.
type ScheduleOrigin = EitherOf<EnsureRoot<AccountId>, AuctionAdmin>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
type OriginPrivilegeCmp = OriginPrivilegeCmp;
@@ -380,171 +378,6 @@ parameter_types! {
pub const BondingDuration: sp_staking::EraIndex = 28;
}
parameter_types! {
pub LaunchPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1, "ROC_LAUNCH_PERIOD");
pub VotingPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1 * MINUTES, "ROC_VOTING_PERIOD");
pub FastTrackVotingPeriod: BlockNumber = prod_or_fast!(3 * HOURS, 1 * MINUTES, "ROC_FAST_TRACK_VOTING_PERIOD");
pub const MinimumDeposit: Balance = 100 * CENTS;
pub EnactmentPeriod: BlockNumber = prod_or_fast!(8 * DAYS, 1, "ROC_ENACTMENT_PERIOD");
pub CooloffPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1 * MINUTES, "ROC_COOLOFF_PERIOD");
pub const InstantAllowed: bool = true;
pub const MaxVotes: u32 = 100;
pub const MaxProposals: u32 = 100;
}
impl pallet_democracy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type VoteLockingPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type MinimumDeposit = MinimumDeposit;
type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
/// A majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
/// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
type InstantOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>;
type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>;
type BlacklistOrigin = EnsureRoot<AccountId>;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree.
type CancelProposalOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
>;
// Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cooloff period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type CooloffPeriod = CooloffPeriod;
type Slash = Treasury;
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
type MaxProposals = MaxProposals;
type Preimages = Preimage;
type MaxDeposits = ConstU32<100>;
type MaxBlacklisted = ConstU32<100>;
}
parameter_types! {
pub CouncilMotionDuration: BlockNumber = prod_or_fast!(3 * DAYS, 2 * MINUTES, "ROC_MOTION_DURATION");
pub const CouncilMaxProposals: u32 = 100;
pub const CouncilMaxMembers: u32 = 100;
pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block;
}
type CouncilCollective = pallet_collective::Instance1;
impl pallet_collective::Config<CouncilCollective> for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type SetMembersOrigin = EnsureRoot<AccountId>;
type WeightInfo = weights::pallet_collective_council::WeightInfo<Runtime>;
type MaxProposalWeight = MaxProposalWeight;
}
parameter_types! {
pub const CandidacyBond: Balance = 100 * CENTS;
// 1 storage item created, key size is 32 bytes, value size is 16+16.
pub const VotingBondBase: Balance = deposit(1, 64);
// additional data per vote is 32 bytes (account id).
pub const VotingBondFactor: Balance = deposit(0, 32);
/// Daily council elections
pub TermDuration: BlockNumber = prod_or_fast!(24 * HOURS, 2 * MINUTES, "ROC_TERM_DURATION");
pub const DesiredMembers: u32 = 19;
pub const DesiredRunnersUp: u32 = 19;
pub const MaxVoters: u32 = 10 * 1000;
pub const MaxVotesPerVoter: u32 = 16;
pub const MaxCandidates: u32 = 1000;
pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect";
}
// Make sure that there are no more than MaxMembers members elected via phragmen.
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
impl pallet_elections_phragmen::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ChangeMembers = Council;
type InitializeMembers = Council;
type CurrencyToVote = runtime_common::CurrencyToVote;
type CandidacyBond = CandidacyBond;
type VotingBondBase = VotingBondBase;
type VotingBondFactor = VotingBondFactor;
type LoserCandidate = Treasury;
type KickedMember = Treasury;
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type MaxVoters = MaxVoters;
type MaxVotesPerVoter = MaxVotesPerVoter;
type MaxCandidates = MaxCandidates;
type PalletId = PhragmenElectionPalletId;
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo<Runtime>;
}
parameter_types! {
pub TechnicalMotionDuration: BlockNumber = prod_or_fast!(3 * DAYS, 2 * MINUTES, "ROC_MOTION_DURATION");
pub const TechnicalMaxProposals: u32 = 100;
pub const TechnicalMaxMembers: u32 = 100;
}
type TechnicalCollective = pallet_collective::Instance2;
impl pallet_collective::Config<TechnicalCollective> for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type SetMembersOrigin = EnsureRoot<AccountId>;
type WeightInfo = weights::pallet_collective_technical_committee::WeightInfo<Runtime>;
type MaxProposalWeight = MaxProposalWeight;
}
type MoreThanHalfCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>;
impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type RuntimeEvent = RuntimeEvent;
type AddOrigin = MoreThanHalfCouncil;
type RemoveOrigin = MoreThanHalfCouncil;
type SwapOrigin = MoreThanHalfCouncil;
type ResetOrigin = MoreThanHalfCouncil;
type PrimeOrigin = MoreThanHalfCouncil;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
type MaxMembers = TechnicalMaxMembers;
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
}
parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 2000 * CENTS;
@@ -563,16 +396,11 @@ parameter_types! {
pub const MaxPeerInHeartbeats: u32 = 10_000;
}
type ApproveOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 5>,
>;
impl pallet_treasury::Config for Runtime {
type PalletId = TreasuryPalletId;
type Currency = Balances;
type ApproveOrigin = ApproveOrigin;
type RejectOrigin = MoreThanHalfCouncil;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
@@ -584,7 +412,7 @@ impl pallet_treasury::Config for Runtime {
type MaxApprovals = MaxApprovals;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
type SpendFunds = Bounties;
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendOrigin = TreasurySpender;
}
parameter_types! {
@@ -625,17 +453,6 @@ impl pallet_child_bounties::Config for Runtime {
type WeightInfo = weights::pallet_child_bounties::WeightInfo<Runtime>;
}
impl pallet_tips::Config for Runtime {
type MaximumReasonLength = MaximumReasonLength;
type DataDepositPerByte = DataDepositPerByte;
type Tippers = PhragmenElection;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_tips::WeightInfo<Runtime>;
}
impl pallet_offences::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
@@ -746,8 +563,7 @@ impl claims::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type VestingSchedule = Vesting;
type Prefix = Prefix;
type MoveClaimOrigin =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type MoveClaimOrigin = EnsureRoot<AccountId>;
type WeightInfo = weights::runtime_common_claims::WeightInfo<Runtime>;
}
@@ -771,8 +587,8 @@ impl pallet_identity::Config for Runtime {
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type Slashed = Treasury;
type ForceOrigin = MoreThanHalfCouncil;
type RegistrarOrigin = MoreThanHalfCouncil;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}
@@ -913,15 +729,14 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) |
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::TechnicalMembership(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::ChildBounties(..) |
RuntimeCall::Tips(..) |
RuntimeCall::ConvictionVoting(..) |
RuntimeCall::Referenda(..) |
RuntimeCall::FellowshipCollective(..) |
RuntimeCall::FellowshipReferenda(..) |
RuntimeCall::Whitelist(..) |
RuntimeCall::Claims(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
@@ -948,17 +763,18 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Slots(..) |
RuntimeCall::Auctions(..) // Specifically omitting the entire XCM Pallet
),
ProxyType::Governance =>
matches!(
c,
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) | RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Tips(..) | RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..)
),
ProxyType::Governance => matches!(
c,
RuntimeCall::Bounties(..) |
RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..) |
// OpenGov calls
RuntimeCall::ConvictionVoting(..) |
RuntimeCall::Referenda(..) |
RuntimeCall::FellowshipCollective(..) |
RuntimeCall::FellowshipReferenda(..) |
RuntimeCall::Whitelist(..)
),
ProxyType::IdentityJudgement => matches!(
c,
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
@@ -1184,7 +1000,7 @@ impl slots::Config for Runtime {
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
type LeaseOffset = ();
type ForceOrigin = MoreThanHalfCouncil;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, LeaseAdmin>;
type WeightInfo = weights::runtime_common_slots::WeightInfo<Runtime>;
}
@@ -1217,11 +1033,6 @@ parameter_types! {
pub const SampleLength: BlockNumber = 2 * MINUTES;
}
type AuctionInitiate = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>;
impl auctions::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Leaser = Slots;
@@ -1229,7 +1040,7 @@ impl auctions::Config for Runtime {
type EndingPeriod = EndingPeriod;
type SampleLength = SampleLength;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type InitiateOrigin = AuctionInitiate;
type InitiateOrigin = EitherOf<EnsureRoot<Self::AccountId>, AuctionAdmin>;
type WeightInfo = weights::runtime_common_auctions::WeightInfo<Runtime>;
}
@@ -1425,13 +1236,19 @@ construct_runtime! {
AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config<T>} = 12,
// Governance stuff; uncallable initially.
Democracy: pallet_democracy::{Pallet, Call, Storage, Config<T>, Event<T>} = 13,
Council: pallet_collective::<Instance1>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 14,
TechnicalCommittee: pallet_collective::<Instance2>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 15,
PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event<T>, Config<T>} = 16,
TechnicalMembership: pallet_membership::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 17,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config<T>, Event<T>} = 18,
ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event<T>} = 20,
Referenda: pallet_referenda::{Pallet, Call, Storage, Event<T>} = 21,
// pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1;
FellowshipCollective: pallet_ranked_collective::<Instance1>::{
Pallet, Call, Storage, Event<T>
} = 22,
// pub type FellowshipReferendaInstance = pallet_referenda::Instance2;
FellowshipReferenda: pallet_referenda::<Instance2>::{
Pallet, Call, Storage, Event<T>
} = 23,
Origins: pallet_custom_origins::{Origin} = 43,
Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event<T>} = 44,
// Claims. Usable initially.
Claims: claims::{Pallet, Call, Storage, Event<T>, Config<T>, ValidateUnsigned} = 19,
@@ -1466,9 +1283,6 @@ construct_runtime! {
Bounties: pallet_bounties::{Pallet, Call, Storage, Event<T>} = 35,
ChildBounties: pallet_child_bounties = 40,
// Tips module.
Tips: pallet_tips::{Pallet, Call, Storage, Event<T>} = 36,
// NIS pallet.
Nis: pallet_nis::{Pallet, Call, Storage, Event<T>, HoldReason} = 38,
// pub type NisCounterpartInstance = pallet_balances::Instance2;
@@ -1563,6 +1377,8 @@ pub mod migrations {
parachains_configuration::migration::v8::MigrateToV8<Runtime>,
parachains_configuration::migration::v9::MigrateToV9<Runtime>,
paras_registrar::migration::VersionCheckedMigrateToV1<Runtime, ()>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, ()>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, pallet_referenda::Instance2>,
);
}
@@ -1629,28 +1445,27 @@ mod benches {
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_bounties, Bounties]
[pallet_child_bounties, ChildBounties]
[pallet_collective, Council]
[pallet_collective, TechnicalCommittee]
[pallet_democracy, Democracy]
[pallet_elections_phragmen, PhragmenElection]
[pallet_conviction_voting, ConvictionVoting]
[pallet_nis, Nis]
[pallet_identity, Identity]
[pallet_im_online, ImOnline]
[pallet_indices, Indices]
[pallet_membership, TechnicalMembership]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig]
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_ranked_collective, FellowshipCollective]
[pallet_recovery, Recovery]
[pallet_referenda, Referenda]
[pallet_referenda, FellowshipReferenda]
[pallet_scheduler, Scheduler]
[pallet_sudo, Sudo]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_tips, Tips]
[pallet_treasury, Treasury]
[pallet_utility, Utility]
[pallet_vesting, Vesting]
[pallet_whitelist, Whitelist]
// XCM
[pallet_xcm, XcmPallet]
[pallet_xcm_benchmarks::fungible, pallet_xcm_benchmarks::fungible::Pallet::<Runtime>]
@@ -2143,7 +1958,7 @@ sp_api::impl_runtime_apis! {
use sp_storage::TrackedStorageKey;
use xcm::latest::prelude::*;
use xcm_config::{
LocalCheckAccount, LocationConverter, Rockmine, TokenLocation, XcmConfig,
LocalCheckAccount, LocationConverter, AssetHub, TokenLocation, XcmConfig,
};
impl frame_system_benchmarking::Config for Runtime {}
@@ -2152,7 +1967,7 @@ sp_api::impl_runtime_apis! {
type XcmConfig = XcmConfig;
type AccountIdConverter = LocationConverter;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(Rockmine::get())
Ok(AssetHub::get())
}
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
// Rococo only knows about ROC
@@ -2165,7 +1980,7 @@ sp_api::impl_runtime_apis! {
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Rockmine::get(),
AssetHub::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(TokenLocation::get()) },
));
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
@@ -2204,15 +2019,15 @@ sp_api::impl_runtime_apis! {
}
fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((Rockmine::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((AssetHub::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}
fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(Rockmine::get())
Ok(AssetHub::get())
}
fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = Rockmine::get();
let origin = AssetHub::get();
let assets: MultiAssets = (Concrete(TokenLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
+5 -6
View File
@@ -20,27 +20,26 @@ pub mod pallet_balances;
pub mod pallet_balances_nis_counterpart_balances;
pub mod pallet_bounties;
pub mod pallet_child_bounties;
pub mod pallet_collective_council;
pub mod pallet_collective_technical_committee;
pub mod pallet_democracy;
pub mod pallet_elections_phragmen;
pub mod pallet_conviction_voting;
pub mod pallet_identity;
pub mod pallet_im_online;
pub mod pallet_indices;
pub mod pallet_membership;
pub mod pallet_message_queue;
pub mod pallet_multisig;
pub mod pallet_nis;
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_sudo;
pub mod pallet_timestamp;
pub mod pallet_tips;
pub mod pallet_treasury;
pub mod pallet_utility;
pub mod pallet_vesting;
pub mod pallet_whitelist;
pub mod pallet_xcm;
pub mod runtime_common_assigned_slots;
pub mod runtime_common_auctions;
@@ -1,196 +0,0 @@
// Copyright (C) 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_collective`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_collective
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/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_collective`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Storage: Collective Members (r:1 w:1)
// Storage: Collective Proposals (r:1 w:0)
// Storage: Collective Voting (r:100 w:100)
// Storage: Collective Prime (r:0 w:1)
/// The range of component `m` is `[1, 100]`.
/// The range of component `n` is `[1, 100]`.
/// The range of component `p` is `[1, 100]`.
fn set_members(m: u32, _n: u32, p: u32, ) -> Weight {
Weight::from_parts(0 as u64, 0)
// Standard Error: 15_000
.saturating_add(Weight::from_parts(10_832_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 15_000
.saturating_add(Weight::from_parts(12_894_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(p as u64)))
.saturating_add(T::DbWeight::get().writes(2 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64)))
}
// Storage: Collective Members (r:1 w:0)
/// The range of component `b` is `[1, 1024]`.
/// The range of component `m` is `[1, 100]`.
fn execute(b: u32, m: u32, ) -> Weight {
Weight::from_parts(19_069_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(2_000 as u64, 0).saturating_mul(b as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(13_000 as u64, 0).saturating_mul(m as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Collective Members (r:1 w:0)
// Storage: Collective ProposalOf (r:1 w:0)
/// The range of component `b` is `[1, 1024]`.
/// The range of component `m` is `[1, 100]`.
fn propose_execute(b: u32, m: u32, ) -> Weight {
Weight::from_parts(20_794_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(2_000 as u64, 0).saturating_mul(b as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(22_000 as u64, 0).saturating_mul(m as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
}
// Storage: Collective Members (r:1 w:0)
// Storage: Collective ProposalOf (r:1 w:1)
// Storage: Collective Proposals (r:1 w:1)
// Storage: Collective ProposalCount (r:1 w:1)
// Storage: Collective Voting (r:0 w:1)
/// The range of component `b` is `[1, 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 {
Weight::from_parts(27_870_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(3_000 as u64, 0).saturating_mul(b as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_parts(22_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_parts(94_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Collective Members (r:1 w:0)
// Storage: Collective Voting (r:1 w:1)
/// The range of component `m` is `[5, 100]`.
fn vote(m: u32, ) -> Weight {
Weight::from_parts(27_249_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(35_000 as u64, 0).saturating_mul(m as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Collective Voting (r:1 w:1)
// Storage: Collective Members (r:1 w:0)
// Storage: Collective Proposals (r:1 w:1)
// Storage: Collective ProposalOf (r:0 w:1)
/// 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 {
Weight::from_parts(30_754_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(28_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(81_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Collective Voting (r:1 w:1)
// Storage: Collective Members (r:1 w:0)
// Storage: Collective ProposalOf (r:1 w:1)
// Storage: Collective Proposals (r:1 w:1)
/// The range of component `b` is `[1, 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 {
Weight::from_parts(39_508_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(1_000 as u64, 0).saturating_mul(b as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(29_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(90_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Collective Voting (r:1 w:1)
// Storage: Collective Members (r:1 w:0)
// Storage: Collective Prime (r:1 w:0)
// Storage: Collective Proposals (r:1 w:1)
// Storage: Collective ProposalOf (r:0 w:1)
/// The range of component `m` is `[4, 100]`.
/// The range of component `p` is `[1, 100]`.
fn close_disapproved(m: u32, p: u32, ) -> Weight {
Weight::from_parts(32_769_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(31_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(83_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Collective Voting (r:1 w:1)
// Storage: Collective Members (r:1 w:0)
// Storage: Collective Prime (r:1 w:0)
// Storage: Collective ProposalOf (r:1 w:1)
// Storage: Collective Proposals (r:1 w:1)
/// The range of component `b` is `[1, 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 {
Weight::from_parts(41_704_000 as u64, 0)
// Standard Error: 0
.saturating_add(Weight::from_parts(1_000 as u64, 0).saturating_mul(b as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(28_000 as u64, 0).saturating_mul(m as u64))
// Standard Error: 0
.saturating_add(Weight::from_parts(92_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Collective Proposals (r:1 w:1)
// Storage: Collective Voting (r:0 w:1)
// Storage: Collective ProposalOf (r:0 w:1)
/// The range of component `p` is `[1, 100]`.
fn disapprove_proposal(p: u32, ) -> Weight {
Weight::from_parts(22_720_000 as u64, 0)
// Standard Error: 2_000
.saturating_add(Weight::from_parts(74_000 as u64, 0).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
}
@@ -1,322 +0,0 @@
// Copyright (C) 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_collective`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_collective
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_collective`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
/// 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)
/// The range of component `m` is `[0, 100]`.
/// The range of component `n` is `[0, 100]`.
/// The range of component `p` is `[0, 100]`.
/// 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: `15795 + m * (1967 ±16) + p * (4332 ±16)`
// Minimum execution time: 17_182_000 picoseconds.
Weight::from_parts(17_462_000, 0)
.saturating_add(Weight::from_parts(0, 15795))
// Standard Error: 42_032
.saturating_add(Weight::from_parts(4_868_618, 0).saturating_mul(m.into()))
// Standard Error: 42_032
.saturating_add(Weight::from_parts(7_289_594, 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()))
}
/// Storage: Council Members (r:1 w:0)
/// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[1, 100]`.
/// 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: `136 + m * (32 ±0)`
// Estimated: `1622 + m * (32 ±0)`
// Minimum execution time: 16_507_000 picoseconds.
Weight::from_parts(16_066_632, 0)
.saturating_add(Weight::from_parts(0, 1622))
// Standard Error: 21
.saturating_add(Weight::from_parts(982, 0).saturating_mul(b.into()))
// Standard Error: 220
.saturating_add(Weight::from_parts(14_026, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(1))
.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)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[1, 100]`.
/// 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: `136 + m * (32 ±0)`
// Estimated: `3602 + m * (32 ±0)`
// Minimum execution time: 18_990_000 picoseconds.
Weight::from_parts(18_411_713, 0)
.saturating_add(Weight::from_parts(0, 3602))
// Standard Error: 15
.saturating_add(Weight::from_parts(1_166, 0).saturating_mul(b.into()))
// Standard Error: 164
.saturating_add(Weight::from_parts(23_067, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(2))
.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)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[2, 100]`.
/// The range of component `p` is `[1, 100]`.
/// 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: `426 + m * (32 ±0) + p * (36 ±0)`
// Estimated: `3818 + m * (33 ±0) + p * (36 ±0)`
// Minimum execution time: 25_500_000 picoseconds.
Weight::from_parts(26_304_307, 0)
.saturating_add(Weight::from_parts(0, 3818))
// Standard Error: 49
.saturating_add(Weight::from_parts(2_243, 0).saturating_mul(b.into()))
// Standard Error: 515
.saturating_add(Weight::from_parts(18_905, 0).saturating_mul(m.into()))
// Standard Error: 508
.saturating_add(Weight::from_parts(120_761, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.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()))
}
/// 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)
/// The range of component `m` is `[5, 100]`.
/// The range of component `m` is `[5, 100]`.
fn vote(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `875 + m * (64 ±0)`
// Estimated: `4339 + m * (64 ±0)`
// Minimum execution time: 22_166_000 picoseconds.
Weight::from_parts(22_901_859, 0)
.saturating_add(Weight::from_parts(0, 4339))
// Standard Error: 238
.saturating_add(Weight::from_parts(40_475, 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)
/// 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)
/// The range of component `m` is `[4, 100]`.
/// The range of component `p` is `[1, 100]`.
/// 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: `464 + m * (64 ±0) + p * (36 ±0)`
// Estimated: `3909 + m * (65 ±0) + p * (36 ±0)`
// Minimum execution time: 27_064_000 picoseconds.
Weight::from_parts(27_961_599, 0)
.saturating_add(Weight::from_parts(0, 3909))
// Standard Error: 401
.saturating_add(Weight::from_parts(22_196, 0).saturating_mul(m.into()))
// Standard Error: 391
.saturating_add(Weight::from_parts(115_698, 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()))
}
/// 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)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[4, 100]`.
/// The range of component `p` is `[1, 100]`.
/// 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: `766 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
// Estimated: `4083 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
// Minimum execution time: 38_302_000 picoseconds.
Weight::from_parts(40_639_640, 0)
.saturating_add(Weight::from_parts(0, 4083))
// Standard Error: 123
.saturating_add(Weight::from_parts(1_914, 0).saturating_mul(b.into()))
// Standard Error: 1_272
.saturating_add(Weight::from_parts(150_067, 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, 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)
/// The range of component `m` is `[4, 100]`.
/// The range of component `p` is `[1, 100]`.
/// 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: `484 + m * (64 ±0) + p * (36 ±0)`
// Estimated: `3929 + m * (65 ±0) + p * (36 ±0)`
// Minimum execution time: 30_017_000 picoseconds.
Weight::from_parts(30_565_580, 0)
.saturating_add(Weight::from_parts(0, 3929))
// Standard Error: 378
.saturating_add(Weight::from_parts(24_396, 0).saturating_mul(m.into()))
// Standard Error: 369
.saturating_add(Weight::from_parts(114_807, 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()))
}
/// 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)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[4, 100]`.
/// The range of component `p` is `[1, 100]`.
/// 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: `786 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
// Estimated: `4103 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
// Minimum execution time: 40_911_000 picoseconds.
Weight::from_parts(42_312_485, 0)
.saturating_add(Weight::from_parts(0, 4103))
// Standard Error: 83
.saturating_add(Weight::from_parts(2_208, 0).saturating_mul(b.into()))
// Standard Error: 879
.saturating_add(Weight::from_parts(20_173, 0).saturating_mul(m.into()))
// Standard Error: 857
.saturating_add(Weight::from_parts(146_302, 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, 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)
/// The range of component `p` is `[1, 100]`.
/// The range of component `p` is `[1, 100]`.
fn disapprove_proposal(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `293 + p * (32 ±0)`
// Estimated: `1778 + p * (32 ±0)`
// Minimum execution time: 15_465_000 picoseconds.
Weight::from_parts(17_387_663, 0)
.saturating_add(Weight::from_parts(0, 1778))
// Standard Error: 450
.saturating_add(Weight::from_parts(110_406, 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()))
}
}
@@ -1,324 +0,0 @@
// Copyright (C) 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_collective`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_collective
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_collective`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
/// Storage: TechnicalCommittee Members (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Voting (r:100 w:100)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `15766 + m * (1967 ±16) + p * (4332 ±16)`
// Minimum execution time: 17_826_000 picoseconds.
Weight::from_parts(18_046_000, 0)
.saturating_add(Weight::from_parts(0, 15766))
// Standard Error: 42_164
.saturating_add(Weight::from_parts(4_858_188, 0).saturating_mul(m.into()))
// Standard Error: 42_164
.saturating_add(Weight::from_parts(7_379_354, 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()))
}
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `b` is `[2, 1024]`.
/// The range of component `m` is `[1, 100]`.
/// 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: `107 + m * (32 ±0)`
// Estimated: `1593 + m * (32 ±0)`
// Minimum execution time: 16_992_000 picoseconds.
Weight::from_parts(16_555_669, 0)
.saturating_add(Weight::from_parts(0, 1593))
// Standard Error: 18
.saturating_add(Weight::from_parts(976, 0).saturating_mul(b.into()))
// Standard Error: 189
.saturating_add(Weight::from_parts(12_101, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
}
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:1 w:0)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `107 + m * (32 ±0)`
// Estimated: `3573 + m * (32 ±0)`
// Minimum execution time: 19_900_000 picoseconds.
Weight::from_parts(19_068_072, 0)
.saturating_add(Weight::from_parts(0, 3573))
// Standard Error: 12
.saturating_add(Weight::from_parts(1_161, 0).saturating_mul(b.into()))
// Standard Error: 129
.saturating_add(Weight::from_parts(22_376, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
}
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:1 w:1)
/// Proof Skipped: TechnicalCommittee ProposalOf (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalCount (r:1 w:1)
/// Proof Skipped: TechnicalCommittee ProposalCount (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Voting (r:0 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `397 + m * (32 ±0) + p * (36 ±0)`
// Estimated: `3789 + m * (33 ±0) + p * (36 ±0)`
// Minimum execution time: 26_264_000 picoseconds.
Weight::from_parts(27_099_606, 0)
.saturating_add(Weight::from_parts(0, 3789))
// Standard Error: 50
.saturating_add(Weight::from_parts(2_278, 0).saturating_mul(b.into()))
// Standard Error: 525
.saturating_add(Weight::from_parts(19_424, 0).saturating_mul(m.into()))
// Standard Error: 519
.saturating_add(Weight::from_parts(120_852, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.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()))
}
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Voting (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// The range of component `m` is `[5, 100]`.
/// The range of component `m` is `[5, 100]`.
fn vote(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `846 + m * (64 ±0)`
// Estimated: `4310 + m * (64 ±0)`
// Minimum execution time: 22_954_000 picoseconds.
Weight::from_parts(23_675_214, 0)
.saturating_add(Weight::from_parts(0, 4310))
// Standard Error: 256
.saturating_add(Weight::from_parts(40_562, 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: TechnicalCommittee Voting (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:0 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `435 + m * (64 ±0) + p * (36 ±0)`
// Estimated: `3880 + m * (65 ±0) + p * (36 ±0)`
// Minimum execution time: 27_797_000 picoseconds.
Weight::from_parts(28_934_600, 0)
.saturating_add(Weight::from_parts(0, 3880))
// Standard Error: 374
.saturating_add(Weight::from_parts(20_716, 0).saturating_mul(m.into()))
// Standard Error: 364
.saturating_add(Weight::from_parts(115_491, 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()))
}
/// Storage: TechnicalCommittee Voting (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:1 w:1)
/// Proof Skipped: TechnicalCommittee ProposalOf (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `737 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
// Estimated: `4054 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
// Minimum execution time: 39_160_000 picoseconds.
Weight::from_parts(40_470_419, 0)
.saturating_add(Weight::from_parts(0, 4054))
// Standard Error: 82
.saturating_add(Weight::from_parts(2_146, 0).saturating_mul(b.into()))
// Standard Error: 869
.saturating_add(Weight::from_parts(21_442, 0).saturating_mul(m.into()))
// Standard Error: 847
.saturating_add(Weight::from_parts(144_479, 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, 40).saturating_mul(p.into()))
}
/// Storage: TechnicalCommittee Voting (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:0 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `455 + m * (64 ±0) + p * (36 ±0)`
// Estimated: `3900 + m * (65 ±0) + p * (36 ±0)`
// Minimum execution time: 30_953_000 picoseconds.
Weight::from_parts(31_427_489, 0)
.saturating_add(Weight::from_parts(0, 3900))
// Standard Error: 397
.saturating_add(Weight::from_parts(24_280, 0).saturating_mul(m.into()))
// Standard Error: 387
.saturating_add(Weight::from_parts(116_864, 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()))
}
/// Storage: TechnicalCommittee Voting (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Members (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:1 w:1)
/// Proof Skipped: TechnicalCommittee ProposalOf (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee 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]`.
/// 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: `757 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
// Estimated: `4074 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
// Minimum execution time: 41_468_000 picoseconds.
Weight::from_parts(43_538_242, 0)
.saturating_add(Weight::from_parts(0, 4074))
// Standard Error: 80
.saturating_add(Weight::from_parts(1_994, 0).saturating_mul(b.into()))
// Standard Error: 853
.saturating_add(Weight::from_parts(19_637, 0).saturating_mul(m.into()))
// Standard Error: 831
.saturating_add(Weight::from_parts(144_674, 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, 40).saturating_mul(p.into()))
}
/// Storage: TechnicalCommittee Proposals (r:1 w:1)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Voting (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: TechnicalCommittee ProposalOf (r:0 w:1)
/// Proof Skipped: TechnicalCommittee ProposalOf (max_values: None, max_size: None, mode: Measured)
/// The range of component `p` is `[1, 100]`.
/// The range of component `p` is `[1, 100]`.
fn disapprove_proposal(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `264 + p * (32 ±0)`
// Estimated: `1749 + p * (32 ±0)`
// Minimum execution time: 15_998_000 picoseconds.
Weight::from_parts(17_837_641, 0)
.saturating_add(Weight::from_parts(0, 1749))
// Standard Error: 422
.saturating_add(Weight::from_parts(111_526, 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()))
}
}
@@ -0,0 +1,195 @@
// Copyright (C) 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: 2023-06-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-e8ezs4ez-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --pallet=pallet_conviction_voting
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(311), added: 2786, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13445`
// Estimated: `42428`
// Minimum execution time: 151_077_000 picoseconds.
Weight::from_parts(165_283_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(311), added: 2786, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `14166`
// Estimated: `83866`
// Minimum execution time: 232_420_000 picoseconds.
Weight::from_parts(244_439_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `13918`
// Estimated: `83866`
// Minimum execution time: 205_017_000 picoseconds.
Weight::from_parts(216_594_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `13004`
// Estimated: `30706`
// Minimum execution time: 84_226_000 picoseconds.
Weight::from_parts(91_255_000, 0)
.saturating_add(Weight::from_parts(0, 30706))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:512 w:512)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(311), added: 2786, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 512]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `29640 + r * (365 ±0)`
// Estimated: `83866 + r * (3411 ±0)`
// Minimum execution time: 78_708_000 picoseconds.
Weight::from_parts(2_053_488_615, 0)
.saturating_add(Weight::from_parts(0, 83866))
// Standard Error: 179_271
.saturating_add(Weight::from_parts(47_806_482, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(6))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:512 w:512)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 512]`.
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `29555 + r * (365 ±0)`
// Estimated: `83866 + r * (3411 ±0)`
// Minimum execution time: 45_232_000 picoseconds.
Weight::from_parts(2_045_021_014, 0)
.saturating_add(Weight::from_parts(0, 83866))
// Standard Error: 185_130
.saturating_add(Weight::from_parts(47_896_011, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(311), added: 2786, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `12218`
// Estimated: `30706`
// Minimum execution time: 116_446_000 picoseconds.
Weight::from_parts(124_043_000, 0)
.saturating_add(Weight::from_parts(0, 30706))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -1,525 +0,0 @@
// Copyright (C) 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_democracy`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_democracy
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_democracy`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_democracy::WeightInfo for WeightInfo<T> {
/// Storage: Democracy PublicPropCount (r:1 w:1)
/// Proof: Democracy PublicPropCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy PublicProps (r:1 w:1)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Democracy Blacklist (r:1 w:0)
/// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen)
/// Storage: Democracy DepositOf (r:0 w:1)
/// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen)
fn propose() -> Weight {
// Proof Size summary in bytes:
// Measured: `4734`
// Estimated: `18187`
// Minimum execution time: 39_492_000 picoseconds.
Weight::from_parts(39_853_000, 0)
.saturating_add(Weight::from_parts(0, 18187))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy DepositOf (r:1 w:1)
/// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen)
fn second() -> Weight {
// Proof Size summary in bytes:
// Measured: `3489`
// Estimated: `6695`
// Minimum execution time: 36_683_000 picoseconds.
Weight::from_parts(37_121_000, 0)
.saturating_add(Weight::from_parts(0, 6695))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `3365`
// Estimated: `7260`
// Minimum execution time: 48_191_000 picoseconds.
Weight::from_parts(48_936_000, 0)
.saturating_add(Weight::from_parts(0, 7260))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `3387`
// Estimated: `7260`
// Minimum execution time: 52_175_000 picoseconds.
Weight::from_parts(53_011_000, 0)
.saturating_add(Weight::from_parts(0, 7260))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy Cancellations (r:1 w:1)
/// Proof: Democracy Cancellations (max_values: None, max_size: Some(33), added: 2508, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn emergency_cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `299`
// Estimated: `3666`
// Minimum execution time: 26_255_000 picoseconds.
Weight::from_parts(26_768_000, 0)
.saturating_add(Weight::from_parts(0, 3666))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy PublicProps (r:1 w:1)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Democracy DepositOf (r:1 w:1)
/// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:3 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
/// Storage: Democracy NextExternal (r:1 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy Blacklist (r:0 w:1)
/// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen)
fn blacklist() -> Weight {
// Proof Size summary in bytes:
// Measured: `5843`
// Estimated: `18187`
// Minimum execution time: 96_376_000 picoseconds.
Weight::from_parts(97_222_000, 0)
.saturating_add(Weight::from_parts(0, 18187))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(7))
}
/// Storage: Democracy NextExternal (r:1 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy Blacklist (r:1 w:0)
/// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen)
fn external_propose() -> Weight {
// Proof Size summary in bytes:
// Measured: `3349`
// Estimated: `6703`
// Minimum execution time: 13_815_000 picoseconds.
Weight::from_parts(14_071_000, 0)
.saturating_add(Weight::from_parts(0, 6703))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy NextExternal (r:0 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
fn external_propose_majority() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_456_000 picoseconds.
Weight::from_parts(3_716_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy NextExternal (r:0 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
fn external_propose_default() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_610_000 picoseconds.
Weight::from_parts(3_768_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy NextExternal (r:1 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumCount (r:1 w:1)
/// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:2)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:0 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
fn fast_track() -> Weight {
// Proof Size summary in bytes:
// Measured: `219`
// Estimated: `3518`
// Minimum execution time: 27_514_000 picoseconds.
Weight::from_parts(27_905_000, 0)
.saturating_add(Weight::from_parts(0, 3518))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: Democracy NextExternal (r:1 w:1)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy Blacklist (r:1 w:1)
/// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn veto_external() -> Weight {
// Proof Size summary in bytes:
// Measured: `3452`
// Estimated: `6703`
// Minimum execution time: 31_250_000 picoseconds.
Weight::from_parts(31_604_000, 0)
.saturating_add(Weight::from_parts(0, 6703))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy PublicProps (r:1 w:1)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Democracy DepositOf (r:1 w:1)
/// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn cancel_proposal() -> Weight {
// Proof Size summary in bytes:
// Measured: `5754`
// Estimated: `18187`
// Minimum execution time: 79_757_000 picoseconds.
Weight::from_parts(83_603_000, 0)
.saturating_add(Weight::from_parts(0, 18187))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:0 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
fn cancel_referendum() -> Weight {
// Proof Size summary in bytes:
// Measured: `204`
// Estimated: `3518`
// Minimum execution time: 20_034_000 picoseconds.
Weight::from_parts(20_674_000, 0)
.saturating_add(Weight::from_parts(0, 3518))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Democracy LowestUnbaked (r:1 w:1)
/// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumCount (r:1 w:0)
/// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:99 w:0)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn on_initialize_base(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `177 + r * (86 ±0)`
// Estimated: `1489 + r * (2676 ±0)`
// Minimum execution time: 7_053_000 picoseconds.
Weight::from_parts(10_157_848, 0)
.saturating_add(Weight::from_parts(0, 1489))
// Standard Error: 5_462
.saturating_add(Weight::from_parts(2_710_889, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
}
/// Storage: Democracy LowestUnbaked (r:1 w:1)
/// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumCount (r:1 w:0)
/// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Democracy LastTabledWasExternal (r:1 w:0)
/// Proof: Democracy LastTabledWasExternal (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: Democracy NextExternal (r:1 w:0)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy PublicProps (r:1 w:0)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:99 w:0)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn on_initialize_base_with_launch_period(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `177 + r * (86 ±0)`
// Estimated: `18187 + r * (2676 ±0)`
// Minimum execution time: 9_585_000 picoseconds.
Weight::from_parts(13_021_372, 0)
.saturating_add(Weight::from_parts(0, 18187))
// Standard Error: 6_031
.saturating_add(Weight::from_parts(2_707_449, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
}
/// Storage: Democracy VotingOf (r:3 w:3)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:99 w:99)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `729 + r * (108 ±0)`
// Estimated: `19800 + r * (2676 ±0)`
// Minimum execution time: 41_109_000 picoseconds.
Weight::from_parts(46_477_334, 0)
.saturating_add(Weight::from_parts(0, 19800))
// Standard Error: 9_372
.saturating_add(Weight::from_parts(3_815_232, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
}
/// Storage: Democracy VotingOf (r:2 w:2)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Democracy ReferendumInfoOf (r:99 w:99)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `426 + r * (108 ±0)`
// Estimated: `13530 + r * (2676 ±0)`
// Minimum execution time: 21_283_000 picoseconds.
Weight::from_parts(23_372_139, 0)
.saturating_add(Weight::from_parts(0, 13530))
// Standard Error: 6_191
.saturating_add(Weight::from_parts(3_768_585, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into()))
}
/// Storage: Democracy PublicProps (r:0 w:1)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
fn clear_public_proposals() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_510_000 picoseconds.
Weight::from_parts(3_642_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn unlock_remove(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `458`
// Estimated: `7260`
// Minimum execution time: 23_647_000 picoseconds.
Weight::from_parts(36_627_552, 0)
.saturating_add(Weight::from_parts(0, 7260))
// Standard Error: 2_937
.saturating_add(Weight::from_parts(34_132, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// The range of component `r` is `[0, 99]`.
fn unlock_set(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `459 + r * (22 ±0)`
// Estimated: `7260`
// Minimum execution time: 33_932_000 picoseconds.
Weight::from_parts(35_331_660, 0)
.saturating_add(Weight::from_parts(0, 7260))
// Standard Error: 615
.saturating_add(Weight::from_parts(60_730, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// The range of component `r` is `[1, 100]`.
fn remove_vote(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `661 + r * (26 ±0)`
// Estimated: `7260`
// Minimum execution time: 16_605_000 picoseconds.
Weight::from_parts(19_057_092, 0)
.saturating_add(Weight::from_parts(0, 7260))
// Standard Error: 873
.saturating_add(Weight::from_parts(68_964, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:1)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy VotingOf (r:1 w:1)
/// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen)
/// The range of component `r` is `[1, 100]`.
fn remove_other_vote(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `661 + r * (26 ±0)`
// Estimated: `7260`
// Minimum execution time: 16_801_000 picoseconds.
Weight::from_parts(19_166_788, 0)
.saturating_add(Weight::from_parts(0, 7260))
// Standard Error: 1_008
.saturating_add(Weight::from_parts(69_851, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Democracy NextExternal (r:1 w:0)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Preimage StatusFor (r:1 w:0)
/// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:0 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn set_external_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `361`
// Estimated: `3556`
// Minimum execution time: 19_207_000 picoseconds.
Weight::from_parts(19_693_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy NextExternal (r:1 w:0)
/// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn clear_external_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `219`
// Estimated: `3518`
// Minimum execution time: 17_333_000 picoseconds.
Weight::from_parts(17_555_000, 0)
.saturating_add(Weight::from_parts(0, 3518))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy PublicProps (r:1 w:0)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Preimage StatusFor (r:1 w:0)
/// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:0 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn set_proposal_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `4893`
// Estimated: `18187`
// Minimum execution time: 33_859_000 picoseconds.
Weight::from_parts(34_538_000, 0)
.saturating_add(Weight::from_parts(0, 18187))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy PublicProps (r:1 w:0)
/// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn clear_proposal_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `4755`
// Estimated: `18187`
// Minimum execution time: 31_155_000 picoseconds.
Weight::from_parts(31_520_000, 0)
.saturating_add(Weight::from_parts(0, 18187))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Preimage StatusFor (r:1 w:0)
/// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:0 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn set_referendum_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `216`
// Estimated: `3556`
// Minimum execution time: 15_924_000 picoseconds.
Weight::from_parts(16_151_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Democracy ReferendumInfoOf (r:1 w:0)
/// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen)
/// Storage: Democracy MetadataOf (r:1 w:1)
/// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen)
fn clear_referendum_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `235`
// Estimated: `3666`
// Minimum execution time: 18_983_000 picoseconds.
Weight::from_parts(19_280_000, 0)
.saturating_add(Weight::from_parts(0, 3666))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -1,315 +0,0 @@
// Copyright (C) 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_elections_phragmen`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_elections_phragmen
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_elections_phragmen`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightInfo<T> {
/// Storage: PhragmenElection Candidates (r:1 w:0)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:0)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Voting (r:1 w:1)
/// Proof Skipped: PhragmenElection Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// The range of component `v` is `[1, 16]`.
fn vote_equal(v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `331 + v * (80 ±0)`
// Estimated: `4764 + v * (80 ±0)`
// Minimum execution time: 30_910_000 picoseconds.
Weight::from_parts(31_851_802, 0)
.saturating_add(Weight::from_parts(0, 4764))
// Standard Error: 4_099
.saturating_add(Weight::from_parts(137_675, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into()))
}
/// Storage: PhragmenElection Candidates (r:1 w:0)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:0)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Voting (r:1 w:1)
/// Proof Skipped: PhragmenElection Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// The range of component `v` is `[2, 16]`.
fn vote_more(v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `299 + v * (80 ±0)`
// Estimated: `4764 + v * (80 ±0)`
// Minimum execution time: 42_670_000 picoseconds.
Weight::from_parts(43_351_345, 0)
.saturating_add(Weight::from_parts(0, 4764))
// Standard Error: 2_986
.saturating_add(Weight::from_parts(142_231, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into()))
}
/// Storage: PhragmenElection Candidates (r:1 w:0)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:0)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Voting (r:1 w:1)
/// Proof Skipped: PhragmenElection Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// The range of component `v` is `[2, 16]`.
fn vote_less(v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `331 + v * (80 ±0)`
// Estimated: `4764 + v * (80 ±0)`
// Minimum execution time: 42_782_000 picoseconds.
Weight::from_parts(43_611_866, 0)
.saturating_add(Weight::from_parts(0, 4764))
// Standard Error: 2_968
.saturating_add(Weight::from_parts(125_939, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into()))
}
/// Storage: PhragmenElection Voting (r:1 w:1)
/// Proof Skipped: PhragmenElection Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
fn remove_voter() -> Weight {
// Proof Size summary in bytes:
// Measured: `853`
// Estimated: `4764`
// Minimum execution time: 44_301_000 picoseconds.
Weight::from_parts(44_843_000, 0)
.saturating_add(Weight::from_parts(0, 4764))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: PhragmenElection Candidates (r:1 w:1)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:0)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `c` is `[1, 1000]`.
fn submit_candidacy(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `2678 + c * (48 ±0)`
// Estimated: `4161 + c * (48 ±0)`
// Minimum execution time: 33_576_000 picoseconds.
Weight::from_parts(26_859_487, 0)
.saturating_add(Weight::from_parts(0, 4161))
// Standard Error: 854
.saturating_add(Weight::from_parts(81_887, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into()))
}
/// Storage: PhragmenElection Candidates (r:1 w:1)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `c` is `[1, 1000]`.
fn renounce_candidacy_candidate(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `250 + c * (48 ±0)`
// Estimated: `1722 + c * (48 ±0)`
// Minimum execution time: 29_671_000 picoseconds.
Weight::from_parts(22_509_800, 0)
.saturating_add(Weight::from_parts(0, 1722))
// Standard Error: 908
.saturating_add(Weight::from_parts(58_320, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into()))
}
/// Storage: PhragmenElection Members (r:1 w:1)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:1)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Council Prime (r:1 w:1)
/// Proof Skipped: Council Prime (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 Members (r:0 w:1)
/// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured)
fn renounce_candidacy_members() -> Weight {
// Proof Size summary in bytes:
// Measured: `2952`
// Estimated: `4437`
// Minimum execution time: 45_934_000 picoseconds.
Weight::from_parts(46_279_000, 0)
.saturating_add(Weight::from_parts(0, 4437))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: PhragmenElection RunnersUp (r:1 w:1)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
fn renounce_candidacy_runners_up() -> Weight {
// Proof Size summary in bytes:
// Measured: `1647`
// Estimated: `3132`
// Minimum execution time: 30_291_000 picoseconds.
Weight::from_parts(30_611_000, 0)
.saturating_add(Weight::from_parts(0, 3132))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Benchmark Override (r:0 w:0)
/// Proof Skipped: Benchmark Override (max_values: None, max_size: None, mode: Measured)
fn remove_member_without_replacement() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000_000_000 picoseconds.
Weight::from_parts(2_000_000_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: PhragmenElection Members (r:1 w:1)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), 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: PhragmenElection RunnersUp (r:1 w:1)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Council Prime (r:1 w:1)
/// Proof Skipped: Council Prime (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 Members (r:0 w:1)
/// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured)
fn remove_member_with_replacement() -> Weight {
// Proof Size summary in bytes:
// Measured: `2952`
// Estimated: `4437`
// Minimum execution time: 63_178_000 picoseconds.
Weight::from_parts(63_850_000, 0)
.saturating_add(Weight::from_parts(0, 4437))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: PhragmenElection Voting (r:10001 w:10000)
/// Proof Skipped: PhragmenElection Voting (max_values: None, max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:0)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Candidates (r:1 w:0)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Balances Locks (r:10000 w:10000)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:10000 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
/// Storage: System Account (r:10000 w:10000)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// The range of component `v` is `[5000, 10000]`.
/// The range of component `d` is `[0, 5000]`.
fn clean_defunct_voters(v: u32, _d: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `35961 + v * (808 ±0)`
// Estimated: `39702 + v * (3774 ±0)`
// Minimum execution time: 379_638_846_000 picoseconds.
Weight::from_parts(380_443_068_000, 0)
.saturating_add(Weight::from_parts(0, 39702))
// Standard Error: 318_371
.saturating_add(Weight::from_parts(46_236_987, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(v.into())))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(v.into())))
.saturating_add(Weight::from_parts(0, 3774).saturating_mul(v.into()))
}
/// Storage: PhragmenElection Candidates (r:1 w:1)
/// Proof Skipped: PhragmenElection Candidates (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:1)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection RunnersUp (r:1 w:1)
/// Proof Skipped: PhragmenElection RunnersUp (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PhragmenElection Voting (r:10001 w:0)
/// Proof Skipped: PhragmenElection Voting (max_values: None, 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: System Account (r:962 w:962)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: PhragmenElection ElectionRounds (r:1 w:1)
/// Proof Skipped: PhragmenElection ElectionRounds (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Council Members (r:0 w:1)
/// Proof Skipped: Council Members (max_values: Some(1), 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)
/// The range of component `c` is `[1, 1000]`.
/// The range of component `v` is `[1, 10000]`.
/// The range of component `e` is `[10000, 160000]`.
fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + e * (28 ±0) + v * (607 ±0)`
// Estimated: `2771509 + c * (2560 ±0) + e * (16 ±0) + v * (2744 ±4)`
// Minimum execution time: 35_941_980_000 picoseconds.
Weight::from_parts(36_032_688_000, 0)
.saturating_add(Weight::from_parts(0, 2771509))
// Standard Error: 554_972
.saturating_add(Weight::from_parts(43_733_923, 0).saturating_mul(v.into()))
// Standard Error: 35_614
.saturating_add(Weight::from_parts(2_430_249, 0).saturating_mul(e.into()))
.saturating_add(T::DbWeight::get().reads(265))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(v.into())))
.saturating_add(T::DbWeight::get().writes(6))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
.saturating_add(Weight::from_parts(0, 2560).saturating_mul(c.into()))
.saturating_add(Weight::from_parts(0, 16).saturating_mul(e.into()))
.saturating_add(Weight::from_parts(0, 2744).saturating_mul(v.into()))
}
}
@@ -1,204 +0,0 @@
// Copyright (C) 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_membership`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_membership
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_membership`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> {
/// Storage: TechnicalMembership Members (r:1 w:1)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Members (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[1, 99]`.
fn add_member(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `140 + m * (64 ±0)`
// Estimated: `4687 + m * (64 ±0)`
// Minimum execution time: 17_084_000 picoseconds.
Weight::from_parts(17_897_754, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 295
.saturating_add(Weight::from_parts(30_882, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Members (r:1 w:1)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalMembership Prime (r:1 w:0)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Members (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[2, 100]`.
fn remove_member(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `244 + m * (64 ±0)`
// Estimated: `4687 + m * (64 ±0)`
// Minimum execution time: 19_550_000 picoseconds.
Weight::from_parts(20_467_978, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 330
.saturating_add(Weight::from_parts(31_881, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Members (r:1 w:1)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalMembership Prime (r:1 w:0)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Members (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[2, 100]`.
fn swap_member(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `244 + m * (64 ±0)`
// Estimated: `4687 + m * (64 ±0)`
// Minimum execution time: 19_994_000 picoseconds.
Weight::from_parts(20_663_824, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 337
.saturating_add(Weight::from_parts(44_806, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Members (r:1 w:1)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalMembership Prime (r:1 w:0)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Members (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[1, 100]`.
fn reset_member(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `244 + m * (64 ±0)`
// Estimated: `4687 + m * (64 ±0)`
// Minimum execution time: 18_978_000 picoseconds.
Weight::from_parts(21_273_577, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 2_765
.saturating_add(Weight::from_parts(152_082, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Members (r:1 w:1)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Proposals (r:1 w:0)
/// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalMembership Prime (r:1 w:1)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Members (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[1, 100]`.
fn change_key(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `244 + m * (64 ±0)`
// Estimated: `4687 + m * (64 ±0)`
// Minimum execution time: 20_005_000 picoseconds.
Weight::from_parts(21_280_089, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 672
.saturating_add(Weight::from_parts(41_961, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Members (r:1 w:0)
/// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen)
/// Storage: TechnicalMembership Prime (r:0 w:1)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[1, 100]`.
fn set_prime(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `32 + m * (32 ±0)`
// Estimated: `4687 + m * (32 ±0)`
// Minimum execution time: 8_168_000 picoseconds.
Weight::from_parts(8_579_141, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 215
.saturating_add(Weight::from_parts(9_557, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
}
/// Storage: TechnicalMembership Prime (r:0 w:1)
/// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: TechnicalCommittee Prime (r:0 w:1)
/// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured)
/// The range of component `m` is `[1, 100]`.
fn clear_prime(m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_344_000 picoseconds.
Weight::from_parts(3_551_700, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 86
.saturating_add(Weight::from_parts(832, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().writes(2))
}
}
@@ -0,0 +1,175 @@
// Copyright (C) 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: 2023-07-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-xerhrdyb-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_ranked_collective
// --chain=rococo-dev
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:1)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IndexToId` (r:0 w:1)
/// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IdToIndex` (r:0 w:1)
/// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
fn add_member() -> Weight {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3507`
// Minimum execution time: 17_632_000 picoseconds.
Weight::from_parts(18_252_000, 0)
.saturating_add(Weight::from_parts(0, 3507))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipCollective::Members` (r:1 w:1)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:11 w:11)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IdToIndex` (r:11 w:11)
/// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IndexToId` (r:11 w:11)
/// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 10]`.
fn remove_member(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `517 + r * (281 ±0)`
// Estimated: `3519 + r * (2529 ±0)`
// Minimum execution time: 27_960_000 picoseconds.
Weight::from_parts(30_632_408, 0)
.saturating_add(Weight::from_parts(0, 3519))
// Standard Error: 22_806
.saturating_add(Weight::from_parts(13_000_901, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 2529).saturating_mul(r.into()))
}
/// Storage: `FellowshipCollective::Members` (r:1 w:1)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:1)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IndexToId` (r:0 w:1)
/// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IdToIndex` (r:0 w:1)
/// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 10]`.
fn promote_member(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `214 + r * (17 ±0)`
// Estimated: `3507`
// Minimum execution time: 19_900_000 picoseconds.
Weight::from_parts(20_908_316, 0)
.saturating_add(Weight::from_parts(0, 3507))
// Standard Error: 4_878
.saturating_add(Weight::from_parts(330_385, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipCollective::Members` (r:1 w:1)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:1)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IdToIndex` (r:1 w:1)
/// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::IndexToId` (r:1 w:1)
/// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 10]`.
fn demote_member(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `532 + r * (72 ±0)`
// Estimated: `3519`
// Minimum execution time: 27_697_000 picoseconds.
Weight::from_parts(30_341_815, 0)
.saturating_add(Weight::from_parts(0, 3519))
// Standard Error: 17_010
.saturating_add(Weight::from_parts(642_213, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipCollective::Members` (r:1 w:0)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::Voting` (r:1 w:1)
/// Proof: `FellowshipCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `638`
// Estimated: `83866`
// Minimum execution time: 48_275_000 picoseconds.
Weight::from_parts(49_326_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::VotingCleanup` (r:1 w:0)
/// Proof: `FellowshipCollective::VotingCleanup` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::Voting` (r:100 w:100)
/// Proof: `FellowshipCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 100]`.
fn cleanup_poll(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `434 + n * (50 ±0)`
// Estimated: `4365 + n * (2540 ±0)`
// Minimum execution time: 15_506_000 picoseconds.
Weight::from_parts(17_634_029, 0)
.saturating_add(Weight::from_parts(0, 4365))
// Standard Error: 2_117
.saturating_add(Weight::from_parts(1_126_879, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2540).saturating_mul(n.into()))
}
}
@@ -0,0 +1,524 @@
// Copyright (C) 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: 2023-07-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-xerhrdyb-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_referenda
// --chain=rococo-dev
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::ReferendumCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:0 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
fn submit() -> Weight {
// Proof Size summary in bytes:
// Measured: `327`
// Estimated: `42428`
// Minimum execution time: 29_909_000 picoseconds.
Weight::from_parts(30_645_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `438`
// Estimated: `83866`
// Minimum execution time: 54_405_000 picoseconds.
Weight::from_parts(55_583_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:0)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2076`
// Estimated: `42428`
// Minimum execution time: 110_477_000 picoseconds.
Weight::from_parts(119_187_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:0)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2117`
// Estimated: `42428`
// Minimum execution time: 111_467_000 picoseconds.
Weight::from_parts(117_758_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `774`
// Estimated: `83866`
// Minimum execution time: 191_135_000 picoseconds.
Weight::from_parts(210_535_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `639`
// Estimated: `83866`
// Minimum execution time: 67_168_000 picoseconds.
Weight::from_parts(68_895_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
fn refund_decision_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `351`
// Estimated: `4365`
// Minimum execution time: 31_298_000 picoseconds.
Weight::from_parts(32_570_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
fn refund_submission_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `201`
// Estimated: `4365`
// Minimum execution time: 15_674_000 picoseconds.
Weight::from_parts(16_190_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `383`
// Estimated: `83866`
// Minimum execution time: 38_927_000 picoseconds.
Weight::from_parts(40_545_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::MetadataOf` (r:1 w:0)
/// Proof: `FellowshipReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `484`
// Estimated: `83866`
// Minimum execution time: 80_209_000 picoseconds.
Weight::from_parts(82_084_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:0)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
fn one_fewer_deciding_queue_empty() -> Weight {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `4277`
// Minimum execution time: 9_520_000 picoseconds.
Weight::from_parts(10_088_000, 0)
.saturating_add(Weight::from_parts(0, 4277))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn one_fewer_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `2376`
// Estimated: `42428`
// Minimum execution time: 93_893_000 picoseconds.
Weight::from_parts(101_065_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn one_fewer_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `2362`
// Estimated: `42428`
// Minimum execution time: 98_811_000 picoseconds.
Weight::from_parts(103_590_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
fn nudge_referendum_requeued_insertion() -> Weight {
// Proof Size summary in bytes:
// Measured: `1841`
// Estimated: `4365`
// Minimum execution time: 43_230_000 picoseconds.
Weight::from_parts(46_120_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
fn nudge_referendum_requeued_slide() -> Weight {
// Proof Size summary in bytes:
// Measured: `1808`
// Estimated: `4365`
// Minimum execution time: 43_092_000 picoseconds.
Weight::from_parts(46_018_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:0)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
fn nudge_referendum_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `1824`
// Estimated: `4365`
// Minimum execution time: 49_697_000 picoseconds.
Weight::from_parts(53_795_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:0)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::TrackQueue` (r:1 w:1)
/// Proof: `FellowshipReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(812), added: 3287, mode: `MaxEncodedLen`)
fn nudge_referendum_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `1865`
// Estimated: `4365`
// Minimum execution time: 50_417_000 picoseconds.
Weight::from_parts(53_214_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_no_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `335`
// Estimated: `42428`
// Minimum execution time: 25_688_000 picoseconds.
Weight::from_parts(26_575_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `383`
// Estimated: `42428`
// Minimum execution time: 26_230_000 picoseconds.
Weight::from_parts(27_235_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
fn nudge_referendum_timed_out() -> Weight {
// Proof Size summary in bytes:
// Measured: `242`
// Estimated: `4365`
// Minimum execution time: 17_585_000 picoseconds.
Weight::from_parts(18_225_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `584`
// Estimated: `42428`
// Minimum execution time: 38_243_000 picoseconds.
Weight::from_parts(39_959_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::DecidingCount` (r:1 w:1)
/// Proof: `FellowshipReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `719`
// Estimated: `42428`
// Minimum execution time: 88_424_000 picoseconds.
Weight::from_parts(92_969_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `770`
// Estimated: `42428`
// Minimum execution time: 138_207_000 picoseconds.
Weight::from_parts(151_726_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_end_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `755`
// Estimated: `42428`
// Minimum execution time: 131_001_000 picoseconds.
Weight::from_parts(148_651_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_continue_not_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `770`
// Estimated: `42428`
// Minimum execution time: 109_612_000 picoseconds.
Weight::from_parts(143_626_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_continue_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `776`
// Estimated: `42428`
// Minimum execution time: 71_754_000 picoseconds.
Weight::from_parts(77_329_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Lookup` (r:1 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
fn nudge_referendum_approved() -> Weight {
// Proof Size summary in bytes:
// Measured: `776`
// Estimated: `83866`
// Minimum execution time: 153_244_000 picoseconds.
Weight::from_parts(169_961_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipCollective::MemberCount` (r:1 w:0)
/// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_rejected() -> Weight {
// Proof Size summary in bytes:
// Measured: `772`
// Estimated: `42428`
// Minimum execution time: 137_997_000 picoseconds.
Weight::from_parts(157_862_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::MetadataOf` (r:0 w:1)
/// Proof: `FellowshipReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn set_some_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `458`
// Estimated: `4365`
// Minimum execution time: 21_794_000 picoseconds.
Weight::from_parts(22_341_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `FellowshipReferenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `FellowshipReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`)
/// Storage: `FellowshipReferenda::MetadataOf` (r:1 w:1)
/// Proof: `FellowshipReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn clear_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `319`
// Estimated: `4365`
// Minimum execution time: 18_458_000 picoseconds.
Weight::from_parts(19_097_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,522 @@
// Copyright (C) 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: 2023-07-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-xerhrdyb-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_referenda
// --chain=rococo-dev
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `Referenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:0 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
fn submit() -> Weight {
// Proof Size summary in bytes:
// Measured: `324`
// Estimated: `42428`
// Minimum execution time: 39_852_000 picoseconds.
Weight::from_parts(41_610_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `577`
// Estimated: `83866`
// Minimum execution time: 52_588_000 picoseconds.
Weight::from_parts(54_154_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:0)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3334`
// Estimated: `42428`
// Minimum execution time: 70_483_000 picoseconds.
Weight::from_parts(72_731_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:0)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3354`
// Estimated: `42428`
// Minimum execution time: 68_099_000 picoseconds.
Weight::from_parts(71_560_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:1)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `577`
// Estimated: `83866`
// Minimum execution time: 64_357_000 picoseconds.
Weight::from_parts(66_081_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:1)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn place_decision_deposit_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `577`
// Estimated: `83866`
// Minimum execution time: 62_709_000 picoseconds.
Weight::from_parts(64_534_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
fn refund_decision_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `417`
// Estimated: `4401`
// Minimum execution time: 31_296_000 picoseconds.
Weight::from_parts(32_221_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
fn refund_submission_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `407`
// Estimated: `4401`
// Minimum execution time: 31_209_000 picoseconds.
Weight::from_parts(32_168_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `485`
// Estimated: `83866`
// Minimum execution time: 38_887_000 picoseconds.
Weight::from_parts(40_193_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `Referenda::MetadataOf` (r:1 w:0)
/// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `726`
// Estimated: `83866`
// Minimum execution time: 106_054_000 picoseconds.
Weight::from_parts(108_318_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::TrackQueue` (r:1 w:0)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:1)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
fn one_fewer_deciding_queue_empty() -> Weight {
// Proof Size summary in bytes:
// Measured: `240`
// Estimated: `5477`
// Minimum execution time: 9_263_000 picoseconds.
Weight::from_parts(9_763_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn one_fewer_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `3254`
// Estimated: `42428`
// Minimum execution time: 50_080_000 picoseconds.
Weight::from_parts(51_858_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn one_fewer_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `3254`
// Estimated: `42428`
// Minimum execution time: 53_889_000 picoseconds.
Weight::from_parts(55_959_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
fn nudge_referendum_requeued_insertion() -> Weight {
// Proof Size summary in bytes:
// Measured: `3077`
// Estimated: `5477`
// Minimum execution time: 23_266_000 picoseconds.
Weight::from_parts(24_624_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
fn nudge_referendum_requeued_slide() -> Weight {
// Proof Size summary in bytes:
// Measured: `3077`
// Estimated: `5477`
// Minimum execution time: 22_846_000 picoseconds.
Weight::from_parts(24_793_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:0)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
fn nudge_referendum_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3081`
// Estimated: `5477`
// Minimum execution time: 28_284_000 picoseconds.
Weight::from_parts(29_940_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:0)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Referenda::TrackQueue` (r:1 w:1)
/// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`)
fn nudge_referendum_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3101`
// Estimated: `5477`
// Minimum execution time: 28_133_000 picoseconds.
Weight::from_parts(29_638_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_no_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `437`
// Estimated: `42428`
// Minimum execution time: 25_710_000 picoseconds.
Weight::from_parts(26_500_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `485`
// Estimated: `42428`
// Minimum execution time: 25_935_000 picoseconds.
Weight::from_parts(26_803_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
fn nudge_referendum_timed_out() -> Weight {
// Proof Size summary in bytes:
// Measured: `344`
// Estimated: `4401`
// Minimum execution time: 17_390_000 picoseconds.
Weight::from_parts(18_042_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:1)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `485`
// Estimated: `42428`
// Minimum execution time: 35_141_000 picoseconds.
Weight::from_parts(36_318_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::DecidingCount` (r:1 w:1)
/// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `485`
// Estimated: `42428`
// Minimum execution time: 37_815_000 picoseconds.
Weight::from_parts(39_243_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_begin_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `538`
// Estimated: `42428`
// Minimum execution time: 30_779_000 picoseconds.
Weight::from_parts(31_845_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_end_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `521`
// Estimated: `42428`
// Minimum execution time: 31_908_000 picoseconds.
Weight::from_parts(33_253_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_continue_not_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `538`
// Estimated: `42428`
// Minimum execution time: 28_951_000 picoseconds.
Weight::from_parts(30_004_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_continue_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `542`
// Estimated: `42428`
// Minimum execution time: 27_750_000 picoseconds.
Weight::from_parts(28_588_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Lookup` (r:1 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
fn nudge_referendum_approved() -> Weight {
// Proof Size summary in bytes:
// Measured: `542`
// Estimated: `83866`
// Minimum execution time: 43_950_000 picoseconds.
Weight::from_parts(46_164_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:0)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn nudge_referendum_rejected() -> Weight {
// Proof Size summary in bytes:
// Measured: `538`
// Estimated: `42428`
// Minimum execution time: 31_050_000 picoseconds.
Weight::from_parts(32_169_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Referenda::MetadataOf` (r:0 w:1)
/// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn set_some_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `560`
// Estimated: `4401`
// Minimum execution time: 21_193_000 picoseconds.
Weight::from_parts(22_116_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Referenda::MetadataOf` (r:1 w:1)
/// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn clear_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `421`
// Estimated: `4401`
// Minimum execution time: 18_065_000 picoseconds.
Weight::from_parts(18_781_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -1,161 +0,0 @@
// Copyright (C) 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_tips`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=rococo-dev
// --steps=50
// --repeat=20
// --pallet=pallet_tips
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_tips`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_tips::WeightInfo for WeightInfo<T> {
/// Storage: Tips Reasons (r:1 w:1)
/// Proof Skipped: Tips Reasons (max_values: None, max_size: None, mode: Measured)
/// Storage: Tips Tips (r:1 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// The range of component `r` is `[0, 16384]`.
fn report_awesome(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `3469`
// Minimum execution time: 27_741_000 picoseconds.
Weight::from_parts(28_495_173, 0)
.saturating_add(Weight::from_parts(0, 3469))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_433, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Tips Tips (r:1 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// Storage: Tips Reasons (r:0 w:1)
/// Proof Skipped: Tips Reasons (max_values: None, max_size: None, mode: Measured)
fn retract_tip() -> Weight {
// Proof Size summary in bytes:
// Measured: `221`
// Estimated: `3686`
// Minimum execution time: 27_275_000 picoseconds.
Weight::from_parts(27_649_000, 0)
.saturating_add(Weight::from_parts(0, 3686))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Tips Reasons (r:1 w:1)
/// Proof Skipped: Tips Reasons (max_values: None, max_size: None, mode: Measured)
/// Storage: Tips Tips (r:0 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// The range of component `r` is `[0, 16384]`.
/// The range of component `t` is `[1, 19]`.
fn tip_new(r: u32, t: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `74 + t * (64 ±0)`
// Estimated: `3539 + t * (64 ±0)`
// Minimum execution time: 19_809_000 picoseconds.
Weight::from_parts(18_182_607, 0)
.saturating_add(Weight::from_parts(0, 3539))
// Standard Error: 5
.saturating_add(Weight::from_parts(1_303, 0).saturating_mul(r.into()))
// Standard Error: 5_156
.saturating_add(Weight::from_parts(151_789, 0).saturating_mul(t.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 64).saturating_mul(t.into()))
}
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Tips Tips (r:1 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// The range of component `t` is `[1, 19]`.
fn tip(t: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `295 + t * (112 ±0)`
// Estimated: `3760 + t * (112 ±0)`
// Minimum execution time: 15_528_000 picoseconds.
Weight::from_parts(15_717_755, 0)
.saturating_add(Weight::from_parts(0, 3760))
// Standard Error: 6_569
.saturating_add(Weight::from_parts(146_426, 0).saturating_mul(t.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 112).saturating_mul(t.into()))
}
/// Storage: Tips Tips (r:1 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// Storage: PhragmenElection Members (r:1 w:0)
/// Proof Skipped: PhragmenElection Members (max_values: Some(1), 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: Tips Reasons (r:0 w:1)
/// Proof Skipped: Tips Reasons (max_values: None, max_size: None, mode: Measured)
/// The range of component `t` is `[1, 19]`.
fn close_tip(t: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `334 + t * (112 ±0)`
// Estimated: `3790 + t * (112 ±0)`
// Minimum execution time: 58_304_000 picoseconds.
Weight::from_parts(60_138_785, 0)
.saturating_add(Weight::from_parts(0, 3790))
// Standard Error: 7_636
.saturating_add(Weight::from_parts(86_665, 0).saturating_mul(t.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 112).saturating_mul(t.into()))
}
/// Storage: Tips Tips (r:1 w:1)
/// Proof Skipped: Tips Tips (max_values: None, max_size: None, mode: Measured)
/// Storage: Tips Reasons (r:0 w:1)
/// Proof Skipped: Tips Reasons (max_values: None, max_size: None, mode: Measured)
/// The range of component `t` is `[1, 19]`.
fn slash_tip(t: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `269`
// Estimated: `3734`
// Minimum execution time: 15_097_000 picoseconds.
Weight::from_parts(15_497_872, 0)
.saturating_add(Weight::from_parts(0, 3734))
// Standard Error: 785
.saturating_add(Weight::from_parts(18_377, 0).saturating_mul(t.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
}
@@ -0,0 +1,116 @@
// Copyright (C) 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: 2023-08-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-aahe6cbd-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_whitelist
// --chain=rococo-dev
// --header=./file_header.txt
// --output=./runtime/rococo/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn whitelist_call() -> Weight {
// Proof Size summary in bytes:
// Measured: `223`
// Estimated: `3556`
// Minimum execution time: 20_035_000 picoseconds.
Weight::from_parts(20_452_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn remove_whitelisted_call() -> Weight {
// Proof Size summary in bytes:
// Measured: `352`
// Estimated: `3556`
// Minimum execution time: 20_247_000 picoseconds.
Weight::from_parts(20_808_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 4194294]`.
fn dispatch_whitelisted_call(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `428 + n * (1 ±0)`
// Estimated: `3892 + n * (1 ±0)`
// Minimum execution time: 32_633_000 picoseconds.
Weight::from_parts(32_855_000, 0)
.saturating_add(Weight::from_parts(0, 3892))
// Standard Error: 1
.saturating_add(Weight::from_parts(1_223, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 10000]`.
fn dispatch_whitelisted_call_with_preimage(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `352`
// Estimated: `3556`
// Minimum execution time: 23_833_000 picoseconds.
Weight::from_parts(24_698_994, 0)
.saturating_add(Weight::from_parts(0, 3556))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_454, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}
+41 -9
View File
@@ -17,9 +17,12 @@
//! XCM configuration for Rococo.
use super::{
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Dmp, ParaId, Runtime,
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Dmp, Fellows, ParaId, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmPallet,
};
use crate::governance::StakingAdmin;
use frame_support::{
match_types, parameter_types,
traits::{Everything, Nothing},
@@ -38,9 +41,9 @@ use xcm_builder::{
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, DescribeBodyTerminal,
DescribeFamily, FixedWeightBounds, HashedDescription, IsChildSystemParachain, IsConcrete,
MintLocation, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
WithUniqueTopic,
MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
};
use xcm_executor::XcmExecutor;
@@ -110,7 +113,7 @@ pub type XcmRouter = WithUniqueTopic<(
parameter_types! {
pub const Roc: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const Rockmine: MultiLocation = Parachain(1000).into_location();
pub const AssetHub: MultiLocation = Parachain(1000).into_location();
pub const Contracts: MultiLocation = Parachain(1002).into_location();
pub const Encointer: MultiLocation = Parachain(1003).into_location();
pub const Tick: MultiLocation = Parachain(100).into_location();
@@ -119,7 +122,7 @@ parameter_types! {
pub const RocForTick: (MultiAssetFilter, MultiLocation) = (Roc::get(), Tick::get());
pub const RocForTrick: (MultiAssetFilter, MultiLocation) = (Roc::get(), Trick::get());
pub const RocForTrack: (MultiAssetFilter, MultiLocation) = (Roc::get(), Track::get());
pub const RocForRockmine: (MultiAssetFilter, MultiLocation) = (Roc::get(), Rockmine::get());
pub const RocForAssetHub: (MultiAssetFilter, MultiLocation) = (Roc::get(), AssetHub::get());
pub const RocForContracts: (MultiAssetFilter, MultiLocation) = (Roc::get(), Contracts::get());
pub const RocForEncointer: (MultiAssetFilter, MultiLocation) = (Roc::get(), Encointer::get());
pub const MaxInstructions: u32 = 100;
@@ -129,7 +132,7 @@ pub type TrustedTeleporters = (
xcm_builder::Case<RocForTick>,
xcm_builder::Case<RocForTrick>,
xcm_builder::Case<RocForTrack>,
xcm_builder::Case<RocForRockmine>,
xcm_builder::Case<RocForAssetHub>,
xcm_builder::Case<RocForContracts>,
xcm_builder::Case<RocForEncointer>,
);
@@ -193,6 +196,14 @@ impl xcm_executor::Config for XcmConfig {
type Aliasers = Nothing;
}
parameter_types! {
pub const CollectiveBodyId: BodyId = BodyId::Unit;
// StakingAdmin pluralistic body.
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
// Fellows pluralistic body.
pub const FellowsBodyId: BodyId = BodyId::Technical;
}
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parachain(1000).into());
@@ -201,12 +212,33 @@ parameter_types! {
/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior
/// location of this chain.
pub type LocalOriginToLocation = (
// A usual Signed origin to be used in XCM as a corresponding AccountId32
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>,
);
/// Type to convert the `StakingAdmin` origin to a Plurality `MultiLocation` value.
pub type StakingAdminToPlurality =
OriginToPluralityVoice<RuntimeOrigin, StakingAdmin, StakingAdminBodyId>;
/// Type to convert the Fellows origin to a Plurality `MultiLocation` value.
pub type FellowsToPlurality = OriginToPluralityVoice<RuntimeOrigin, Fellows, FellowsBodyId>;
/// Type to convert a pallet `Origin` type value into a `MultiLocation` value which represents an
/// interior location of this chain for a destination chain.
pub type LocalPalletOriginToLocation = (
// StakingAdmin origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
StakingAdminToPlurality,
// Fellows origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
FellowsToPlurality,
);
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// We only allow the root, fellows and the staking admin to send messages.
// This is basically safe to enable for everyone (safe the possibility of someone spamming the
// parachain if they're willing to pay the KSM to send from the Relay-chain), but it's useless
// until we bring in XCM v3 which will make `DescendOrigin` a bit more useful.
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
+14
View File
@@ -24,6 +24,7 @@ inherents = { package = "sp-inherents", path = "../../../substrate/primitives/in
offchain-primitives = { package = "sp-offchain", path = "../../../substrate/primitives/offchain", default-features = false }
sp-api = { path = "../../../substrate/primitives/api", default-features = false }
sp-application-crypto = { path = "../../../substrate/primitives/application-crypto", default-features = false }
sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false }
sp-std = { package = "sp-std", path = "../../../substrate/primitives/std", default-features = false }
sp-genesis-builder = { path = "../../../substrate/primitives/genesis-builder", default-features = false }
sp-io = { path = "../../../substrate/primitives/io", default-features = false }
@@ -65,10 +66,12 @@ pallet-message-queue = { path = "../../../substrate/frame/message-queue", defaul
pallet-mmr = { path = "../../../substrate/frame/merkle-mountain-range", default-features = false }
pallet-multisig = { path = "../../../substrate/frame/multisig", default-features = false }
pallet-nomination-pools = { path = "../../../substrate/frame/nomination-pools", default-features = false }
pallet-conviction-voting = { path = "../../../substrate/frame/conviction-voting", default-features = false }
pallet-offences = { path = "../../../substrate/frame/offences", default-features = false }
pallet-preimage = { path = "../../../substrate/frame/preimage", default-features = false }
pallet-proxy = { path = "../../../substrate/frame/proxy", default-features = false }
pallet-recovery = { path = "../../../substrate/frame/recovery", default-features = false }
pallet-referenda = { path = "../../../substrate/frame/referenda", default-features = false }
pallet-scheduler = { path = "../../../substrate/frame/scheduler", default-features = false }
pallet-session = { path = "../../../substrate/frame/session", default-features = false }
pallet-society = { path = "../../../substrate/frame/society", default-features = false }
@@ -84,6 +87,7 @@ pallet-nomination-pools-runtime-api = { path = "../../../substrate/frame/nominat
pallet-treasury = { path = "../../../substrate/frame/treasury", default-features = false }
pallet-utility = { path = "../../../substrate/frame/utility", default-features = false }
pallet-vesting = { path = "../../../substrate/frame/vesting", default-features = false }
pallet-whitelist = { path = "../../../substrate/frame/whitelist", default-features = false }
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
@@ -147,6 +151,7 @@ std = [
"pallet-beefy-mmr/std",
"pallet-beefy/std",
"pallet-collective/std",
"pallet-conviction-voting/std",
"pallet-democracy/std",
"pallet-election-provider-multi-phase/std",
"pallet-election-provider-support-benchmarking?/std",
@@ -168,6 +173,7 @@ std = [
"pallet-preimage/std",
"pallet-proxy/std",
"pallet-recovery/std",
"pallet-referenda/std",
"pallet-scheduler/std",
"pallet-session-benchmarking?/std",
"pallet-session/std",
@@ -182,6 +188,7 @@ std = [
"pallet-treasury/std",
"pallet-utility/std",
"pallet-vesting/std",
"pallet-whitelist/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm/std",
"parity-scale-codec/std",
@@ -195,6 +202,7 @@ std = [
"serde_derive",
"sp-api/std",
"sp-application-crypto/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-io/std",
@@ -224,6 +232,7 @@ runtime-benchmarks = [
"pallet-bags-list/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
@@ -244,6 +253,7 @@ runtime-benchmarks = [
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-recovery/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-session-benchmarking/runtime-benchmarks",
"pallet-society/runtime-benchmarks",
@@ -254,6 +264,7 @@ runtime-benchmarks = [
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
@@ -280,6 +291,7 @@ try-runtime = [
"pallet-beefy-mmr/try-runtime",
"pallet-beefy/try-runtime",
"pallet-collective/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-democracy/try-runtime",
"pallet-election-provider-multi-phase/try-runtime",
"pallet-elections-phragmen/try-runtime",
@@ -297,6 +309,7 @@ try-runtime = [
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
"pallet-recovery/try-runtime",
"pallet-referenda/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-session/try-runtime",
"pallet-society/try-runtime",
@@ -308,6 +321,7 @@ try-runtime = [
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-whitelist/try-runtime",
"pallet-xcm/try-runtime",
"runtime-common/try-runtime",
"runtime-parachains/try-runtime",
@@ -96,6 +96,26 @@ pub mod fee {
}
}
/// XCM protocol related constants.
pub mod xcm {
/// Pluralistic bodies existing within the consensus.
pub mod body {
// Preallocated for the Root body.
#[allow(dead_code)]
const ROOT_INDEX: u32 = 0;
// The bodies corresponding to the Polkadot OpenGov Origins.
pub const FELLOWSHIP_ADMIN_INDEX: u32 = 1;
}
}
/// System Parachains.
pub mod system_parachain {
/// Statemint parachain ID.
pub const ASSET_HUB_ID: u32 = 1000;
/// Collectives parachain ID.
pub const COLLECTIVES_ID: u32 = 1001;
}
#[cfg(test)]
mod tests {
use super::{
@@ -0,0 +1,97 @@
// Copyright (C) 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/>.
//! New governance configurations for the Kusama runtime.
use super::*;
use crate::xcm_config::Collectives;
use frame_support::{parameter_types, traits::EitherOf};
use frame_system::EnsureRootWithSuccess;
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use xcm::latest::BodyId;
mod origins;
pub use origins::{
pallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin,
ReferendumCanceller, ReferendumKiller, Spender, StakingAdmin, Treasurer, WhitelistedCaller,
};
mod tracks;
pub use tracks::TracksInfo;
parameter_types! {
pub const VoteLockingPeriod: BlockNumber = 7 * DAYS;
}
impl pallet_conviction_voting::Config for Runtime {
type WeightInfo = weights::pallet_conviction_voting::WeightInfo<Self>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type VoteLockingPeriod = VoteLockingPeriod;
type MaxVotes = ConstU32<512>;
type MaxTurnout =
frame_support::traits::tokens::currency::ActiveIssuanceOf<Balances, Self::AccountId>;
type Polls = Referenda;
}
parameter_types! {
pub const AlarmInterval: BlockNumber = 1;
pub const SubmissionDeposit: Balance = 1 * 3 * CENTS;
pub const UndecidingTimeout: BlockNumber = 14 * DAYS;
}
parameter_types! {
pub const MaxBalance: Balance = Balance::max_value();
}
pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;
impl origins::pallet_custom_origins::Config for Runtime {}
parameter_types! {
// Fellows pluralistic body.
pub const FellowsBodyId: BodyId = BodyId::Technical;
}
impl pallet_whitelist::Config for Runtime {
type WeightInfo = weights::pallet_whitelist::WeightInfo<Self>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WhitelistOrigin = EitherOfDiverse<
EnsureRoot<Self::AccountId>,
EnsureXcm<IsVoiceOfBody<Collectives, FellowsBodyId>>,
>;
type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
type Preimages = Preimage;
}
impl pallet_referenda::Config for Runtime {
type WeightInfo = weights::pallet_referenda_referenda::WeightInfo<Self>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Scheduler = Scheduler;
type Currency = Balances;
type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
type CancelOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumCanceller>;
type KillOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumKiller>;
type Slash = Treasury;
type Votes = pallet_conviction_voting::VotesOf<Runtime>;
type Tally = pallet_conviction_voting::TallyOf<Runtime>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}
@@ -0,0 +1,194 @@
// Copyright (C) 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/>.
//! Custom origins for governance interventions.
pub use pallet_custom_origins::*;
#[frame_support::pallet]
pub mod pallet_custom_origins {
use crate::{Balance, CENTS, GRAND};
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)]
#[pallet::origin]
pub enum Origin {
/// Origin for cancelling slashes.
StakingAdmin,
/// Origin for spending (any amount of) funds.
Treasurer,
/// Origin for managing the composition of the fellowship.
FellowshipAdmin,
/// Origin for managing the registrar.
GeneralAdmin,
/// Origin for starting auctions.
AuctionAdmin,
/// Origin able to force slot leases.
LeaseAdmin,
/// Origin able to cancel referenda.
ReferendumCanceller,
/// Origin able to kill referenda.
ReferendumKiller,
/// Origin able to spend up to 1 KSM from the treasury at once.
SmallTipper,
/// Origin able to spend up to 5 KSM from the treasury at once.
BigTipper,
/// Origin able to spend up to 50 KSM from the treasury at once.
SmallSpender,
/// Origin able to spend up to 500 KSM from the treasury at once.
MediumSpender,
/// Origin able to spend up to 5,000 KSM from the treasury at once.
BigSpender,
/// Origin able to dispatch a whitelisted call.
WhitelistedCaller,
/// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed).
FellowshipInitiates,
/// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater).
Fellows,
/// Origin commanded by Polkadot Experts (5th Dan fellows or greater).
FellowshipExperts,
/// Origin commanded by Polkadot Masters (7th Dan fellows of greater).
FellowshipMasters,
/// Origin commanded by rank 1 of the Polkadot Fellowship and with a success of 1.
Fellowship1Dan,
/// Origin commanded by rank 2 of the Polkadot Fellowship and with a success of 2.
Fellowship2Dan,
/// Origin commanded by rank 3 of the Polkadot Fellowship and with a success of 3.
Fellowship3Dan,
/// Origin commanded by rank 4 of the Polkadot Fellowship and with a success of 4.
Fellowship4Dan,
/// Origin commanded by rank 5 of the Polkadot Fellowship and with a success of 5.
Fellowship5Dan,
/// Origin commanded by rank 6 of the Polkadot Fellowship and with a success of 6.
Fellowship6Dan,
/// Origin commanded by rank 7 of the Polkadot Fellowship and with a success of 7.
Fellowship7Dan,
/// Origin commanded by rank 8 of the Polkadot Fellowship and with a success of 8.
Fellowship8Dan,
/// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9.
Fellowship9Dan,
}
macro_rules! decl_unit_ensures {
( $name:ident: $success_type:ty = $success:expr ) => {
pub struct $name;
impl<O: Into<Result<Origin, O>> + From<Origin>>
EnsureOrigin<O> for $name
{
type Success = $success_type;
fn try_origin(o: O) -> Result<Self::Success, O> {
o.into().and_then(|o| match o {
Origin::$name => Ok($success),
r => Err(O::from(r)),
})
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<O, ()> {
Ok(O::from(Origin::$name))
}
}
};
( $name:ident ) => { decl_unit_ensures! { $name : () = () } };
( $name:ident: $success_type:ty = $success:expr, $( $rest:tt )* ) => {
decl_unit_ensures! { $name: $success_type = $success }
decl_unit_ensures! { $( $rest )* }
};
( $name:ident, $( $rest:tt )* ) => {
decl_unit_ensures! { $name }
decl_unit_ensures! { $( $rest )* }
};
() => {}
}
decl_unit_ensures!(
StakingAdmin,
Treasurer,
FellowshipAdmin,
GeneralAdmin,
AuctionAdmin,
LeaseAdmin,
ReferendumCanceller,
ReferendumKiller,
WhitelistedCaller,
FellowshipInitiates: u16 = 0,
Fellows: u16 = 3,
FellowshipExperts: u16 = 5,
FellowshipMasters: u16 = 7,
);
macro_rules! decl_ensure {
(
$vis:vis type $name:ident: EnsureOrigin<Success = $success_type:ty> {
$( $item:ident = $success:expr, )*
}
) => {
$vis struct $name;
impl<O: Into<Result<Origin, O>> + From<Origin>>
EnsureOrigin<O> for $name
{
type Success = $success_type;
fn try_origin(o: O) -> Result<Self::Success, O> {
o.into().and_then(|o| match o {
$(
Origin::$item => Ok($success),
)*
r => Err(O::from(r)),
})
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<O, ()> {
// By convention the more privileged origins go later, so for greatest chance
// of success, we want the last one.
let _result: Result<O, ()> = Err(());
$(
let _result: Result<O, ()> = Ok(O::from(Origin::$item));
)*
_result
}
}
}
}
decl_ensure! {
pub type Spender: EnsureOrigin<Success = Balance> {
SmallTipper = 250 * 3 * CENTS,
BigTipper = 1 * GRAND,
SmallSpender = 10 * GRAND,
MediumSpender = 100 * GRAND,
BigSpender = 1_000 * GRAND,
Treasurer = 10_000 * GRAND,
}
}
decl_ensure! {
pub type EnsureFellowship: EnsureOrigin<Success = u16> {
Fellowship1Dan = 1,
Fellowship2Dan = 2,
Fellowship3Dan = 3,
Fellowship4Dan = 4,
Fellowship5Dan = 5,
Fellowship6Dan = 6,
Fellowship7Dan = 7,
Fellowship8Dan = 8,
Fellowship9Dan = 9,
}
}
}
@@ -0,0 +1,320 @@
// Copyright (C) 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/>.
//! Track configurations for governance.
use super::*;
const fn percent(x: i32) -> sp_arithmetic::FixedI64 {
sp_arithmetic::FixedI64::from_rational(x as u128, 100)
}
use pallet_referenda::Curve;
const APP_ROOT: Curve = Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_ROOT: Curve = Curve::make_linear(28, 28, percent(0), percent(50));
const APP_STAKING_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_STAKING_ADMIN: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_TREASURER: Curve = Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_TREASURER: Curve = Curve::make_linear(28, 28, percent(0), percent(50));
const APP_FELLOWSHIP_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_FELLOWSHIP_ADMIN: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_GENERAL_ADMIN: Curve =
Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_GENERAL_ADMIN: Curve =
Curve::make_reciprocal(7, 28, percent(10), percent(0), percent(50));
const APP_AUCTION_ADMIN: Curve =
Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100));
const SUP_AUCTION_ADMIN: Curve =
Curve::make_reciprocal(7, 28, percent(10), percent(0), percent(50));
const APP_LEASE_ADMIN: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_LEASE_ADMIN: Curve = Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_REFERENDUM_CANCELLER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_REFERENDUM_CANCELLER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_REFERENDUM_KILLER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_REFERENDUM_KILLER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_SMALL_TIPPER: Curve = Curve::make_linear(10, 28, percent(50), percent(100));
const SUP_SMALL_TIPPER: Curve = Curve::make_reciprocal(1, 28, percent(4), percent(0), percent(50));
const APP_BIG_TIPPER: Curve = Curve::make_linear(10, 28, percent(50), percent(100));
const SUP_BIG_TIPPER: Curve = Curve::make_reciprocal(8, 28, percent(1), percent(0), percent(50));
const APP_SMALL_SPENDER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
const SUP_SMALL_SPENDER: Curve =
Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50));
const APP_MEDIUM_SPENDER: Curve = Curve::make_linear(23, 28, percent(50), percent(100));
const SUP_MEDIUM_SPENDER: Curve =
Curve::make_reciprocal(16, 28, percent(1), percent(0), percent(50));
const APP_BIG_SPENDER: Curve = Curve::make_linear(28, 28, percent(50), percent(100));
const SUP_BIG_SPENDER: Curve = Curve::make_reciprocal(20, 28, percent(1), percent(0), percent(50));
const APP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(16, 28 * 24, percent(96), percent(50), percent(100));
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15] = [
(
0,
pallet_referenda::TrackInfo {
name: "root",
max_deciding: 1,
decision_deposit: 100 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_ROOT,
min_support: SUP_ROOT,
},
),
(
1,
pallet_referenda::TrackInfo {
name: "whitelisted_caller",
max_deciding: 100,
decision_deposit: 10 * GRAND,
prepare_period: 6 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
min_support: SUP_WHITELISTED_CALLER,
},
),
(
10,
pallet_referenda::TrackInfo {
name: "staking_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_STAKING_ADMIN,
min_support: SUP_STAKING_ADMIN,
},
),
(
11,
pallet_referenda::TrackInfo {
name: "treasurer",
max_deciding: 10,
decision_deposit: 1 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_TREASURER,
min_support: SUP_TREASURER,
},
),
(
12,
pallet_referenda::TrackInfo {
name: "lease_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_LEASE_ADMIN,
min_support: SUP_LEASE_ADMIN,
},
),
(
13,
pallet_referenda::TrackInfo {
name: "fellowship_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_FELLOWSHIP_ADMIN,
min_support: SUP_FELLOWSHIP_ADMIN,
},
),
(
14,
pallet_referenda::TrackInfo {
name: "general_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_GENERAL_ADMIN,
min_support: SUP_GENERAL_ADMIN,
},
),
(
15,
pallet_referenda::TrackInfo {
name: "auction_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_AUCTION_ADMIN,
min_support: SUP_AUCTION_ADMIN,
},
),
(
20,
pallet_referenda::TrackInfo {
name: "referendum_canceller",
max_deciding: 1_000,
decision_deposit: 10 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
min_support: SUP_REFERENDUM_CANCELLER,
},
),
(
21,
pallet_referenda::TrackInfo {
name: "referendum_killer",
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 8 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 8 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
min_support: SUP_REFERENDUM_KILLER,
},
),
(
30,
pallet_referenda::TrackInfo {
name: "small_tipper",
max_deciding: 200,
decision_deposit: 1 * 3 * CENTS,
prepare_period: 1 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 4 * MINUTES,
min_enactment_period: 1 * MINUTES,
min_approval: APP_SMALL_TIPPER,
min_support: SUP_SMALL_TIPPER,
},
),
(
31,
pallet_referenda::TrackInfo {
name: "big_tipper",
max_deciding: 100,
decision_deposit: 10 * 3 * CENTS,
prepare_period: 4 * MINUTES,
decision_period: 14 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 3 * MINUTES,
min_approval: APP_BIG_TIPPER,
min_support: SUP_BIG_TIPPER,
},
),
(
32,
pallet_referenda::TrackInfo {
name: "small_spender",
max_deciding: 50,
decision_deposit: 100 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 10 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_SMALL_SPENDER,
min_support: SUP_SMALL_SPENDER,
},
),
(
33,
pallet_referenda::TrackInfo {
name: "medium_spender",
max_deciding: 50,
decision_deposit: 200 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 12 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_MEDIUM_SPENDER,
min_support: SUP_MEDIUM_SPENDER,
},
),
(
34,
pallet_referenda::TrackInfo {
name: "big_spender",
max_deciding: 50,
decision_deposit: 400 * 3 * CENTS,
prepare_period: 10 * MINUTES,
decision_period: 20 * MINUTES,
confirm_period: 14 * MINUTES,
min_enactment_period: 5 * MINUTES,
min_approval: APP_BIG_SPENDER,
min_support: SUP_BIG_SPENDER,
},
),
];
pub struct TracksInfo;
impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
type Id = u16;
type RuntimeOrigin = <RuntimeOrigin as frame_support::traits::OriginTrait>::PalletsOrigin;
fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo<Balance, BlockNumber>)] {
&TRACKS_DATA[..]
}
fn track_for(id: &Self::RuntimeOrigin) -> Result<Self::Id, ()> {
if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) {
match system_origin {
frame_system::RawOrigin::Root => Ok(0),
_ => Err(()),
}
} else if let Ok(custom_origin) = origins::Origin::try_from(id.clone()) {
match custom_origin {
origins::Origin::WhitelistedCaller => Ok(1),
// General admin
origins::Origin::StakingAdmin => Ok(10),
origins::Origin::Treasurer => Ok(11),
origins::Origin::LeaseAdmin => Ok(12),
origins::Origin::FellowshipAdmin => Ok(13),
origins::Origin::GeneralAdmin => Ok(14),
origins::Origin::AuctionAdmin => Ok(15),
// Referendum admins
origins::Origin::ReferendumCanceller => Ok(20),
origins::Origin::ReferendumKiller => Ok(21),
// Limited treasury spenders
origins::Origin::SmallTipper => Ok(30),
origins::Origin::BigTipper => Ok(31),
origins::Origin::SmallSpender => Ok(32),
origins::Origin::MediumSpender => Ok(33),
origins::Origin::BigSpender => Ok(34),
_ => Err(()),
}
} else {
Err(())
}
}
}
pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber);
+86 -21
View File
@@ -17,7 +17,7 @@
//! The Westend runtime. This can be compiled with `#[no_std]`, ready for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 512.
// `construct_runtime!` does a lot of recursion and requires us to increase the limit.
#![recursion_limit = "512"]
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
@@ -31,9 +31,9 @@ use frame_support::{
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
fungible::HoldConsideration, ConstU32, Contains, EverythingBut, InstanceFilter,
KeyOwnerProofSystem, LinearStoragePrice, ProcessMessage, ProcessMessageError,
WithdrawReasons,
fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, EverythingBut,
InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, ProcessMessage,
ProcessMessageError, WithdrawReasons,
},
weights::{ConstantMultiplier, WeightMeter},
PalletId,
@@ -80,7 +80,7 @@ use sp_runtime::{
Keccak256, OpaqueKeys, SaturatedConversion, Verify,
},
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent,
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill,
};
use sp_staking::SessionIndex;
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
@@ -107,6 +107,13 @@ mod bag_thresholds;
mod weights;
pub mod xcm_config;
// Governance and configurations.
pub mod governance;
use governance::{
pallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin, StakingAdmin,
Treasurer, TreasurySpender,
};
#[cfg(test)]
mod tests;
@@ -122,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 9430,
spec_version: 10020,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 22,
@@ -197,7 +204,9 @@ impl pallet_scheduler::Config for Runtime {
type PalletsOrigin = OriginCaller;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
// The goal of having ScheduleOrigin include AuctionAdmin is to allow the auctions track of
// OpenGov to schedule periodic auctions.
type ScheduleOrigin = EitherOf<EnsureRoot<AccountId>, AuctionAdmin>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
type OriginPrivilegeCmp = frame_support::traits::EqualPrivilegeOnly;
@@ -683,7 +692,40 @@ impl pallet_fast_unstake::Config for Runtime {
}
parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 2000 * CENTS;
pub const ProposalBondMaximum: Balance = 1 * GRAND;
pub const SpendPeriod: BlockNumber = 6 * DAYS;
pub const Burn: Permill = Permill::from_perthousand(2);
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 100 * CENTS;
pub const DataDepositPerByte: Balance = 1 * CENTS;
pub const MaxApprovals: u32 = 100;
pub const MaxAuthorities: u32 = 100_000;
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
}
impl pallet_treasury::Config for Runtime {
type PalletId = TreasuryPalletId;
type Currency = Balances;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type ProposalBondMaximum = ProposalBondMaximum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type BurnDestination = ();
type MaxApprovals = MaxApprovals;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
type SpendFunds = ();
type SpendOrigin = TreasurySpender;
}
impl pallet_offences::Config for Runtime {
@@ -699,8 +741,6 @@ impl pallet_authority_discovery::Config for Runtime {
parameter_types! {
pub const NposSolutionPriority: TransactionPriority = TransactionPriority::max_value() / 2;
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
}
impl pallet_im_online::Config for Runtime {
@@ -814,8 +854,8 @@ impl pallet_identity::Config for Runtime {
type MaxSubAccounts = MaxSubAccounts;
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type RegistrarOrigin = frame_system::EnsureRoot<AccountId>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}
@@ -912,6 +952,7 @@ parameter_types! {
pub enum ProxyType {
Any,
NonTransfer,
Governance,
Staking,
SudoBalances,
IdentityJudgement,
@@ -944,6 +985,9 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::ImOnline(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Identity(..) |
RuntimeCall::ConvictionVoting(..) |
RuntimeCall::Referenda(..) |
RuntimeCall::Whitelist(..) |
RuntimeCall::Recovery(pallet_recovery::Call::as_recovered{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::vouch_recovery{..}) |
RuntimeCall::Recovery(pallet_recovery::Call::claim_recovery{..}) |
@@ -989,6 +1033,13 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Utility(..) => true,
_ => false,
},
ProxyType::Governance => matches!(
c,
// OpenGov calls
RuntimeCall::ConvictionVoting(..) |
RuntimeCall::Referenda(..) |
RuntimeCall::Whitelist(..)
),
ProxyType::IdentityJudgement => matches!(
c,
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
@@ -1184,7 +1235,7 @@ impl parachains_slashing::Config for Runtime {
parameter_types! {
pub const ParaDeposit: Balance = 2000 * CENTS;
pub const DataDepositPerByte: Balance = deposit(0, 1);
pub const RegistrarDataDepositPerByte: Balance = deposit(0, 1);
}
impl paras_registrar::Config for Runtime {
@@ -1193,7 +1244,7 @@ impl paras_registrar::Config for Runtime {
type Currency = Balances;
type OnSwap = (Crowdloan, Slots);
type ParaDeposit = ParaDeposit;
type DataDepositPerByte = DataDepositPerByte;
type DataDepositPerByte = RegistrarDataDepositPerByte;
type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo<Runtime>;
}
@@ -1207,7 +1258,7 @@ impl slots::Config for Runtime {
type Registrar = Registrar;
type LeasePeriod = LeasePeriod;
type LeaseOffset = ();
type ForceOrigin = EnsureRoot<AccountId>;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, LeaseAdmin>;
type WeightInfo = weights::runtime_common_slots::WeightInfo<Runtime>;
}
@@ -1247,7 +1298,7 @@ impl auctions::Config for Runtime {
type EndingPeriod = EndingPeriod;
type SampleLength = SampleLength;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type InitiateOrigin = EnsureRoot<AccountId>;
type InitiateOrigin = EitherOf<EnsureRoot<Self::AccountId>, AuctionAdmin>;
type WeightInfo = weights::runtime_common_auctions::WeightInfo<Runtime>;
}
@@ -1352,6 +1403,15 @@ construct_runtime! {
// Fast unstake pallet: extension to staking.
FastUnstake: pallet_fast_unstake = 30,
// OpenGov
ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event<T>} = 31,
Referenda: pallet_referenda::{Pallet, Call, Storage, Event<T>} = 32,
Origins: pallet_custom_origins::{Origin} = 35,
Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event<T>} = 36,
// Treasury
Treasury: pallet_treasury::{Pallet, Call, Storage, Config<T>, Event<T>} = 37,
// Parachains pallets. Start indices at 40 to leave room.
ParachainsOrigin: parachains_origin::{Pallet, Origin} = 41,
Configuration: parachains_configuration::{Pallet, Call, Storage, Config<T>} = 42,
@@ -1445,6 +1505,7 @@ pub mod migrations {
UpgradeSessionKeys,
parachains_configuration::migration::v9::MigrateToV9<Runtime>,
paras_registrar::migration::VersionCheckedMigrateToV1<Runtime, ()>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, ()>,
);
}
@@ -1485,6 +1546,7 @@ mod benches {
// Substrate
[pallet_bags_list, VoterList]
[pallet_balances, Balances]
[pallet_conviction_voting, ConvictionVoting]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_fast_unstake, FastUnstake]
@@ -1498,14 +1560,17 @@ mod benches {
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_recovery, Recovery]
[pallet_referenda, Referenda]
[pallet_scheduler, Scheduler]
[pallet_session, SessionBench::<Runtime>]
[pallet_staking, Staking]
[pallet_sudo, Sudo]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_treasury, Treasury]
[pallet_utility, Utility]
[pallet_vesting, Vesting]
[pallet_whitelist, Whitelist]
// XCM
[pallet_xcm, XcmPallet]
// NOTE: Make sure you point to the individual modules below.
@@ -2059,13 +2124,13 @@ sp_api::impl_runtime_apis! {
AssetId::*, Fungibility::*, InteriorMultiLocation, Junction, Junctions::*,
MultiAsset, MultiAssets, MultiLocation, NetworkId, Response,
};
use xcm_config::{Westmint, TokenLocation};
use xcm_config::{AssetHub, TokenLocation};
impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = xcm_config::XcmConfig;
type AccountIdConverter = xcm_config::LocationConverter;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(Westmint::get())
Ok(AssetHub::get())
}
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
// Westend only knows about WND.
@@ -2078,7 +2143,7 @@ sp_api::impl_runtime_apis! {
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Westmint::get(),
AssetHub::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(TokenLocation::get()) },
));
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
@@ -2117,15 +2182,15 @@ sp_api::impl_runtime_apis! {
}
fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((Westmint::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((AssetHub::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}
fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(Westmint::get())
Ok(AssetHub::get())
}
fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = Westmint::get();
let origin = AssetHub::get();
let assets: MultiAssets = (Concrete(TokenLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
@@ -19,6 +19,7 @@ pub mod frame_election_provider_support;
pub mod frame_system;
pub mod pallet_bags_list;
pub mod pallet_balances;
pub mod pallet_conviction_voting;
pub mod pallet_election_provider_multi_phase;
pub mod pallet_fast_unstake;
pub mod pallet_identity;
@@ -29,13 +30,17 @@ pub mod pallet_multisig;
pub mod pallet_nomination_pools;
pub mod pallet_preimage;
pub mod pallet_proxy;
pub mod pallet_referenda_fellowship_referenda;
pub mod pallet_referenda_referenda;
pub mod pallet_scheduler;
pub mod pallet_session;
pub mod pallet_staking;
pub mod pallet_sudo;
pub mod pallet_timestamp;
pub mod pallet_treasury;
pub mod pallet_utility;
pub mod pallet_vesting;
pub mod pallet_whitelist;
pub mod pallet_xcm;
pub mod runtime_common_assigned_slots;
pub mod runtime_common_auctions;
@@ -0,0 +1,194 @@
// Copyright (C) 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: 2023-07-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-xerhrdyb-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_conviction_voting
// --chain=westend-dev
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13445`
// Estimated: `42428`
// Minimum execution time: 152_223_000 picoseconds.
Weight::from_parts(162_148_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `14166`
// Estimated: `83866`
// Minimum execution time: 220_361_000 picoseconds.
Weight::from_parts(236_478_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `13918`
// Estimated: `83866`
// Minimum execution time: 198_787_000 picoseconds.
Weight::from_parts(204_983_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `13004`
// Estimated: `30706`
// Minimum execution time: 88_469_000 picoseconds.
Weight::from_parts(95_942_000, 0)
.saturating_add(Weight::from_parts(0, 30706))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 512]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `29640 + r * (365 ±0)`
// Estimated: `83866 + r * (3411 ±0)`
// Minimum execution time: 79_951_000 picoseconds.
Weight::from_parts(1_844_983_097, 0)
.saturating_add(Weight::from_parts(0, 83866))
// Standard Error: 160_158
.saturating_add(Weight::from_parts(43_973_863, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(6))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
}
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 512]`.
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `29555 + r * (365 ±0)`
// Estimated: `83866 + r * (3411 ±0)`
// Minimum execution time: 47_976_000 picoseconds.
Weight::from_parts(1_877_857_335, 0)
.saturating_add(Weight::from_parts(0, 83866))
// Standard Error: 168_477
.saturating_add(Weight::from_parts(43_303_902, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into()))
}
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `12218`
// Estimated: `30706`
// Minimum execution time: 102_868_000 picoseconds.
Weight::from_parts(110_438_000, 0)
.saturating_add(Weight::from_parts(0, 30706))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -0,0 +1,525 @@
// Copyright (C) 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: 2023-06-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-e8ezs4ez-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --pallet=pallet_referenda
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: FellowshipCollective Members (max_values: None, max_size: Some(42), added: 2517, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda ReferendumCount (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda ReferendumInfoFor (r:0 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
fn submit() -> Weight {
// Proof Size summary in bytes:
// Measured: `327`
// Estimated: `42428`
// Minimum execution time: 28_969_000 picoseconds.
Weight::from_parts(30_902_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `404`
// Estimated: `83866`
// Minimum execution time: 53_500_000 picoseconds.
Weight::from_parts(54_447_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2042`
// Estimated: `42428`
// Minimum execution time: 114_321_000 picoseconds.
Weight::from_parts(122_607_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2083`
// Estimated: `42428`
// Minimum execution time: 113_476_000 picoseconds.
Weight::from_parts(120_078_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `774`
// Estimated: `83866`
// Minimum execution time: 194_798_000 picoseconds.
Weight::from_parts(208_378_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `639`
// Estimated: `83866`
// Minimum execution time: 69_502_000 picoseconds.
Weight::from_parts(71_500_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
fn refund_decision_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `317`
// Estimated: `4365`
// Minimum execution time: 30_561_000 picoseconds.
Weight::from_parts(31_427_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
fn refund_submission_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `167`
// Estimated: `4365`
// Minimum execution time: 14_535_000 picoseconds.
Weight::from_parts(14_999_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `349`
// Estimated: `83866`
// Minimum execution time: 38_532_000 picoseconds.
Weight::from_parts(39_361_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda MetadataOf (r:1 w:0)
/// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `450`
// Estimated: `83866`
// Minimum execution time: 78_956_000 picoseconds.
Weight::from_parts(80_594_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda TrackQueue (r:1 w:0)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
fn one_fewer_deciding_queue_empty() -> Weight {
// Proof Size summary in bytes:
// Measured: `140`
// Estimated: `4277`
// Minimum execution time: 9_450_000 picoseconds.
Weight::from_parts(9_881_000, 0)
.saturating_add(Weight::from_parts(0, 4277))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn one_fewer_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `2376`
// Estimated: `42428`
// Minimum execution time: 98_126_000 picoseconds.
Weight::from_parts(102_511_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn one_fewer_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `2362`
// Estimated: `42428`
// Minimum execution time: 99_398_000 picoseconds.
Weight::from_parts(104_045_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
fn nudge_referendum_requeued_insertion() -> Weight {
// Proof Size summary in bytes:
// Measured: `1807`
// Estimated: `4365`
// Minimum execution time: 43_734_000 picoseconds.
Weight::from_parts(46_962_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
fn nudge_referendum_requeued_slide() -> Weight {
// Proof Size summary in bytes:
// Measured: `1774`
// Estimated: `4365`
// Minimum execution time: 42_863_000 picoseconds.
Weight::from_parts(46_241_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
fn nudge_referendum_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `1790`
// Estimated: `4365`
// Minimum execution time: 57_511_000 picoseconds.
Weight::from_parts(64_027_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:0)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda TrackQueue (r:1 w:1)
/// Proof: FellowshipReferenda TrackQueue (max_values: None, max_size: Some(812), added: 3287, mode: MaxEncodedLen)
fn nudge_referendum_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `1831`
// Estimated: `4365`
// Minimum execution time: 56_726_000 picoseconds.
Weight::from_parts(61_962_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_no_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `301`
// Estimated: `42428`
// Minimum execution time: 24_870_000 picoseconds.
Weight::from_parts(25_837_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `349`
// Estimated: `42428`
// Minimum execution time: 25_297_000 picoseconds.
Weight::from_parts(26_086_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
fn nudge_referendum_timed_out() -> Weight {
// Proof Size summary in bytes:
// Measured: `208`
// Estimated: `4365`
// Minimum execution time: 16_776_000 picoseconds.
Weight::from_parts(17_396_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `584`
// Estimated: `42428`
// Minimum execution time: 37_780_000 picoseconds.
Weight::from_parts(38_626_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda DecidingCount (r:1 w:1)
/// Proof: FellowshipReferenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `719`
// Estimated: `42428`
// Minimum execution time: 85_265_000 picoseconds.
Weight::from_parts(89_986_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `770`
// Estimated: `42428`
// Minimum execution time: 143_283_000 picoseconds.
Weight::from_parts(158_540_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_end_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `755`
// Estimated: `42428`
// Minimum execution time: 143_736_000 picoseconds.
Weight::from_parts(162_755_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_continue_not_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `770`
// Estimated: `42428`
// Minimum execution time: 139_021_000 picoseconds.
Weight::from_parts(157_398_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_continue_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `776`
// Estimated: `42428`
// Minimum execution time: 78_530_000 picoseconds.
Weight::from_parts(83_556_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: Scheduler Lookup (r:1 w:1)
/// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen)
fn nudge_referendum_approved() -> Weight {
// Proof Size summary in bytes:
// Measured: `776`
// Estimated: `83866`
// Minimum execution time: 174_165_000 picoseconds.
Weight::from_parts(188_496_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:1)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipCollective MemberCount (r:1 w:0)
/// Proof: FellowshipCollective MemberCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_rejected() -> Weight {
// Proof Size summary in bytes:
// Measured: `772`
// Estimated: `42428`
// Minimum execution time: 142_964_000 picoseconds.
Weight::from_parts(157_257_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: Preimage StatusFor (r:1 w:0)
/// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda MetadataOf (r:0 w:1)
/// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn set_some_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `352`
// Estimated: `4365`
// Minimum execution time: 20_126_000 picoseconds.
Weight::from_parts(20_635_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: FellowshipReferenda ReferendumInfoFor (r:1 w:0)
/// Proof: FellowshipReferenda ReferendumInfoFor (max_values: None, max_size: Some(900), added: 3375, mode: MaxEncodedLen)
/// Storage: FellowshipReferenda MetadataOf (r:1 w:1)
/// Proof: FellowshipReferenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn clear_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `285`
// Estimated: `4365`
// Minimum execution time: 17_716_000 picoseconds.
Weight::from_parts(18_324_000, 0)
.saturating_add(Weight::from_parts(0, 4365))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,523 @@
// Copyright (C) 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: 2023-06-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-e8ezs4ez-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// benchmark
// pallet
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --pallet=pallet_referenda
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: Referenda ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:0 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
fn submit() -> Weight {
// Proof Size summary in bytes:
// Measured: `186`
// Estimated: `42428`
// Minimum execution time: 39_146_000 picoseconds.
Weight::from_parts(40_383_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `439`
// Estimated: `83866`
// Minimum execution time: 51_385_000 picoseconds.
Weight::from_parts(52_701_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:0)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3196`
// Estimated: `42428`
// Minimum execution time: 70_018_000 picoseconds.
Weight::from_parts(75_868_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:0)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `3216`
// Estimated: `42428`
// Minimum execution time: 69_311_000 picoseconds.
Weight::from_parts(72_425_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:1)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `439`
// Estimated: `83866`
// Minimum execution time: 64_385_000 picoseconds.
Weight::from_parts(66_178_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:1)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn place_decision_deposit_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `439`
// Estimated: `83866`
// Minimum execution time: 62_200_000 picoseconds.
Weight::from_parts(63_782_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
fn refund_decision_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `279`
// Estimated: `4401`
// Minimum execution time: 29_677_000 picoseconds.
Weight::from_parts(30_603_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
fn refund_submission_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `269`
// Estimated: `4401`
// Minimum execution time: 29_897_000 picoseconds.
Weight::from_parts(30_618_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `347`
// Estimated: `83866`
// Minimum execution time: 37_697_000 picoseconds.
Weight::from_parts(38_953_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: Referenda MetadataOf (r:1 w:0)
/// Proof: Referenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `588`
// Estimated: `83866`
// Minimum execution time: 106_001_000 picoseconds.
Weight::from_parts(107_102_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda TrackQueue (r:1 w:0)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:1)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
fn one_fewer_deciding_queue_empty() -> Weight {
// Proof Size summary in bytes:
// Measured: `102`
// Estimated: `5477`
// Minimum execution time: 8_987_000 picoseconds.
Weight::from_parts(9_431_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn one_fewer_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `3116`
// Estimated: `42428`
// Minimum execution time: 55_344_000 picoseconds.
Weight::from_parts(58_026_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn one_fewer_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `3116`
// Estimated: `42428`
// Minimum execution time: 57_003_000 picoseconds.
Weight::from_parts(60_347_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
fn nudge_referendum_requeued_insertion() -> Weight {
// Proof Size summary in bytes:
// Measured: `2939`
// Estimated: `5477`
// Minimum execution time: 23_001_000 picoseconds.
Weight::from_parts(24_812_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
fn nudge_referendum_requeued_slide() -> Weight {
// Proof Size summary in bytes:
// Measured: `2939`
// Estimated: `5477`
// Minimum execution time: 23_299_000 picoseconds.
Weight::from_parts(24_465_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:0)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
fn nudge_referendum_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2943`
// Estimated: `5477`
// Minimum execution time: 28_223_000 picoseconds.
Weight::from_parts(29_664_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:0)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Referenda TrackQueue (r:1 w:1)
/// Proof: Referenda TrackQueue (max_values: None, max_size: Some(2012), added: 4487, mode: MaxEncodedLen)
fn nudge_referendum_not_queued() -> Weight {
// Proof Size summary in bytes:
// Measured: `2963`
// Estimated: `5477`
// Minimum execution time: 27_474_000 picoseconds.
Weight::from_parts(29_072_000, 0)
.saturating_add(Weight::from_parts(0, 5477))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_no_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `299`
// Estimated: `42428`
// Minimum execution time: 24_405_000 picoseconds.
Weight::from_parts(25_184_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_preparing() -> Weight {
// Proof Size summary in bytes:
// Measured: `347`
// Estimated: `42428`
// Minimum execution time: 24_572_000 picoseconds.
Weight::from_parts(25_287_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
fn nudge_referendum_timed_out() -> Weight {
// Proof Size summary in bytes:
// Measured: `206`
// Estimated: `4401`
// Minimum execution time: 16_042_000 picoseconds.
Weight::from_parts(16_610_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:1)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_deciding_failing() -> Weight {
// Proof Size summary in bytes:
// Measured: `347`
// Estimated: `42428`
// Minimum execution time: 33_639_000 picoseconds.
Weight::from_parts(34_749_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda DecidingCount (r:1 w:1)
/// Proof: Referenda DecidingCount (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_deciding_passing() -> Weight {
// Proof Size summary in bytes:
// Measured: `347`
// Estimated: `42428`
// Minimum execution time: 36_467_000 picoseconds.
Weight::from_parts(37_693_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_begin_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `42428`
// Minimum execution time: 29_857_000 picoseconds.
Weight::from_parts(30_840_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_end_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `383`
// Estimated: `42428`
// Minimum execution time: 31_028_000 picoseconds.
Weight::from_parts(32_154_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_continue_not_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `42428`
// Minimum execution time: 28_594_000 picoseconds.
Weight::from_parts(29_092_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_continue_confirming() -> Weight {
// Proof Size summary in bytes:
// Measured: `404`
// Estimated: `42428`
// Minimum execution time: 27_246_000 picoseconds.
Weight::from_parts(28_003_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
/// Storage: Scheduler Lookup (r:1 w:1)
/// Proof: Scheduler Lookup (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen)
fn nudge_referendum_approved() -> Weight {
// Proof Size summary in bytes:
// Measured: `404`
// Estimated: `83866`
// Minimum execution time: 43_426_000 picoseconds.
Weight::from_parts(44_917_000, 0)
.saturating_add(Weight::from_parts(0, 83866))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:0)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:1 w:1)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(38963), added: 41438, mode: MaxEncodedLen)
fn nudge_referendum_rejected() -> Weight {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `42428`
// Minimum execution time: 30_285_000 picoseconds.
Weight::from_parts(31_575_000, 0)
.saturating_add(Weight::from_parts(0, 42428))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Preimage StatusFor (r:1 w:0)
/// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
/// Storage: Referenda MetadataOf (r:0 w:1)
/// Proof: Referenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn set_some_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `350`
// Estimated: `4401`
// Minimum execution time: 19_254_000 picoseconds.
Weight::from_parts(19_855_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(936), added: 3411, mode: MaxEncodedLen)
/// Storage: Referenda MetadataOf (r:1 w:1)
/// Proof: Referenda MetadataOf (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
fn clear_metadata() -> Weight {
// Proof Size summary in bytes:
// Measured: `283`
// Estimated: `4401`
// Minimum execution time: 16_957_000 picoseconds.
Weight::from_parts(17_556_000, 0)
.saturating_add(Weight::from_parts(0, 4401))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,150 @@
// Copyright (C) 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_treasury`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-13, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-o7yfgx5n-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_treasury
// --chain=westend-dev
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weight functions for `pallet_treasury`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> {
/// Storage: `Treasury::ProposalCount` (r:1 w:1)
/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Approvals` (r:1 w:1)
/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Proposals` (r:0 w:1)
/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
fn spend() -> Weight {
// Proof Size summary in bytes:
// Measured: `6`
// Estimated: `1887`
// Minimum execution time: 13_644_000 picoseconds.
Weight::from_parts(13_988_000, 0)
.saturating_add(Weight::from_parts(0, 1887))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Treasury::ProposalCount` (r:1 w:1)
/// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Proposals` (r:0 w:1)
/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
fn propose_spend() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `1489`
// Minimum execution time: 26_304_000 picoseconds.
Weight::from_parts(26_850_000, 0)
.saturating_add(Weight::from_parts(0, 1489))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Treasury::Proposals` (r:1 w:1)
/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn reject_proposal() -> Weight {
// Proof Size summary in bytes:
// Measured: `265`
// Estimated: `3593`
// Minimum execution time: 40_318_000 picoseconds.
Weight::from_parts(41_598_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Treasury::Proposals` (r:1 w:0)
/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Approvals` (r:1 w:1)
/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
/// The range of component `p` is `[0, 99]`.
fn approve_proposal(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `433 + p * (8 ±0)`
// Estimated: `3573`
// Minimum execution time: 8_250_000 picoseconds.
Weight::from_parts(10_937_873, 0)
.saturating_add(Weight::from_parts(0, 3573))
// Standard Error: 1_239
.saturating_add(Weight::from_parts(82_426, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Treasury::Approvals` (r:1 w:1)
/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
fn remove_approval() -> Weight {
// Proof Size summary in bytes:
// Measured: `90`
// Estimated: `1887`
// Minimum execution time: 6_170_000 picoseconds.
Weight::from_parts(6_366_000, 0)
.saturating_add(Weight::from_parts(0, 1887))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Treasury::Deactivated` (r:1 w:1)
/// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Balances::InactiveIssuance` (r:1 w:1)
/// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Approvals` (r:1 w:1)
/// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
/// Storage: `Treasury::Proposals` (r:100 w:100)
/// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:200 w:200)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// The range of component `p` is `[0, 100]`.
fn on_initialize_proposals(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `175 + p * (251 ±0)`
// Estimated: `1887 + p * (5206 ±0)`
// Minimum execution time: 39_691_000 picoseconds.
Weight::from_parts(29_703_313, 0)
.saturating_add(Weight::from_parts(0, 1887))
// Standard Error: 18_540
.saturating_add(Weight::from_parts(42_601_290, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
}
}
@@ -0,0 +1,116 @@
// Copyright (C) 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: 2023-07-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-o7yfgx5n-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=pallet_whitelist
// --chain=westend-dev
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::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)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn whitelist_call() -> Weight {
// Proof Size summary in bytes:
// Measured: `122`
// Estimated: `3556`
// Minimum execution time: 21_188_000 picoseconds.
Weight::from_parts(21_804_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn remove_whitelisted_call() -> Weight {
// Proof Size summary in bytes:
// Measured: `251`
// Estimated: `3556`
// Minimum execution time: 17_655_000 picoseconds.
Weight::from_parts(19_443_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 4194294]`.
fn dispatch_whitelisted_call(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `327 + n * (1 ±0)`
// Estimated: `3791 + n * (1 ±0)`
// Minimum execution time: 30_540_000 picoseconds.
Weight::from_parts(30_886_000, 0)
.saturating_add(Weight::from_parts(0, 3791))
// Standard Error: 9
.saturating_add(Weight::from_parts(1_779, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
}
/// Storage: `Whitelist::WhitelistedCall` (r:1 w:1)
/// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:1)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 10000]`.
fn dispatch_whitelisted_call_with_preimage(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `251`
// Estimated: `3556`
// Minimum execution time: 21_082_000 picoseconds.
Weight::from_parts(21_922_294, 0)
.saturating_add(Weight::from_parts(0, 3556))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_412, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}
+85 -23
View File
@@ -17,26 +17,31 @@
//! XCM configurations for Westend.
use super::{
parachains_origin, weights, AccountId, AllPalletsWithSystem, Balances, Dmp, ParaId, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmPallet,
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Dmp, FellowshipAdmin,
GeneralAdmin, ParaId, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, StakingAdmin,
TransactionByteFee, WeightToFee, XcmPallet,
};
use frame_support::{
parameter_types,
match_types, parameter_types,
traits::{Everything, Nothing},
};
use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use runtime_common::{
xcm_sender::{ChildParachainRouter, ExponentialPrice},
ToAuthor,
};
use sp_core::ConstU32;
use westend_runtime_constants::currency::CENTS;
use westend_runtime_constants::{
currency::CENTS, system_parachain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX,
};
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, DescribeBodyTerminal,
DescribeFamily, HashedDescription, IsChildSystemParachain, IsConcrete, MintLocation,
DescribeFamily, HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
};
@@ -45,7 +50,7 @@ use xcm_executor::XcmExecutor;
parameter_types! {
pub const TokenLocation: MultiLocation = Here.into_location();
pub const ThisNetwork: NetworkId = Westend;
pub UniversalLocation: InteriorMultiLocation = ThisNetwork::get().into();
pub const UniversalLocation: InteriorMultiLocation = X1(GlobalConsensus(ThisNetwork::get()));
pub CheckAccount: AccountId = XcmPallet::check_account();
pub LocalCheckAccount: (AccountId, MintLocation) = (CheckAccount::get(), MintLocation::Local);
/// The asset ID for the asset that we use to pay for message delivery fees.
@@ -77,9 +82,17 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter<
>;
type LocalOriginConverter = (
// If the origin kind is `Sovereign`, then return a `Signed` origin with the account determined
// by the `LocationConverter` converter.
SovereignSignedViaLocation<LocationConverter, RuntimeOrigin>,
// If the origin kind is `Native` and the XCM origin is a child parachain, then we can express
// it with the special `parachains_origin::Origin` origin variant.
ChildParachainAsNative<parachains_origin::Origin, RuntimeOrigin>,
// If the origin kind is `Native` and the XCM origin is the `AccountId32` location, then it can
// be expressed using the `Signed` origin variant.
SignedAccountId32AsNative<ThisNetwork, RuntimeOrigin>,
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
XcmPassthrough<RuntimeOrigin>,
);
/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our
@@ -94,22 +107,27 @@ pub type XcmRouter = WithUniqueTopic<(
)>;
parameter_types! {
pub const Westmint: MultiLocation = Parachain(1000).into_location();
pub const Collectives: MultiLocation = Parachain(1001).into_location();
pub const Wnd: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const WndForWestmint: (MultiAssetFilter, MultiLocation) = (Wnd::get(), Westmint::get());
pub const AssetHub: MultiLocation = Parachain(ASSET_HUB_ID).into_location();
pub const WndForAssetHub: (MultiAssetFilter, MultiLocation) = (Wnd::get(), AssetHub::get());
pub const Collectives: MultiLocation = Parachain(COLLECTIVES_ID).into_location();
pub const WndForCollectives: (MultiAssetFilter, MultiLocation) = (Wnd::get(), Collectives::get());
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
}
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parachain(1000).into());
}
pub type TrustedTeleporters =
(xcm_builder::Case<WndForWestmint>, xcm_builder::Case<WndForCollectives>);
(xcm_builder::Case<WndForAssetHub>, xcm_builder::Case<WndForCollectives>);
match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Parachain(_)) }
};
pub type CollectivesOrFellows: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Parachain(COLLECTIVES_ID)) } |
MultiLocation { parents: 0, interior: X2(Parachain(COLLECTIVES_ID), Plurality { id: BodyId::Technical, .. }) }
};
}
/// The barriers one of which must be passed for an XCM message to be executed.
pub type Barrier = TrailingSetTopicAsId<(
@@ -121,10 +139,10 @@ pub type Barrier = TrailingSetTopicAsId<(
(
// If the message is one that immediately attemps to pay for execution, then allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Messages coming from system parachains need not pay for execution.
AllowExplicitUnpaidExecutionFrom<IsChildSystemParachain<ParaId>>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<Everything>,
AllowSubscriptionsFrom<OnlyParachains>,
// Collectives and Fellows plurality get free execution.
AllowExplicitUnpaidExecutionFrom<CollectivesOrFellows>,
),
UniversalLocation,
ConstU32<8>,
@@ -141,8 +159,11 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
type Weigher =
WeightInfoBounds<weights::xcm::WestendXcmWeight<RuntimeCall>, RuntimeCall, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::WestendXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
type Trader =
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
@@ -161,16 +182,54 @@ impl xcm_executor::Config for XcmConfig {
type Aliasers = Nothing;
}
parameter_types! {
// `GeneralAdmin` pluralistic body.
pub const GeneralAdminBodyId: BodyId = BodyId::Administration;
// StakingAdmin pluralistic body.
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
// FellowshipAdmin pluralistic body.
pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX);
}
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parachain(1000).into());
}
/// Type to convert the `GeneralAdmin` origin to a Plurality `MultiLocation` value.
pub type GeneralAdminToPlurality =
OriginToPluralityVoice<RuntimeOrigin, GeneralAdmin, GeneralAdminBodyId>;
/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior
/// location of this chain.
pub type LocalOriginToLocation = (
GeneralAdminToPlurality,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>,
);
/// Type to convert the `StakingAdmin` origin to a Plurality `MultiLocation` value.
pub type StakingAdminToPlurality =
OriginToPluralityVoice<RuntimeOrigin, StakingAdmin, StakingAdminBodyId>;
/// Type to convert the `FellowshipAdmin` origin to a Plurality `MultiLocation` value.
pub type FellowshipAdminToPlurality =
OriginToPluralityVoice<RuntimeOrigin, FellowshipAdmin, FellowshipAdminBodyId>;
/// Type to convert a pallet `Origin` type value into a `MultiLocation` value which represents an
/// interior location of this chain for a destination chain.
pub type LocalPalletOriginToLocation = (
// GeneralAdmin origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
GeneralAdminToPlurality,
// StakingAdmin origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
StakingAdminToPlurality,
// FellowshipAdmin origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
FellowshipAdminToPlurality,
);
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally...
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
@@ -179,8 +238,11 @@ impl pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Weigher =
WeightInfoBounds<weights::xcm::WestendXcmWeight<RuntimeCall>, RuntimeCall, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::WestendXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
type UniversalLocation = UniversalLocation;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;