From 110277212001e2ea2ac850049ebd72c13bf21411 Mon Sep 17 00:00:00 2001 From: doordashcon Date: Wed, 29 Jan 2025 02:14:00 +0100 Subject: [PATCH 1/4] add weights for potoc(ranked-collectives, salary, treasury) --- .../collectives-polkadot/src/lib.rs | 5 + ...let_ranked_collective_potoc_collectives.rs | 192 ++++++++++++++++++ .../src/weights/pallet_salary_potoc_salary.rs | 171 ++++++++++++++++ .../weights/pallet_treasury_potoc_treasury.rs | 161 +++++++++++++++ 4 files changed, 529 insertions(+) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_potoc_salary.rs create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_potoc_treasury.rs diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 926532a827..1e513bec2a 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -829,6 +829,11 @@ mod benches { [pallet_core_fellowship, AmbassadorCore] [pallet_salary, AmbassadorSalary] [pallet_treasury, AmbassadorTreasury] + //[pallet_referenda, PotocTreasury] + [pallet_ranked_collective, PotocCollective] + //[pallet_core_fellowship, PotocCore] + [pallet_salary, PotocSalary] + [pallet_treasury, PotocTreasury] ); } diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs new file mode 100644 index 0000000000..2117bdbecd --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs @@ -0,0 +1,192 @@ + +//! Autogenerated weights for `pallet_ranked_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Jesses-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --pallet +// pallet-ranked-collective +// --extrinsic +// +// --runtime +// ./target/release/wbuild/collectives-polkadot-runtime/collectives_polkadot_runtime.compact.compressed.wasm +// --output +// ./system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collective.rs + +#![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(PhantomData); +impl pallet_ranked_collective::WeightInfo for WeightInfo { + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:0 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn add_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3507` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) + .saturating_add(Weight::from_parts(0, 3507)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:11 w:11) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:11 w:22) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:11 w:22) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn remove_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `551 + r * (281 ±0)` + // Estimated: `3519 + r * (2529 ±0)` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(30_129_934, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 10_709 + .saturating_add(Weight::from_parts(14_208_126, 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(6)) + .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2529).saturating_mul(r.into())) + } + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:0 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn promote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `248 + r * (17 ±0)` + // Estimated: `3507` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_693_801, 0) + .saturating_add(Weight::from_parts(0, 3507)) + // Standard Error: 4_572 + .saturating_add(Weight::from_parts(403_878, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:1 w:2) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:1 w:2) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn demote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `566 + r * (72 ±0)` + // Estimated: `3519` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(30_467_446, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 10_866 + .saturating_add(Weight::from_parts(538_913, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `PotocReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Voting` (r:1 w:1) + /// Proof: `PotocCollective::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(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Retries` (r:0 w:1) + /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `634` + // Estimated: `317568` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(40_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `PotocReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `PotocReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::VotingCleanup` (r:1 w:0) + /// Proof: `PotocCollective::VotingCleanup` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Voting` (r:100 w:100) + /// Proof: `PotocCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + fn cleanup_poll(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `468 + n * (50 ±0)` + // Estimated: `4365 + n * (2540 ±0)` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_058_439, 0) + .saturating_add(Weight::from_parts(0, 4365)) + // Standard Error: 1_869 + .saturating_add(Weight::from_parts(1_124_466, 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())) + } + /// Storage: `PotocCollective::Members` (r:2 w:2) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:2 w:2) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:2 w:4) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:2 w:2) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:0) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:2 w:2) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:2) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn exchange_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `703` + // Estimated: `69046` + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(67_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(14)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_potoc_salary.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_potoc_salary.rs new file mode 100644 index 0000000000..6341dabaff --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_potoc_salary.rs @@ -0,0 +1,171 @@ + +//! Autogenerated weights for `pallet_salary` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Jesses-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --pallet +// pallet-salary +// --extrinsic +// +// --runtime +// ./target/release/wbuild/collectives-polkadot-runtime/collectives_polkadot_runtime.compact.compressed.wasm +// --output +// ./system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_protoc_salary.rs + +#![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_salary`. +pub struct WeightInfo(PhantomData); +impl pallet_salary::WeightInfo for WeightInfo { + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + fn init() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `1541` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + fn bump() -> Weight { + // Proof Size summary in bytes: + // Measured: `158` + // Estimated: `1541` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocSalary::Status` (r:1 w:0) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:1 w:1) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `401` + // Estimated: `3551` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) + .saturating_add(Weight::from_parts(0, 3551)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:1 w:1) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + fn register() -> Weight { + // Proof Size summary in bytes: + // Measured: `468` + // Estimated: `3551` + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) + .saturating_add(Weight::from_parts(0, 3551)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:1 w:1) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `835` + // Estimated: `4300` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) + .saturating_add(Weight::from_parts(0, 4300)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:1 w:1) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout_other() -> Weight { + // Proof Size summary in bytes: + // Measured: `835` + // Estimated: `4300` + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) + .saturating_add(Weight::from_parts(0, 4300)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocSalary::Status` (r:1 w:1) + /// Proof: `PotocSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `PotocSalary::Claimant` (r:1 w:1) + /// Proof: `PotocSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_payment() -> Weight { + // Proof Size summary in bytes: + // Measured: `270` + // Estimated: `3735` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 3735)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_potoc_treasury.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_potoc_treasury.rs new file mode 100644 index 0000000000..dff1a87df8 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_potoc_treasury.rs @@ -0,0 +1,161 @@ + +//! Autogenerated weights for `pallet_treasury` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Jesses-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --pallet +// pallet-treasury +// --extrinsic +// +// --runtime +// ./target/release/wbuild/collectives-polkadot-runtime/collectives_polkadot_runtime.compact.compressed.wasm +// --output +// ./system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_protoc_treasury.rs + +#![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(PhantomData); +impl pallet_treasury::WeightInfo for WeightInfo { + /// Storage: `PotocTreasury::ProposalCount` (r:1 w:1) + /// Proof: `PotocTreasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Approvals` (r:1 w:1) + /// Proof: `PotocTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Proposals` (r:0 w:1) + /// Proof: `PotocTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn spend_local() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `1887` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `PotocTreasury::Approvals` (r:1 w:1) + /// Proof: `PotocTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + fn remove_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `127` + // Estimated: `1887` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `System::Account` (r:100 w:100) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Deactivated` (r:1 w:1) + /// Proof: `PotocTreasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Approvals` (r:1 w:1) + /// Proof: `PotocTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Proposals` (r:99 w:99) + /// Proof: `PotocTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. + fn on_initialize_proposals(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `182 + p * (157 ±0)` + // Estimated: `3593 + p * (2603 ±0)` + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(29_122_451, 0) + .saturating_add(Weight::from_parts(0, 3593)) + // Standard Error: 25_760 + .saturating_add(Weight::from_parts(20_542_708, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 2603).saturating_mul(p.into())) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0) + /// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(1238), added: 3713, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::SpendCount` (r:1 w:1) + /// Proof: `PotocTreasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PotocTreasury::Spends` (r:0 w:1) + /// Proof: `PotocTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `221` + // Estimated: `4703` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) + .saturating_add(Weight::from_parts(0, 4703)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PotocTreasury::Spends` (r:1 w:1) + /// Proof: `PotocTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `619` + // Estimated: `5318` + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(44_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `PotocTreasury::Spends` (r:1 w:1) + /// Proof: `PotocTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `207` + // Estimated: `5318` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PotocTreasury::Spends` (r:1 w:1) + /// Proof: `PotocTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn void_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `179` + // Estimated: `5318` + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} From f052f214aea2af7e4e0fd56caf09c19ba22261c3 Mon Sep 17 00:00:00 2001 From: doordashcon Date: Sun, 20 Apr 2025 09:46:02 +0100 Subject: [PATCH 2/4] mods --- .../collectives/collectives-polkadot/src/lib.rs | 4 ++-- .../collectives/collectives-polkadot/src/potoc/mod.rs | 10 +++++----- .../collectives-polkadot/src/weights/mod.rs | 3 +++ ...rs => pallet_ranked_collective_potoc_collective.rs} | 0 4 files changed, 10 insertions(+), 7 deletions(-) rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_ranked_collective_potoc_collectives.rs => pallet_ranked_collective_potoc_collective.rs} (100%) diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 1e513bec2a..af1b4c9e32 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -829,9 +829,9 @@ mod benches { [pallet_core_fellowship, AmbassadorCore] [pallet_salary, AmbassadorSalary] [pallet_treasury, AmbassadorTreasury] - //[pallet_referenda, PotocTreasury] + [pallet_referenda, PotocReferenda] [pallet_ranked_collective, PotocCollective] - //[pallet_core_fellowship, PotocCore] + [pallet_core_fellowship, PotocCore] [pallet_salary, PotocSalary] [pallet_treasury, PotocTreasury] ); diff --git a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs index d722ac9252..35b1664450 100644 --- a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs @@ -105,7 +105,7 @@ impl pallet_referenda::Config for Runtime { pub type PotocCollectiveInstance = pallet_ranked_collective::Instance3; impl pallet_ranked_collective::Config for Runtime { - type WeightInfo = weights::pallet_ranked_collective_fellowship_collective::WeightInfo; + type WeightInfo = weights::pallet_ranked_collective_potoc_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; // Promotions and the induction of new members are serviced by `PotocCore` pallet instance. @@ -145,7 +145,7 @@ impl pallet_ranked_collective::Config for Runtime { pub type PotocCoreInstance = pallet_core_fellowship::Instance3; impl pallet_core_fellowship::Config for Runtime { - type WeightInfo = weights::pallet_core_fellowship_fellowship_core::WeightInfo; + type WeightInfo = (); type RuntimeEvent = RuntimeEvent; type Members = pallet_ranked_collective::Pallet; type Balance = Balance; @@ -156,7 +156,7 @@ impl pallet_core_fellowship::Config for Runtime { // Fast promotions are not needed with a single rank and would require higher turnout. type FastPromoteOrigin = NeverEnsureOrigin; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU32<9>; + type MaxRank = ConstU32<1>; } pub type PotocSalaryInstance = pallet_salary::Instance3; @@ -184,7 +184,7 @@ pub type PotocSalaryPaymaster = PayOverXcm< >; impl pallet_salary::Config for Runtime { - type WeightInfo = weights::pallet_salary_fellowship_salary::WeightInfo; + type WeightInfo = weights::pallet_salary_potoc_salary::WeightInfo; type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] @@ -238,7 +238,7 @@ pub type PotocTreasuryPaymaster = PayOverXcm< pub type PotocTreasuryInstance = pallet_treasury::Instance3; impl pallet_treasury::Config for Runtime { - type WeightInfo = weights::pallet_treasury_fellowship_treasury::WeightInfo; + type WeightInfo = weights::pallet_treasury_potoc_treasury::WeightInfo; type RuntimeEvent = RuntimeEvent; type PalletId = PotocTreasuryPalletId; type Currency = Balances; diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs index 30c6e7cdb0..782d417dce 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs @@ -32,15 +32,18 @@ pub mod pallet_preimage; pub mod pallet_proxy; pub mod pallet_ranked_collective_ambassador_collective; pub mod pallet_ranked_collective_fellowship_collective; +pub mod pallet_ranked_collective_potoc_collective; pub mod pallet_referenda_ambassador_referenda; pub mod pallet_referenda_fellowship_referenda; pub mod pallet_salary_ambassador_salary; pub mod pallet_salary_fellowship_salary; +pub mod pallet_salary_potoc_salary; pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; pub mod pallet_treasury_ambassador_treasury; pub mod pallet_treasury_fellowship_treasury; +pub mod pallet_treasury_potoc_treasury; pub mod pallet_utility; pub mod pallet_xcm; pub mod paritydb_weights; diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collective.rs similarity index 100% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collectives.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_potoc_collective.rs From 8998ac635c54f65ae9f15f6c7b6233a1070a4f0d Mon Sep 17 00:00:00 2001 From: doordashcon Date: Wed, 21 May 2025 10:08:37 +0100 Subject: [PATCH 3/4] add weights core_fellowship --- .../src/ambassador/mod.rs | 2 +- .../src/fellowship/mod.rs | 2 +- .../collectives-polkadot/src/potoc/mod.rs | 15 +- .../collectives-polkadot/src/weights/mod.rs | 1 + .../pallet_core_fellowship_ambassador_core.rs | 2 +- .../pallet_core_fellowship_fellowship_core.rs | 2 +- .../pallet_core_fellowship_potoc_core.rs | 248 ++++++++++++++++++ 7 files changed, 260 insertions(+), 12 deletions(-) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs index 6096c2ef27..4f0c3a6ce0 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs @@ -230,7 +230,7 @@ impl pallet_core_fellowship::Config for Runtime { type FastPromoteOrigin = frame_support::traits::NeverEnsureOrigin; type EvidenceSize = ConstU32<65536>; // TODO https://github.com/polkadot-fellows/runtimes/issues/370 - type MaxRank = ConstU32<9>; + type MaxRank = ConstU16<9>; } parameter_types! { diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs index b1354bd647..a9a0ab01b4 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -209,7 +209,7 @@ impl pallet_core_fellowship::Config for Runtime { >; type FastPromoteOrigin = EnsureCanFastPromoteTo; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU32<9>; + type MaxRank = ConstU16<9>; } pub type FellowshipSalaryInstance = pallet_salary::Instance1; diff --git a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs index 35b1664450..31cb53b592 100644 --- a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs @@ -32,8 +32,8 @@ use crate::xcm_config::FellowshipAdminBodyId as PotocAdminBodyId; use frame_support::{ parameter_types, traits::{ - DefensiveResult, EitherOf, EitherOfDiverse, MapSuccess, NeverEnsureOrigin, - OnRuntimeUpgrade, PalletInfoAccess, RankedMembers, + DefensiveResult, EitherOf, EitherOfDiverse, MapSuccess, + OnRuntimeUpgrade, PalletInfoAccess, RankedMembers, NeverEnsureOrigin, }, PalletId, }; @@ -82,7 +82,7 @@ impl pallet_potoc_origins::Config for Runtime {} pub type PotocReferendaInstance = pallet_referenda::Instance3; impl pallet_referenda::Config for Runtime { - type WeightInfo = weights::pallet_referenda_fellowship_referenda::WeightInfo; + type WeightInfo = (); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; @@ -145,7 +145,7 @@ impl pallet_ranked_collective::Config for Runtime { pub type PotocCoreInstance = pallet_core_fellowship::Instance3; impl pallet_core_fellowship::Config for Runtime { - type WeightInfo = (); + type WeightInfo = weights::pallet_core_fellowship_potoc_core::WeightInfo; type RuntimeEvent = RuntimeEvent; type Members = pallet_ranked_collective::Pallet; type Balance = Balance; @@ -156,7 +156,7 @@ impl pallet_core_fellowship::Config for Runtime { // Fast promotions are not needed with a single rank and would require higher turnout. type FastPromoteOrigin = NeverEnsureOrigin; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU32<1>; + type MaxRank = ConstU16<1>; } pub type PotocSalaryInstance = pallet_salary::Instance3; @@ -313,9 +313,8 @@ impl OnRuntimeUpgrade for InsertSeedMembers { log::info!("PoToC Seed member inserted: {address}"); - // TODO use potoc weight - weight.saturating_accrue(weights::pallet_ranked_collective_fellowship_collective::WeightInfo::::add_member()); - weight.saturating_accrue(weights::pallet_ranked_collective_fellowship_collective::WeightInfo::::promote_member(1)); + weight.saturating_accrue(weights::pallet_ranked_collective_potoc_collective::WeightInfo::::add_member()); + weight.saturating_accrue(weights::pallet_ranked_collective_potoc_collective::WeightInfo::::promote_member(1)); } weight diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs index 782d417dce..732e9fda09 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs @@ -26,6 +26,7 @@ pub mod pallet_collator_selection; pub mod pallet_collective; pub mod pallet_core_fellowship_ambassador_core; pub mod pallet_core_fellowship_fellowship_core; +pub mod pallet_core_fellowship_potoc_core; pub mod pallet_message_queue; pub mod pallet_multisig; pub mod pallet_preimage; diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs index b0a7630626..8502a09200 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs @@ -190,7 +190,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 9]`. - fn promote_fast(r: u32, ) -> Weight { + fn promote_fast(r: u16, ) -> Weight { // Proof Size summary in bytes: // Measured: `65968` // Estimated: `69046 + r * (2489 ±0)` diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs index e5f0500beb..d7d30b0c48 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs @@ -190,7 +190,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 9]`. - fn promote_fast(r: u32, ) -> Weight { + fn promote_fast(r: u16, ) -> Weight { // Proof Size summary in bytes: // Measured: `66101` // Estimated: `69046 + r * (2489 ±0)` diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs new file mode 100644 index 0000000000..7ddf46d2be --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs @@ -0,0 +1,248 @@ + +//! Autogenerated weights for `pallet_core_fellowship` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0 +//! DATE: 2025-04-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Jesses-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// ./target/release/wbuild/collectives-polkadot-runtime/collectives_polkadot_runtime.compact.compressed.wasm +// --pallet +// pallet-core-fellowship +// --extrinsic +// * +// --output=./system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs + +#![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_core_fellowship`. +pub struct WeightInfo(PhantomData); +impl pallet_core_fellowship::WeightInfo for WeightInfo { + /// Storage: `PotocCore::Params` (r:0 w:1) + /// Proof: `PotocCore::Params` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + fn set_params() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocCore::Params` (r:1 w:1) + /// Proof: `PotocCore::Params` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + fn set_partial_params() -> Weight { + // Proof Size summary in bytes: + // Measured: `150` + // Estimated: `1533` + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Params` (r:1 w:0) + /// Proof: `PotocCore::Params` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:1 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn bump_offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `66115` + // Estimated: `69046` + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(73_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Params` (r:1 w:0) + /// Proof: `PotocCore::Params` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:1 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn bump_demote() -> Weight { + // Proof Size summary in bytes: + // Measured: `66173` + // Estimated: `69046` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(78_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + fn set_active() -> Weight { + // Proof Size summary in bytes: + // Measured: `394` + // Estimated: `3514` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:0 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `152` + // Estimated: `3514` + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(26_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Params` (r:1 w:0) + /// Proof: `PotocCore::Params` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:0 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn promote() -> Weight { + // Proof Size summary in bytes: + // Measured: `66034` + // Estimated: `69046` + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(67_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocCollective::Members` (r:1 w:1) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::MemberCount` (r:1 w:1) + /// Proof: `PotocCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IndexToId` (r:0 w:1) + /// Proof: `PotocCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::IdToIndex` (r:0 w:1) + /// Proof: `PotocCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[1, 9]`. + /// The range of component `r` is `[1, 9]`. + /// The range of component `r` is `[1, 1]`. + fn promote_fast(_r: u16, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `66002` + // Estimated: `69046` + // Minimum execution time: 58_000_000 picoseconds. + Weight::from_parts(66_908_923, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:0 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `299` + // Estimated: `3514` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + fn import() -> Weight { + // Proof Size summary in bytes: + // Measured: `319` + // Estimated: `3514` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PotocCollective::Members` (r:1 w:0) + /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::Member` (r:1 w:1) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn approve() -> Weight { + // Proof Size summary in bytes: + // Measured: `66001` + // Estimated: `69046` + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PotocCore::Member` (r:1 w:0) + /// Proof: `PotocCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PotocCore::MemberEvidence` (r:1 w:1) + /// Proof: `PotocCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn submit_evidence() -> Weight { + // Proof Size summary in bytes: + // Measured: `151` + // Estimated: `69046` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} From eb9a6a9bf39682ed9861b018859d5e784b2af473 Mon Sep 17 00:00:00 2001 From: doordashcon Date: Wed, 23 Jul 2025 10:20:07 +0100 Subject: [PATCH 4/4] configure MaxRank & Potoc --- .../src/ambassador/mod.rs | 2 +- .../src/fellowship/mod.rs | 2 +- .../collectives-polkadot/src/lib.rs | 10 +++--- .../collectives-polkadot/src/potoc/mod.rs | 14 ++++---- .../collectives-polkadot/src/potoc/origins.rs | 2 +- .../collectives-polkadot/src/potoc/tracks.rs | 36 ++++++++++--------- .../pallet_core_fellowship_ambassador_core.rs | 2 +- .../pallet_core_fellowship_fellowship_core.rs | 2 +- .../pallet_core_fellowship_potoc_core.rs | 16 ++++++++- 9 files changed, 53 insertions(+), 33 deletions(-) diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs index 76a4fc15c1..f097cadfc3 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs @@ -230,7 +230,7 @@ impl pallet_core_fellowship::Config for Runtime { type FastPromoteOrigin = frame_support::traits::NeverEnsureOrigin; type EvidenceSize = ConstU32<65536>; // TODO https://github.com/polkadot-fellows/runtimes/issues/370 - type MaxRank = ConstU16<9>; + type MaxRank = ConstU32<9>; } parameter_types! { diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs index a7909b2198..75506f673b 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -210,7 +210,7 @@ impl pallet_core_fellowship::Config for Runtime { >; type FastPromoteOrigin = EnsureCanFastPromoteTo; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU16<9>; + type MaxRank = ConstU32<9>; } pub type FellowshipSalaryInstance = pallet_salary::Instance1; diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index e3c8e46033..bc41693888 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -775,12 +775,12 @@ construct_runtime!( SecretarySalary: pallet_salary:: = 81, // Tooling Collective in the 90s - PotocCollective: pallet_ranked_collective:: = 90, - PotocReferenda: pallet_referenda:: = 91, + PotocCollective: pallet_ranked_collective:: = 90, + PotocReferenda: pallet_referenda:: = 91, PotocOrigins: pallet_potoc_origins = 92, - PotocCore: pallet_core_fellowship:: = 93, - PotocSalary: pallet_salary:: = 94, - PotocTreasury: pallet_treasury:: = 95 + PotocCore: pallet_core_fellowship:: = 93, + PotocSalary: pallet_salary:: = 94, + PotocTreasury: pallet_treasury:: = 95 } ); diff --git a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs index 31cb53b592..ada1afdc93 100644 --- a/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/potoc/mod.rs @@ -80,7 +80,7 @@ pub type PromoteOrigin = MapSuccess>>; impl pallet_potoc_origins::Config for Runtime {} -pub type PotocReferendaInstance = pallet_referenda::Instance3; +pub type PotocReferendaInstance = pallet_referenda::Instance4; impl pallet_referenda::Config for Runtime { type WeightInfo = (); type RuntimeCall = RuntimeCall; @@ -101,9 +101,10 @@ impl pallet_referenda::Config for Runtime { type AlarmInterval = ConstU32<1>; type Tracks = tracks::TracksInfo; type Preimages = Preimage; + type BlockNumberProvider = crate::System; } -pub type PotocCollectiveInstance = pallet_ranked_collective::Instance3; +pub type PotocCollectiveInstance = pallet_ranked_collective::Instance4; impl pallet_ranked_collective::Config for Runtime { type WeightInfo = weights::pallet_ranked_collective_potoc_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; @@ -142,7 +143,7 @@ impl pallet_ranked_collective::Config for Runtime { type BenchmarkSetup = (crate::PotocCore, crate::PotocSalary); } -pub type PotocCoreInstance = pallet_core_fellowship::Instance3; +pub type PotocCoreInstance = pallet_core_fellowship::Instance4; impl pallet_core_fellowship::Config for Runtime { type WeightInfo = weights::pallet_core_fellowship_potoc_core::WeightInfo; @@ -156,10 +157,10 @@ impl pallet_core_fellowship::Config for Runtime { // Fast promotions are not needed with a single rank and would require higher turnout. type FastPromoteOrigin = NeverEnsureOrigin; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU16<1>; + type MaxRank = ConstU32<1>; } -pub type PotocSalaryInstance = pallet_salary::Instance3; +pub type PotocSalaryInstance = pallet_salary::Instance4; use xcm::prelude::*; @@ -235,7 +236,7 @@ pub type PotocTreasuryPaymaster = PayOverXcm< VersionedLocationConverter, >; -pub type PotocTreasuryInstance = pallet_treasury::Instance3; +pub type PotocTreasuryInstance = pallet_treasury::Instance4; impl pallet_treasury::Config for Runtime { type WeightInfo = weights::pallet_treasury_potoc_treasury::WeightInfo; @@ -275,6 +276,7 @@ impl pallet_treasury::Config for Runtime { sp_core::ConstU8<1>, ConstU32<1000>, >; + type BlockNumberProvider = crate::System; } pub struct InsertSeedMembers; diff --git a/system-parachains/collectives/collectives-polkadot/src/potoc/origins.rs b/system-parachains/collectives/collectives-polkadot/src/potoc/origins.rs index 30b6b1d096..eaf0369466 100644 --- a/system-parachains/collectives/collectives-polkadot/src/potoc/origins.rs +++ b/system-parachains/collectives/collectives-polkadot/src/potoc/origins.rs @@ -31,7 +31,7 @@ pub mod pallet_origins { #[pallet::pallet] pub struct Pallet(_); - #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] + #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug, DecodeWithMemTracking)] #[pallet::origin] pub enum Origin { /// Plurality voice of the [ranks::MEMBER] members given via referendum. diff --git a/system-parachains/collectives/collectives-polkadot/src/potoc/tracks.rs b/system-parachains/collectives/collectives-polkadot/src/potoc/tracks.rs index dfbfd29ebd..c1ea49d81c 100644 --- a/system-parachains/collectives/collectives-polkadot/src/potoc/tracks.rs +++ b/system-parachains/collectives/collectives-polkadot/src/potoc/tracks.rs @@ -16,11 +16,11 @@ //! Track configurations for PoToC. -use super::origins::Origin; +use alloc::borrow::Cow; use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, DOLLARS, HOURS, MINUTES}; -use pallet_referenda::{Curve::LinearDecreasing, TrackInfo}; use polkadot_runtime_common::prod_or_fast; use sp_runtime::Perbill; +use sp_runtime::str_array as s; /// Referendum `TrackId` type. pub type TrackId = u16; @@ -43,50 +43,54 @@ impl pallet_referenda::TracksInfo for TracksInfo { type RuntimeOrigin = ::PalletsOrigin; /// Return the array of available tracks and their information. - fn tracks() -> &'static [(Self::Id, TrackInfo)] { - static DATA: [(TrackId, TrackInfo); 1] = [( - constants::MEMBERS, - TrackInfo { - name: "members", + fn tracks( + ) -> impl Iterator>> { + use constants as tracks; + const DATA: [pallet_referenda::Track; 1] = [ + pallet_referenda::Track { + id: tracks::MEMBERS, + info: pallet_referenda::TrackInfo { + name: s("members"), max_deciding: 10, decision_deposit: 5 * DOLLARS, prepare_period: prod_or_fast!(24 * HOURS, 1 * MINUTES), decision_period: prod_or_fast!(7 * DAYS, 5 * MINUTES), confirm_period: prod_or_fast!(24 * HOURS, 1 * MINUTES), min_enactment_period: prod_or_fast!(HOURS, 1 * MINUTES), - min_approval: LinearDecreasing { + min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), ceil: Perbill::from_percent(100), }, - min_support: LinearDecreasing { + min_support: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), }, }, - )]; - &DATA[..] + },]; + DATA.iter().map(Cow::Borrowed) } /// Determine the voting track for the given `origin`. fn track_for(id: &Self::RuntimeOrigin) -> Result { + use super::origins::Origin; + use constants as tracks; + #[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(constants::MEMBERS) + return Ok(tracks::MEMBERS) } } match Origin::try_from(id.clone()) { - Ok(Origin::Members) => Ok(constants::MEMBERS), + Ok(Origin::Members) => Ok(tracks::MEMBERS), _ => Err(()), } } } -// implements [`frame_support::traits::Get`] for [`TracksInfo`] -pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs index 2900dfb73d..47ca2e2a30 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs @@ -190,7 +190,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 9]`. - fn promote_fast(r: u16, ) -> Weight { + fn promote_fast(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `65968` // Estimated: `69046 + r * (2489 ±0)` diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs index b5dee58638..bda9af23a4 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs @@ -190,7 +190,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 9]`. - fn promote_fast(r: u16, ) -> Weight { + fn promote_fast(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `66101` // Estimated: `69046 + r * (2489 ±0)` diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs index 7ddf46d2be..1d30c3f874 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_potoc_core.rs @@ -175,7 +175,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 9]`. /// The range of component `r` is `[1, 1]`. - fn promote_fast(_r: u16, ) -> Weight { + fn promote_fast(_r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `66002` // Estimated: `69046` @@ -215,6 +215,20 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + fn import_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3514` + // Minimum execution time: 17_493_000 picoseconds. + Weight::from_parts(18_180_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `PotocCollective::Members` (r:1 w:0) /// Proof: `PotocCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `PotocCore::Member` (r:1 w:1)