From 4c46442cce803d3bd8aa7d4d95907d5822708208 Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Tue, 10 Sep 2024 13:53:05 +0200 Subject: [PATCH 1/9] sunset gov v1 --- Cargo.lock | 6 - Cargo.toml | 5 - integration-tests/Cargo.toml | 6 - launch-configs/chopsticks/basilisk.yml | 2 - node/src/chain_spec/local.rs | 7 - node/src/chain_spec/mod.rs | 8 - node/src/chain_spec/paseo.rs | 4 - node/src/chain_spec/rococo.rs | 4 - runtime/basilisk/Cargo.toml | 12 - runtime/basilisk/src/governance/mod.rs | 2 - runtime/basilisk/src/governance/old.rs | 181 ------ runtime/basilisk/src/lib.rs | 7 - runtime/basilisk/src/weights/mod.rs | 3 - .../basilisk/src/weights/pallet_democracy.rs | 513 ------------------ .../src/weights/pallet_elections_phragmen.rs | 316 ----------- runtime/basilisk/src/weights/pallet_tips.rs | 165 ------ 16 files changed, 1241 deletions(-) delete mode 100644 runtime/basilisk/src/governance/old.rs delete mode 100644 runtime/basilisk/src/weights/pallet_democracy.rs delete mode 100644 runtime/basilisk/src/weights/pallet_elections_phragmen.rs delete mode 100644 runtime/basilisk/src/weights/pallet_tips.rs diff --git a/Cargo.lock b/Cargo.lock index 58cdc5f718..895b9ebc8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -992,9 +992,7 @@ dependencies = [ "pallet-collective", "pallet-conviction-voting", "pallet-currencies", - "pallet-democracy 28.0.0", "pallet-duster", - "pallet-elections-phragmen", "pallet-ema-oracle", "pallet-identity", "pallet-lbp", @@ -1012,7 +1010,6 @@ dependencies = [ "pallet-session", "pallet-state-trie-migration", "pallet-timestamp", - "pallet-tips", "pallet-transaction-multi-payment", "pallet-transaction-pause", "pallet-transaction-payment", @@ -10762,9 +10759,7 @@ dependencies = [ "pallet-collator-selection", "pallet-collective", "pallet-currencies", - "pallet-democracy 28.0.0", "pallet-duster", - "pallet-elections-phragmen", "pallet-ema-oracle", "pallet-im-online", "pallet-lbp", @@ -10775,7 +10770,6 @@ dependencies = [ "pallet-scheduler", "pallet-session", "pallet-timestamp", - "pallet-tips", "pallet-transaction-multi-payment", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/Cargo.toml b/Cargo.toml index 8ce5ea8215..1e9f24987d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,9 +64,7 @@ pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -87,7 +85,6 @@ pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk", pallet-state-trie-migration = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -333,7 +330,6 @@ pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -343,7 +339,6 @@ pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index ae5d1da188..6c3a40e529 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -26,10 +26,7 @@ pallet-marketplace = { workspace = true} primitives = { default-features = false, path = "../primitives" } pallet-treasury = { workspace = true } -pallet-democracy = { workspace = true } pallet-scheduler = { workspace = true } -pallet-elections-phragmen = { workspace = true } -pallet-tips = { workspace = true } # collator support pallet-collator-selection = { workspace = true } @@ -148,7 +145,6 @@ std = [ "pallet-asset-registry/std", "pallet-aura/std", "pallet-balances/std", - "pallet-elections-phragmen/std", "pallet-nft/std", "pallet-marketplace/std", "pallet-session/std", @@ -178,9 +174,7 @@ std = [ "sp-version/std", "pallet-treasury/std", "pallet-collective/std", - "pallet-democracy/std", "pallet-scheduler/std", - "pallet-tips/std", "pallet-collator-selection/std", "pallet-authorship/std", "basilisk-runtime/std", diff --git a/launch-configs/chopsticks/basilisk.yml b/launch-configs/chopsticks/basilisk.yml index a75c84942d..1aa08466f5 100644 --- a/launch-configs/chopsticks/basilisk.yml +++ b/launch-configs/chopsticks/basilisk.yml @@ -26,7 +26,5 @@ import-storage: - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 1 - free: '100000000000000000000' - Council: - Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] TechnicalCommittee: Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] diff --git a/node/src/chain_spec/local.rs b/node/src/chain_spec/local.rs index 528f929bf0..63fdbfecca 100644 --- a/node/src/chain_spec/local.rs +++ b/node/src/chain_spec/local.rs @@ -76,8 +76,6 @@ pub fn parachain_config() -> Result { INITIAL_BALANCE, ), ], - // council_members - vec![get_account_id_from_seed::("Alice")], // tech_committee_members vec![ get_account_id_from_seed::("Alice"), @@ -102,11 +100,6 @@ pub fn parachain_config() -> Result { vec![(1, INITIAL_TOKEN_BALANCE), (2, INITIAL_TOKEN_BALANCE)], ), ], - // elections - vec![( - get_account_id_from_seed::("Alice"), - INITIAL_TOKEN_BALANCE, - )], // parachain ID PARA_ID.into(), ); diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index cf66af6b21..f68794a008 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -84,12 +84,10 @@ where pub fn parachain_genesis( initial_authorities: (Vec<(AccountId, AuraId)>, Balance), // (initial auths, candidacy bond) endowed_accounts: Vec<(AccountId, Balance)>, - council_members: Vec, tech_committee_members: Vec, registered_assets: Vec<(Vec, Balance, Option)>, accepted_assets: Vec<(AssetId, Price)>, // (Asset id, Fallback price) - asset which fee can be paid with token_balances: Vec<(AccountId, Vec<(AssetId, Balance)>)>, - elections: Vec<(AccountId, Balance)>, parachain_id: ParaId, ) -> serde_json::Value { serde_json::json!({ @@ -130,17 +128,11 @@ pub fn parachain_genesis( "candidacyBond": initial_authorities.1, "desiredCandidates": 0u32, }, - "council": { - "members": council_members, - }, "duster": { "accountBlacklist": vec![get_account_id_from_seed::("Duster")], "rewardAccount": Some(get_account_id_from_seed::("Duster")), "dustAccount": Some(get_account_id_from_seed::("Duster")) }, - "elections": { - "members": elections, - }, "emaOracle": { }, "multiTransactionPayment": { diff --git a/node/src/chain_spec/paseo.rs b/node/src/chain_spec/paseo.rs index 96fa23f546..4fb4264c0e 100644 --- a/node/src/chain_spec/paseo.rs +++ b/node/src/chain_spec/paseo.rs @@ -68,8 +68,6 @@ pub fn _parachain_config_paseo() -> Result { INITIAL_BALANCE, ), // collator-02 ], - // council_members - vec![get_account_id_from_seed::("Alice")], // tech_committee_members vec![hex!["3418b257de81886bef265495f3609def9a083869f32ef5a03f7351956497d41a"].into()], // same as sudo // registered_assets @@ -81,8 +79,6 @@ pub fn _parachain_config_paseo() -> Result { vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], // token_balances vec![], - // elections - vec![], // parachain ID PARA_ID.into(), ); diff --git a/node/src/chain_spec/rococo.rs b/node/src/chain_spec/rococo.rs index 0b34a954bd..a61a735152 100644 --- a/node/src/chain_spec/rococo.rs +++ b/node/src/chain_spec/rococo.rs @@ -66,8 +66,6 @@ pub fn _parachain_config_rococo() -> Result { INITIAL_BALANCE, ), // collator-02 ], - // council_members - vec![get_account_id_from_seed::("Alice")], // tech_committee_members vec![hex!["3418b257de81886bef265495f3609def9a083869f32ef5a03f7351956497d41a"].into()], // same as sudo // registered_assets @@ -79,8 +77,6 @@ pub fn _parachain_config_rococo() -> Result { vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], // token_balances vec![], - // elections - vec![], // parachain ID PARA_ID.into(), ); diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index 22aad7ab03..f6bba91f07 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -28,10 +28,7 @@ pallet-xyk-liquidity-mining = { workspace = true , default-features = false } pallet-xyk-liquidity-mining-benchmarking = { workspace = true, optional = true, default-features = false } pallet-treasury = { workspace = true } -pallet-democracy = { workspace = true } pallet-scheduler = { workspace = true } -pallet-elections-phragmen = { workspace = true } -pallet-tips = { workspace = true } pallet-identity = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -153,11 +150,9 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "pallet-asset-registry/runtime-benchmarks", "pallet-duster/runtime-benchmarks", - "pallet-democracy/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-utility/runtime-benchmarks", - "pallet-tips/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", @@ -168,7 +163,6 @@ runtime-benchmarks = [ "pallet-ema-oracle/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", - "pallet-elections-phragmen/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-conviction-voting/runtime-benchmarks", "pallet-referenda/runtime-benchmarks", @@ -210,7 +204,6 @@ std = [ "pallet-asset-registry/std", "pallet-aura/std", "pallet-balances/std", - "pallet-elections-phragmen/std", "pallet-nft/std", "pallet-marketplace/std", "pallet-session/std", @@ -242,11 +235,9 @@ std = [ "sp-version/std", "pallet-treasury/std", "pallet-collective/std", - "pallet-democracy/std", "pallet-proxy/std", "pallet-multisig/std", "pallet-scheduler/std", - "pallet-tips/std", "pallet-collator-selection/std", "pallet-authorship/std", "pallet-uniques/std", @@ -279,7 +270,6 @@ try-runtime= [ "staging-parachain-info/try-runtime", "pallet-aura/try-runtime", "pallet-balances/try-runtime", - "pallet-elections-phragmen/try-runtime", "pallet-session/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", @@ -287,11 +277,9 @@ try-runtime= [ "pallet-utility/try-runtime", "pallet-treasury/try-runtime", "pallet-collective/try-runtime", - "pallet-democracy/try-runtime", "pallet-proxy/try-runtime", "pallet-multisig/try-runtime", "pallet-scheduler/try-runtime", - "pallet-tips/try-runtime", "pallet-collator-selection/try-runtime", "pallet-authorship/try-runtime", "pallet-uniques/try-runtime", diff --git a/runtime/basilisk/src/governance/mod.rs b/runtime/basilisk/src/governance/mod.rs index c890e06324..f51f30c8a1 100644 --- a/runtime/basilisk/src/governance/mod.rs +++ b/runtime/basilisk/src/governance/mod.rs @@ -36,8 +36,6 @@ use sp_runtime::{traits::IdentityLookup, DispatchError}; pub mod origins; mod tracks; -// Old governance configurations. -pub mod old; pub type TechCommitteeMajority = EnsureProportionAtLeast; diff --git a/runtime/basilisk/src/governance/old.rs b/runtime/basilisk/src/governance/old.rs deleted file mode 100644 index 3a8646862c..0000000000 --- a/runtime/basilisk/src/governance/old.rs +++ /dev/null @@ -1,181 +0,0 @@ -// This file is part of Basilisk-node. - -// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::governance::TechnicalCollective; -use crate::*; - -use primitives::constants::{ - currency::{CENTS, DOLLARS, UNITS}, - time::{DAYS, HOURS}, -}; - -use frame_support::{ - parameter_types, - sp_runtime::{Perbill, Percent}, - traits::{EitherOfDiverse, LockIdentifier}, -}; -use frame_system::{EnsureRoot, EnsureSigned}; -use pallet_collective::EnsureProportionAtLeast; -use sp_staking::currency_to_vote::U128CurrencyToVote; - -pub type MajorityCouncilOrRoot = - EitherOfDiverse, EnsureRoot>; -pub type UnanimousCouncilOrRoot = - EitherOfDiverse, EnsureRoot>; -pub type SuperMajorityCouncilOrRoot = - EitherOfDiverse, EnsureRoot>; -pub type UnanimousTechCommitteeOrRoot = - EitherOfDiverse, EnsureRoot>; -pub type MajorityTechCommitteeOrRoot = - EitherOfDiverse, EnsureRoot>; - -parameter_types! { - pub const LaunchPeriod: BlockNumber = 3 * DAYS; - pub const VotingPeriod: BlockNumber = 3 * DAYS; - pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; - pub const MinimumDeposit: Balance = 1000 * DOLLARS; - pub const EnactmentPeriod: BlockNumber = 12 * HOURS; - // Make sure VoteLockingPeriod > EnactmentPeriod - pub const VoteLockingPeriod: BlockNumber = 6 * DAYS; - pub const CooloffPeriod: BlockNumber = 7 * DAYS; - pub const InstantAllowed: bool = true; - pub const MaxVotes: u32 = 100; - pub const MaxProposals: u32 = 100; -} - -impl pallet_democracy::Config for Runtime { - type WeightInfo = weights::pallet_democracy::BasiliskWeight; - type RuntimeEvent = RuntimeEvent; - type Scheduler = Scheduler; - type Preimages = Preimage; - type Currency = Balances; - type EnactmentPeriod = EnactmentPeriod; - type LaunchPeriod = LaunchPeriod; - type VotingPeriod = VotingPeriod; - type VoteLockingPeriod = VoteLockingPeriod; - type MinimumDeposit = MinimumDeposit; - type InstantAllowed = InstantAllowed; - type FastTrackVotingPeriod = FastTrackVotingPeriod; - type CooloffPeriod = CooloffPeriod; - type MaxVotes = MaxVotes; - type MaxProposals = MaxProposals; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; - /// A straight majority of the council can decide what their next motion is. - type ExternalOrigin = MajorityCouncilOrRoot; - /// A majority can have the next scheduled referendum be a straight majority-carries vote - type ExternalMajorityOrigin = MajorityCouncilOrRoot; - /// A unanimous council can have the next scheduled referendum be a straight default-carries - /// (NTB) vote. - type ExternalDefaultOrigin = UnanimousCouncilOrRoot; - /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote - /// be tabled immediately and with a shorter voting/enactment period. - type FastTrackOrigin = MajorityTechCommitteeOrRoot; - type InstantOrigin = UnanimousTechCommitteeOrRoot; - // To cancel a proposal which has been passed, 2/3 of the council must agree to it. - type CancellationOrigin = SuperMajorityCouncilOrRoot; - type BlacklistOrigin = EnsureRoot; - // To cancel a proposal before it has been passed, the technical committee must be unanimous or - // Root must agree. - type CancelProposalOrigin = UnanimousTechCommitteeOrRoot; - // 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; - type PalletsOrigin = OriginCaller; - type Slash = Treasury; - type SubmitOrigin = EnsureSigned; -} - -parameter_types! { - // Bond for candidacy into governance - pub const CandidacyBond: Balance = 5 * DOLLARS; - // 1 storage item created, key size is 32 bytes, value size is 16+16. - pub const VotingBondBase: Balance = CENTS; - // additional data per vote is 32 bytes (account id). - pub const VotingBondFactor: Balance = CENTS; - pub const TermDuration: BlockNumber = 7 * DAYS; - pub const DesiredMembers: u32 = 7; - pub const DesiredRunnersUp: u32 = 9; - pub const ElectionsPhragmenPalletId: LockIdentifier = *b"phrelect"; - pub const MaxElectionCandidates: u32 = 100; - pub const MaxElectionVoters: u32 = 768; - pub const MaxVotesPerVoter: u32 = 10; -} - -impl pallet_elections_phragmen::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type PalletId = ElectionsPhragmenPalletId; - type Currency = Balances; - type ChangeMembers = Council; - type InitializeMembers = (); // Set to () if defined in chain spec - type CurrencyToVote = U128CurrencyToVote; - 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 MaxCandidates = MaxElectionCandidates; - type MaxVoters = MaxElectionVoters; - type MaxVotesPerVoter = MaxVotesPerVoter; - type WeightInfo = weights::pallet_elections_phragmen::BasiliskWeight; -} - -parameter_types! { - pub const CouncilMotionDuration: BlockNumber = 5 * DAYS; - pub const CouncilMaxProposals: u32 = 13; - pub const CouncilMaxMembers: u32 = 7; - pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block; -} - -type CouncilCollective = pallet_collective::Instance1; -impl pallet_collective::Config 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 WeightInfo = weights::pallet_collective::BasiliskWeight; // use the weights from TechnicalCommittee because we are not able to benchmark both pallets - type MaxProposalWeight = MaxProposalWeight; - type SetMembersOrigin = EnsureRoot; -} - -parameter_types! { - pub const DataDepositPerByte: Balance = CENTS; - pub const TipCountdown: BlockNumber = 24 * HOURS; - pub const TipFindersFee: Percent = Percent::from_percent(1); - pub const TipReportDepositBase: Balance = 10 * DOLLARS; - pub const TipReportDepositPerByte: Balance = CENTS; - pub const MaximumReasonLength: u32 = 1024; - pub const MaxTipAmount: u128 = 200_000_000 * UNITS; -} - -impl pallet_tips::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type MaximumReasonLength = MaximumReasonLength; - type DataDepositPerByte = DataDepositPerByte; - type TipCountdown = TipCountdown; - type TipFindersFee = TipFindersFee; - type TipReportDepositBase = TipReportDepositBase; - type MaxTipAmount = MaxTipAmount; - type Tippers = Elections; - type WeightInfo = weights::pallet_tips::BasiliskWeight; -} diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index ae94d816f0..0c5bb0c03c 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -177,13 +177,9 @@ construct_runtime!( Treasury: pallet_treasury = 4, Utility: pallet_utility = 5, //NOTE: 6 - is used by Scheduler which must be after cumulus_pallet_parachain_system - Democracy: pallet_democracy exclude_parts { Config } = 7, - Elections: pallet_elections_phragmen = 8, - Council: pallet_collective:: = 9, TechnicalCommittee: pallet_collective:: = 10, Vesting: orml_vesting = 11, Proxy: pallet_proxy = 12, - Tips: pallet_tips = 13, // The order of next 4 is important, and it cannot change. Authorship: pallet_authorship = 14, @@ -585,12 +581,9 @@ mod benches { [frame_system, SystemBench::] [pallet_balances, Balances] [pallet_timestamp, Timestamp] - [pallet_democracy, Democracy] - [pallet_elections_phragmen, Elections] [pallet_treasury, Treasury] [pallet_scheduler, Scheduler] [pallet_utility, Utility] - [pallet_tips, Tips] [pallet_identity, Identity] [pallet_collective, TechnicalCommittee] [cumulus_pallet_xcmp_queue, XcmpQueue] diff --git a/runtime/basilisk/src/weights/mod.rs b/runtime/basilisk/src/weights/mod.rs index a267cb75e5..f63e83e2f8 100644 --- a/runtime/basilisk/src/weights/mod.rs +++ b/runtime/basilisk/src/weights/mod.rs @@ -9,9 +9,7 @@ pub mod pallet_collator_selection; pub mod pallet_collective; pub mod pallet_conviction_voting; pub mod pallet_currencies; -pub mod pallet_democracy; pub mod pallet_duster; -pub mod pallet_elections_phragmen; pub mod pallet_ema_oracle; pub mod pallet_identity; pub mod pallet_lbp; @@ -26,7 +24,6 @@ pub mod pallet_route_executor; pub mod pallet_scheduler; pub mod pallet_state_trie_migration; pub mod pallet_timestamp; -pub mod pallet_tips; pub mod pallet_transaction_multi_payment; pub mod pallet_transaction_pause; pub mod pallet_treasury; diff --git a/runtime/basilisk/src/weights/pallet_democracy.rs b/runtime/basilisk/src/weights/pallet_democracy.rs deleted file mode 100644 index dd6b31f4c8..0000000000 --- a/runtime/basilisk/src/weights/pallet_democracy.rs +++ /dev/null @@ -1,513 +0,0 @@ -// This file is part of Basilisk. - -// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -//! Autogenerated weights for `pallet_democracy` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` - -// Executed Command: -// ./target/release/basilisk -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet -// * -// --extrinsic -// * -// --heap-pages -// 4096 -// --steps -// 50 -// --repeat -// 20 -// --template=scripts/pallet-weight-template.hbs -// --output -// weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weights for `pallet_democracy`. -pub struct WeightInfo(PhantomData); - -/// Weights for `pallet_democracy` using the Basilisk node and recommended hardware. -pub struct BasiliskWeight(PhantomData); -impl pallet_democracy::WeightInfo for BasiliskWeight { - /// 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: `4688` - // Estimated: `18187` - // Minimum execution time: 40_882_000 picoseconds. - Weight::from_parts(41_490_000, 18187) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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: `3443` - // Estimated: `6695` - // Minimum execution time: 37_648_000 picoseconds. - Weight::from_parts(38_191_000, 6695) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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(49), added: 2524, mode: `MaxEncodedLen`) - fn vote_new() -> Weight { - // Proof Size summary in bytes: - // Measured: `3388` - // Estimated: `7260` - // Minimum execution time: 50_949_000 picoseconds. - Weight::from_parts(51_543_000, 7260) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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(49), added: 2524, mode: `MaxEncodedLen`) - fn vote_existing() -> Weight { - // Proof Size summary in bytes: - // Measured: `3410` - // Estimated: `7260` - // Minimum execution time: 53_881_000 picoseconds. - Weight::from_parts(54_729_000, 7260) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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: `249` - // Estimated: `3666` - // Minimum execution time: 27_005_000 picoseconds. - Weight::from_parts(27_671_000, 3666) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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: `5819` - // Estimated: `18187` - // Minimum execution time: 101_357_000 picoseconds. - Weight::from_parts(101_989_000, 18187) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } - /// 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: `3276` - // Estimated: `6703` - // Minimum execution time: 13_265_000 picoseconds. - Weight::from_parts(13_487_000, 6703) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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_936_000 picoseconds. - Weight::from_parts(4_078_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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_925_000 picoseconds. - Weight::from_parts(4_051_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: `147` - // Estimated: `3518` - // Minimum execution time: 25_148_000 picoseconds. - Weight::from_parts(25_542_000, 3518) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// 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: `3377` - // Estimated: `6703` - // Minimum execution time: 27_719_000 picoseconds. - Weight::from_parts(28_263_000, 6703) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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: `5704` - // Estimated: `18187` - // Minimum execution time: 79_213_000 picoseconds. - Weight::from_parts(79_685_000, 18187) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// 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: `181` - // Estimated: `3518` - // Minimum execution time: 20_061_000 picoseconds. - Weight::from_parts(20_327_000, 3518) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// 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: `127 + r * (86 ±0)` - // Estimated: `1489 + r * (2676 ±0)` - // Minimum execution time: 5_062_000 picoseconds. - Weight::from_parts(9_014_019, 1489) - // Standard Error: 5_098 - .saturating_add(Weight::from_parts(3_144_123, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .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: `127 + r * (86 ±0)` - // Estimated: `18187 + r * (2676 ±0)` - // Minimum execution time: 7_881_000 picoseconds. - Weight::from_parts(12_069_608, 18187) - // Standard Error: 4_692 - .saturating_add(Weight::from_parts(3_148_511, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .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(49), added: 2524, mode: `MaxEncodedLen`) - /// The range of component `r` is `[0, 99]`. - fn delegate(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `748 + r * (108 ±0)` - // Estimated: `19800 + r * (2676 ±0)` - // Minimum execution time: 44_233_000 picoseconds. - Weight::from_parts(49_423_414, 19800) - // Standard Error: 5_805 - .saturating_add(Weight::from_parts(4_086_926, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) - .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: `374 + r * (108 ±0)` - // Estimated: `13530 + r * (2676 ±0)` - // Minimum execution time: 20_450_000 picoseconds. - Weight::from_parts(22_246_560, 13530) - // Standard Error: 5_183 - .saturating_add(Weight::from_parts(4_102_928, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .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: 4_266_000 picoseconds. - Weight::from_parts(4_344_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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(49), added: 2524, 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: `504` - // Estimated: `7260` - // Minimum execution time: 26_551_000 picoseconds. - Weight::from_parts(37_698_736, 7260) - // Standard Error: 2_470 - .saturating_add(Weight::from_parts(38_245, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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(49), added: 2524, 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: `505 + r * (22 ±0)` - // Estimated: `7260` - // Minimum execution time: 36_247_000 picoseconds. - Weight::from_parts(37_511_365, 7260) - // Standard Error: 612 - .saturating_add(Weight::from_parts(58_087, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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: `609 + r * (26 ±0)` - // Estimated: `7260` - // Minimum execution time: 17_548_000 picoseconds. - Weight::from_parts(19_754_419, 7260) - // Standard Error: 940 - .saturating_add(Weight::from_parts(63_835, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// 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: `609 + r * (26 ±0)` - // Estimated: `7260` - // Minimum execution time: 17_142_000 picoseconds. - Weight::from_parts(19_723_996, 7260) - // Standard Error: 971 - .saturating_add(Weight::from_parts(64_204, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// 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: `Preimage::RequestStatusFor` (r:1 w:0) - /// Proof: `Preimage::RequestStatusFor` (`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: `287` - // Estimated: `3556` - // Minimum execution time: 20_461_000 picoseconds. - Weight::from_parts(20_632_000, 3556) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: `147` - // Estimated: `3518` - // Minimum execution time: 16_064_000 picoseconds. - Weight::from_parts(16_292_000, 3518) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: `Preimage::RequestStatusFor` (r:1 w:0) - /// Proof: `Preimage::RequestStatusFor` (`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: `4842` - // Estimated: `18187` - // Minimum execution time: 41_258_000 picoseconds. - Weight::from_parts(41_994_000, 18187) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: `4706` - // Estimated: `18187` - // Minimum execution time: 36_106_000 picoseconds. - Weight::from_parts(36_604_000, 18187) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Preimage::StatusFor` (r:1 w:0) - /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) - /// Storage: `Preimage::RequestStatusFor` (r:1 w:0) - /// Proof: `Preimage::RequestStatusFor` (`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: `211` - // Estimated: `3556` - // Minimum execution time: 17_962_000 picoseconds. - Weight::from_parts(18_468_000, 3556) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// 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: `159` - // Estimated: `3666` - // Minimum execution time: 18_598_000 picoseconds. - Weight::from_parts(18_956_000, 3666) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} \ No newline at end of file diff --git a/runtime/basilisk/src/weights/pallet_elections_phragmen.rs b/runtime/basilisk/src/weights/pallet_elections_phragmen.rs deleted file mode 100644 index 45163b4092..0000000000 --- a/runtime/basilisk/src/weights/pallet_elections_phragmen.rs +++ /dev/null @@ -1,316 +0,0 @@ -// This file is part of Basilisk. - -// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -//! Autogenerated weights for `pallet_elections_phragmen` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` - -// Executed Command: -// ./target/release/basilisk -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet -// * -// --extrinsic -// * -// --heap-pages -// 4096 -// --steps -// 50 -// --repeat -// 20 -// --template=scripts/pallet-weight-template.hbs -// --output -// weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weights for `pallet_elections_phragmen`. -pub struct WeightInfo(PhantomData); - -/// Weights for `pallet_elections_phragmen` using the Basilisk node and recommended hardware. -pub struct BasiliskWeight(PhantomData); -impl pallet_elections_phragmen::WeightInfo for BasiliskWeight { - /// Storage: `Elections::Candidates` (r:1 w:0) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:0) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Voting` (r:1 w:1) - /// Proof: `Elections::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(49), added: 2524, mode: `MaxEncodedLen`) - /// The range of component `v` is `[1, 10]`. - fn vote_equal(v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `471 + v * (80 ±0)` - // Estimated: `4764 + v * (80 ±0)` - // Minimum execution time: 37_096_000 picoseconds. - Weight::from_parts(37_709_221, 4764) - // Standard Error: 2_056 - .saturating_add(Weight::from_parts(125_116, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) - } - /// Storage: `Elections::Candidates` (r:1 w:0) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:0) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Voting` (r:1 w:1) - /// Proof: `Elections::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(49), added: 2524, mode: `MaxEncodedLen`) - /// The range of component `v` is `[2, 10]`. - fn vote_more(v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `441 + v * (80 ±0)` - // Estimated: `4764 + v * (80 ±0)` - // Minimum execution time: 49_254_000 picoseconds. - Weight::from_parts(50_123_415, 4764) - // Standard Error: 3_715 - .saturating_add(Weight::from_parts(101_446, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) - } - /// Storage: `Elections::Candidates` (r:1 w:0) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:0) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Voting` (r:1 w:1) - /// Proof: `Elections::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(49), added: 2524, mode: `MaxEncodedLen`) - /// The range of component `v` is `[2, 10]`. - fn vote_less(v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `473 + v * (80 ±0)` - // Estimated: `4764 + v * (80 ±0)` - // Minimum execution time: 49_624_000 picoseconds. - Weight::from_parts(50_262_896, 4764) - // Standard Error: 3_021 - .saturating_add(Weight::from_parts(103_966, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) - } - /// Storage: `Elections::Voting` (r:1 w:1) - /// Proof: `Elections::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(49), added: 2524, mode: `MaxEncodedLen`) - fn remove_voter() -> Weight { - // Proof Size summary in bytes: - // Measured: `803` - // Estimated: `4764` - // Minimum execution time: 49_535_000 picoseconds. - Weight::from_parts(50_003_000, 4764) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Elections::Candidates` (r:1 w:1) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:0) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `c` is `[1, 100]`. - fn submit_candidacy(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1347 + c * (48 ±0)` - // Estimated: `2832 + c * (48 ±0)` - // Minimum execution time: 35_237_000 picoseconds. - Weight::from_parts(35_770_382, 2832) - // Standard Error: 351 - .saturating_add(Weight::from_parts(52_908, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into())) - } - /// Storage: `Elections::Candidates` (r:1 w:1) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `c` is `[1, 100]`. - fn renounce_candidacy_candidate(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `317 + c * (48 ±0)` - // Estimated: `1794 + c * (48 ±0)` - // Minimum execution time: 30_527_000 picoseconds. - Weight::from_parts(31_354_484, 1794) - // Standard Error: 560 - .saturating_add(Weight::from_parts(27_371, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into())) - } - /// Storage: `Elections::Members` (r:1 w:1) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:1) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:0 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn renounce_candidacy_members() -> Weight { - // Proof Size summary in bytes: - // Measured: `1494` - // Estimated: `2979` - // Minimum execution time: 41_860_000 picoseconds. - Weight::from_parts(42_333_000, 2979) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: `Elections::RunnersUp` (r:1 w:1) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn renounce_candidacy_runners_up() -> Weight { - // Proof Size summary in bytes: - // Measured: `957` - // Estimated: `2442` - // Minimum execution time: 30_677_000 picoseconds. - Weight::from_parts(30_984_000, 2442) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `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: 500_000_000_000 picoseconds. - Weight::from_parts(500_000_000_000, 0) - } - /// Storage: `Elections::Members` (r:1 w:1) - /// Proof: `Elections::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: `Elections::RunnersUp` (r:1 w:1) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:0 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn remove_member_with_replacement() -> Weight { - // Proof Size summary in bytes: - // Measured: `1494` - // Estimated: `3593` - // Minimum execution time: 56_006_000 picoseconds. - Weight::from_parts(56_688_000, 3593) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: `Elections::Voting` (r:385 w:384) - /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:0) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Candidates` (r:1 w:0) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Balances::Locks` (r:384 w:384) - /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) - /// Storage: `Balances::Freezes` (r:384 w:0) - /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:384 w:384) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `v` is `[384, 768]`. - /// The range of component `d` is `[0, 384]`. - fn clean_defunct_voters(v: u32, d: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + d * (631 ±0) + v * (56 ±0)` - // Estimated: `32188 + d * (3774 ±1) + v * (24 ±0)` - // Minimum execution time: 9_285_000 picoseconds. - Weight::from_parts(9_984_000, 32188) - // Standard Error: 10_326 - .saturating_add(Weight::from_parts(99_198, 0).saturating_mul(v.into())) - // Standard Error: 22_488 - .saturating_add(Weight::from_parts(53_664_147, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(d.into()))) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 3774).saturating_mul(d.into())) - .saturating_add(Weight::from_parts(0, 24).saturating_mul(v.into())) - } - /// Storage: `Elections::Candidates` (r:1 w:1) - /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:1) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::RunnersUp` (r:1 w:1) - /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Voting` (r:769 w:0) - /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:84 w:84) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Elections::ElectionRounds` (r:1 w:1) - /// Proof: `Elections::ElectionRounds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:0 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:0 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `c` is `[1, 100]`. - /// The range of component `v` is `[1, 768]`. - /// The range of component `e` is `[768, 7680]`. - fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + c * (10 ±0) + e * (27 ±0) + v * (414 ±0)` - // Estimated: `278823 + c * (2405 ±3) + e * (14 ±0) + v * (2572 ±3)` - // Minimum execution time: 2_817_465_000 picoseconds. - Weight::from_parts(2_824_172_000, 278823) - // Standard Error: 334_423 - .saturating_add(Weight::from_parts(15_816_287, 0).saturating_mul(v.into())) - // Standard Error: 34_888 - .saturating_add(Weight::from_parts(1_105_213, 0).saturating_mul(e.into())) - .saturating_add(T::DbWeight::get().reads(32_u64)) - .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_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2405).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 14).saturating_mul(e.into())) - .saturating_add(Weight::from_parts(0, 2572).saturating_mul(v.into())) - } -} \ No newline at end of file diff --git a/runtime/basilisk/src/weights/pallet_tips.rs b/runtime/basilisk/src/weights/pallet_tips.rs deleted file mode 100644 index 3571577d38..0000000000 --- a/runtime/basilisk/src/weights/pallet_tips.rs +++ /dev/null @@ -1,165 +0,0 @@ -// This file is part of Basilisk. - -// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -//! Autogenerated weights for `pallet_tips` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` - -// Executed Command: -// ./target/release/basilisk -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet -// * -// --extrinsic -// * -// --heap-pages -// 4096 -// --steps -// 50 -// --repeat -// 20 -// --template=scripts/pallet-weight-template.hbs -// --output -// weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weights for `pallet_tips`. -pub struct WeightInfo(PhantomData); - -/// Weights for `pallet_tips` using the Basilisk node and recommended hardware. -pub struct BasiliskWeight(PhantomData); -impl pallet_tips::WeightInfo for BasiliskWeight { - /// Storage: `Tips::Reasons` (r:1 w:1) - /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Tips` (r:1 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `r` is `[0, 1024]`. - fn report_awesome(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `3` - // Estimated: `3468` - // Minimum execution time: 32_221_000 picoseconds. - Weight::from_parts(32_914_322, 3468) - // Standard Error: 30 - .saturating_add(Weight::from_parts(1_763, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Tips::Tips` (r:1 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Reasons` (r:0 w:1) - /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn retract_tip() -> Weight { - // Proof Size summary in bytes: - // Measured: `220` - // Estimated: `3685` - // Minimum execution time: 30_261_000 picoseconds. - Weight::from_parts(30_721_000, 3685) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Reasons` (r:1 w:1) - /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Tips` (r:0 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `r` is `[0, 1024]`. - /// The range of component `t` is `[1, 7]`. - fn tip_new(r: u32, t: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `238 + t * (64 ±0)` - // Estimated: `3703 + t * (64 ±0)` - // Minimum execution time: 21_650_000 picoseconds. - Weight::from_parts(21_760_295, 3703) - // Standard Error: 20 - .saturating_add(Weight::from_parts(1_651, 0).saturating_mul(r.into())) - // Standard Error: 3_122 - .saturating_add(Weight::from_parts(76_330, 0).saturating_mul(t.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(t.into())) - } - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Tips` (r:1 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `t` is `[1, 7]`. - fn tip(t: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `459 + t * (112 ±0)` - // Estimated: `3924 + t * (112 ±0)` - // Minimum execution time: 17_723_000 picoseconds. - Weight::from_parts(18_130_343, 3924) - // Standard Error: 4_331 - .saturating_add(Weight::from_parts(143_705, 0).saturating_mul(t.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 112).saturating_mul(t.into())) - } - /// Storage: `Tips::Tips` (r:1 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Elections::Members` (r:1 w:0) - /// Proof: `Elections::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: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `t` is `[1, 7]`. - fn close_tip(t: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `459 + t * (112 ±0)` - // Estimated: `3959 + t * (107 ±0)` - // Minimum execution time: 63_616_000 picoseconds. - Weight::from_parts(65_118_923, 3959) - // Standard Error: 13_563 - .saturating_add(Weight::from_parts(12_091, 0).saturating_mul(t.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 107).saturating_mul(t.into())) - } - /// Storage: `Tips::Tips` (r:1 w:1) - /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tips::Reasons` (r:0 w:1) - /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `t` is `[1, 7]`. - fn slash_tip(t: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `268` - // Estimated: `3733` - // Minimum execution time: 16_009_000 picoseconds. - Weight::from_parts(16_410_422, 3733) - // Standard Error: 2_236 - .saturating_add(Weight::from_parts(40_034, 0).saturating_mul(t.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } -} \ No newline at end of file From 8e1dbc4e0c59914ccd0d63013429285392266cfd Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Tue, 10 Sep 2024 14:41:25 +0200 Subject: [PATCH 2/9] fix integration tests --- integration-tests/src/transact_call_filter.rs | 9 +++++---- runtime/basilisk/src/system.rs | 6 +----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/integration-tests/src/transact_call_filter.rs b/integration-tests/src/transact_call_filter.rs index d232e07ad7..5d08447160 100644 --- a/integration-tests/src/transact_call_filter.rs +++ b/integration-tests/src/transact_call_filter.rs @@ -117,10 +117,11 @@ fn blocked_transact_calls_should_not_pass_filter() { OtherParachain::execute_with(|| { // filtered by SafeCallFilter - let call = pallet_tips::Call::::report_awesome { - reason: vec![0, 10], - who: BOB.into(), + let call = pallet_treasury::Call::::spend_local { + amount: UNITS, + beneficiary: ALICE.into() }; + let bsx_loc = Location::new( 1, cumulus_primitives_core::Junctions::X2(Arc::new( @@ -150,7 +151,7 @@ fn blocked_transact_calls_should_not_pass_filter() { Transact { require_weight_at_most: Weight::from_parts(10_000_000_000, 0u64), origin_kind: OriginKind::Native, - call: basilisk_runtime::RuntimeCall::Tips(call).encode().into(), + call: basilisk_runtime::RuntimeCall::Treasury(call).encode().into(), }, ExpectTransactStatus(MaybeErrorCode::Success), RefundSurplus, diff --git a/runtime/basilisk/src/system.rs b/runtime/basilisk/src/system.rs index 00be8436db..55bdc56162 100644 --- a/runtime/basilisk/src/system.rs +++ b/runtime/basilisk/src/system.rs @@ -300,12 +300,8 @@ impl InstanceFilter for ProxyType { ProxyType::CancelProxy => matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })), ProxyType::Governance => matches!( c, - RuntimeCall::Democracy(..) - | RuntimeCall::Council(..) - | RuntimeCall::TechnicalCommittee(..) - | RuntimeCall::Elections(..) + RuntimeCall::TechnicalCommittee(..) | RuntimeCall::Treasury(..) - | RuntimeCall::Tips(..) | RuntimeCall::Utility(..) ), ProxyType::Exchange => matches!(c, RuntimeCall::XYK(..) | RuntimeCall::LBP(..) | RuntimeCall::NFT(..)), From 131cda2556d9940536be151545cbee934c95e69b Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Tue, 17 Sep 2024 14:28:41 +0200 Subject: [PATCH 3/9] Remove locks and cleanup state --- Cargo.lock | 3 ++ Cargo.toml | 5 +++ runtime/basilisk/Cargo.toml | 12 +++++++ runtime/basilisk/src/lib.rs | 72 +++++++++++++++++++++++++++++++++---- 4 files changed, 86 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 895b9ebc8d..61e460cb56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -992,7 +992,9 @@ dependencies = [ "pallet-collective", "pallet-conviction-voting", "pallet-currencies", + "pallet-democracy 28.0.0", "pallet-duster", + "pallet-elections-phragmen", "pallet-ema-oracle", "pallet-identity", "pallet-lbp", @@ -1010,6 +1012,7 @@ dependencies = [ "pallet-session", "pallet-state-trie-migration", "pallet-timestamp", + "pallet-tips", "pallet-transaction-multi-payment", "pallet-transaction-pause", "pallet-transaction-payment", diff --git a/Cargo.toml b/Cargo.toml index 1e9f24987d..8ce5ea8215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,9 @@ pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -85,6 +87,7 @@ pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk", pallet-state-trie-migration = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -330,6 +333,7 @@ pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -339,6 +343,7 @@ pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index f6bba91f07..22aad7ab03 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -28,7 +28,10 @@ pallet-xyk-liquidity-mining = { workspace = true , default-features = false } pallet-xyk-liquidity-mining-benchmarking = { workspace = true, optional = true, default-features = false } pallet-treasury = { workspace = true } +pallet-democracy = { workspace = true } pallet-scheduler = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-tips = { workspace = true } pallet-identity = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -150,9 +153,11 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "pallet-asset-registry/runtime-benchmarks", "pallet-duster/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-utility/runtime-benchmarks", + "pallet-tips/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", @@ -163,6 +168,7 @@ runtime-benchmarks = [ "pallet-ema-oracle/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-conviction-voting/runtime-benchmarks", "pallet-referenda/runtime-benchmarks", @@ -204,6 +210,7 @@ std = [ "pallet-asset-registry/std", "pallet-aura/std", "pallet-balances/std", + "pallet-elections-phragmen/std", "pallet-nft/std", "pallet-marketplace/std", "pallet-session/std", @@ -235,9 +242,11 @@ std = [ "sp-version/std", "pallet-treasury/std", "pallet-collective/std", + "pallet-democracy/std", "pallet-proxy/std", "pallet-multisig/std", "pallet-scheduler/std", + "pallet-tips/std", "pallet-collator-selection/std", "pallet-authorship/std", "pallet-uniques/std", @@ -270,6 +279,7 @@ try-runtime= [ "staging-parachain-info/try-runtime", "pallet-aura/try-runtime", "pallet-balances/try-runtime", + "pallet-elections-phragmen/try-runtime", "pallet-session/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", @@ -277,9 +287,11 @@ try-runtime= [ "pallet-utility/try-runtime", "pallet-treasury/try-runtime", "pallet-collective/try-runtime", + "pallet-democracy/try-runtime", "pallet-proxy/try-runtime", "pallet-multisig/try-runtime", "pallet-scheduler/try-runtime", + "pallet-tips/try-runtime", "pallet-collator-selection/try-runtime", "pallet-authorship/try-runtime", "pallet-uniques/try-runtime", diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 0c5bb0c03c..15cbc50a01 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -270,14 +270,74 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - frame_support::migrations::RemovePallet::DbWeight>, - frame_support::migrations::RemovePallet::DbWeight>, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - pallet_identity::migration::versioned::V0ToV1, // We have currently 89 identities in basllisk, so limit of 200 should be enough - ), + migrations::Migrations, >; +pub mod migrations { + use super::*; + use frame_support::traits::LockIdentifier; + use frame_system::pallet_prelude::BlockNumberFor; + + parameter_types! { + pub const DemocracyPalletName: &'static str = "Democracy"; + pub const CouncilPalletName: &'static str = "Council"; + // pub const TechnicalCommitteePalletName: &'static str = "TechnicalCommittee"; + pub const PhragmenElectionPalletName: &'static str = "PhragmenElection"; + // pub const TechnicalMembershipPalletName: &'static str = "TechnicalMembership"; + pub const TipsPalletName: &'static str = "Tips"; + pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; + pub const DataDepositPerByte: Balance = primitives::constants::currency::CENTS; + pub const TipReportDepositBase: Balance = 10 * primitives::constants::currency::DOLLARS; + } + + // Special Config for Gov V1 pallets, allowing us to run migrations for them without + // implementing their configs on [`Runtime`]. + pub struct UnlockConfig; + impl pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockConfig for UnlockConfig { + type Currency = Balances; + type MaxVotes = ConstU32<100>; + type MaxDeposits = ConstU32<100>; + type AccountId = AccountId; + type BlockNumber = BlockNumberFor; + type DbWeight = ::DbWeight; + type PalletName = DemocracyPalletName; + } + impl pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockConfig + for UnlockConfig + { + type Currency = Balances; + type MaxVotesPerVoter = ConstU32<16>; + type PalletId = PhragmenElectionPalletId; + type AccountId = AccountId; + type DbWeight = ::DbWeight; + type PalletName = PhragmenElectionPalletName; + } + impl pallet_tips::migrations::unreserve_deposits::UnlockConfig<()> for UnlockConfig { + type Currency = Balances; + type Hash = Hash; + type DataDepositPerByte = DataDepositPerByte; + type TipReportDepositBase = TipReportDepositBase; + type AccountId = AccountId; + type BlockNumber = BlockNumberFor; + type DbWeight = ::DbWeight; + type PalletName = TipsPalletName; + } + + pub type Migrations = ( + // Unlock/unreserve balances from Gov v1 pallets that hold them + // https://github.com/paritytech/polkadot/issues/6749 + pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, + pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, + pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, + + // Delete storage key/values from all Gov v1 pallets + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + ); +} + parameter_types! { pub const DmpQueuePalletName: &'static str = "DmpQueue"; pub const XcmRateLimiterPalletName: &'static str = "XcmRateLimiter"; From f1bfc7c197472f1620bf19b1138b467e02c9774b Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Tue, 17 Sep 2024 15:46:07 +0200 Subject: [PATCH 4/9] merge conflicts --- runtime/basilisk/src/lib.rs | 289 +----------------------------------- 1 file changed, 1 insertion(+), 288 deletions(-) diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index dfd9ab87b3..23df91aafb 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -48,6 +48,7 @@ pub use governance::*; pub use system::*; pub use xcm::*; +use frame_support::parameter_types; use frame_support::sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT}, @@ -333,294 +334,6 @@ pub mod migrations { ); } -parameter_types! { - pub const DmpQueuePalletName: &'static str = "DmpQueue"; - pub const XcmRateLimiterPalletName: &'static str = "XcmRateLimiter"; -} - -impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: Block) { - Executive::execute_block(block) - } - - fn initialize_block(header: &::Header) { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - - fn metadata_versions() -> sp_std::vec::Vec { - Runtime::metadata_versions() - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents( - block: Block, - data: sp_inherents::InherentData, - ) -> sp_inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - block_hash: ::Hash, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx, block_hash) - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl sp_session::SessionKeys for Runtime { - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - opaque::SessionKeys::decode_into_raw_public_keys(&encoded) - } - - fn generate_session_keys(seed: Option>) -> Vec { - opaque::SessionKeys::generate(seed) - } - } - - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) - } - - fn authorities() -> Vec { - Aura::authorities().into_inner() - } - } - - impl cumulus_primitives_core::CollectCollationInfo for Runtime { - fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { - ParachainSystem::collect_collation_info(header) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { - log::info!("try-runtime::on_runtime_upgrade."); - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, BlockWeights::get().max_block) - } - - fn execute_block( - block: Block, - state_root_check: bool, - signature_check: bool, - select: frame_try_runtime::TryStateSelect, - ) -> Weight { - Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() - } - } - - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { - fn query_info( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - - fn query_fee_details( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn benchmark_metadata(extra: bool) -> ( - Vec, - Vec, - ) { - use frame_benchmarking::{Benchmarking, BenchmarkList}; - use frame_support::traits::StorageInfoTrait; - use orml_benchmarking::list_benchmark as orml_list_benchmark; - - use frame_system_benchmarking::Pallet as SystemBench; - use pallet_xyk_liquidity_mining_benchmarking::Pallet as XYKLiquidityMiningBench; - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; - - let mut list = Vec::::new(); - list_benchmarks!(list, extra); - - orml_list_benchmark!(list, extra, pallet_currencies, benchmarking::currencies); - orml_list_benchmark!(list, extra, pallet_xyk, benchmarking::xyk); - orml_list_benchmark!(list, extra, orml_tokens, benchmarking::tokens); - orml_list_benchmark!(list, extra, orml_vesting, benchmarking::vesting); - orml_list_benchmark!(list, extra, pallet_duster, benchmarking::duster); - orml_list_benchmark!(list, extra, pallet_transaction_multi_payment, benchmarking::multi_payment); - orml_list_benchmark!(list, extra, pallet_route_executor, benchmarking::route_executor); - orml_list_benchmark!(list, extra, pallet_marketplace, benchmarking::marketplace); - let storage_info = AllPalletsWithSystem::storage_info(); - - (list, storage_info) - } - - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch}; - use frame_support::traits::TrackedStorageKey; - use sp_core::Get; - use sp_std::sync::Arc; - use primitives::constants::chain::CORE_ASSET_ID; - - use orml_benchmarking::add_benchmark as orml_add_benchmark; - - use frame_system_benchmarking::Pallet as SystemBench; - use pallet_xyk_liquidity_mining_benchmarking::Pallet as XYKLiquidityMiningBench; - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; - - impl frame_system_benchmarking::Config for Runtime { - fn setup_set_code_requirements(code: &sp_std::vec::Vec) -> Result<(), BenchmarkError> { - ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); - Ok(()) - } - - fn verify_set_code() { - System::assert_last_event(cumulus_pallet_parachain_system::Event::::ValidationFunctionStored.into()); - } - } - - parameter_types! { - pub const RandomParaId: ParaId = ParaId::new(22222222); - pub const ExistentialDeposit: u128= 1_000_000_000_000; - pub AssetLocation: Location = Location::new(1, cumulus_primitives_core::Junctions::X2( - Arc::new([cumulus_primitives_core::Junction::Parachain(ParachainInfo::get().into()), - cumulus_primitives_core::Junction::GeneralIndex(CORE_ASSET_ID.into()) - ]) - )); - } - - use cumulus_primitives_core::ParaId; - use polkadot_xcm::latest::prelude::{Location, AssetId, Fungible, Asset, ParentThen, Parachain, Parent}; - - impl pallet_xcm::benchmarking::Config for Runtime { - fn reachable_dest() -> Option { - Some(Parent.into()) - } - - fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - Some(( - Asset { - fun: Fungible(ExistentialDeposit::get()), - id: AssetId(AssetLocation::get()) - }, - Parent.into(), - )) - } - - fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { - Some(( - Asset { - fun: Fungible(ExistentialDeposit::get()), - id: AssetId(AssetLocation::get()) - }, - ParentThen(Parachain(RandomParaId::get().into()).into()).into(), - )) - } - } - - impl pallet_xyk_liquidity_mining_benchmarking::Config for Runtime {} - - let whitelist: Vec = vec![ - // Block Number - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), - // Total Issuance - hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), - // Execution Phase - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), - // Event Count - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), - // System Events - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), - // Treasury Account - frame_system::Account::::hashed_key_for(Treasury::account_id()).into() - ]; - - let mut batches = Vec::::new(); - let params = (&config, &whitelist); - add_benchmarks!(params, batches); - - orml_add_benchmark!(params, batches, pallet_xyk, benchmarking::xyk); - orml_add_benchmark!(params, batches, pallet_currencies, benchmarking::currencies); - orml_add_benchmark!(params, batches, orml_tokens, benchmarking::tokens); - orml_add_benchmark!(params, batches, orml_vesting, benchmarking::vesting); - orml_add_benchmark!(params, batches, pallet_duster, benchmarking::duster); - orml_add_benchmark!(params, batches, pallet_transaction_multi_payment, benchmarking::multi_payment); - orml_add_benchmark!(params, batches, pallet_route_executor, benchmarking::route_executor); - orml_add_benchmark!(params, batches, pallet_marketplace, benchmarking::marketplace); - - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } - Ok(batches) - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() - } - - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) - } - } -} - #[cfg(feature = "runtime-benchmarks")] mod benches { frame_support::parameter_types! { From 9e4320ee9df9ef84d66404fc4ff4407d7b64c3b1 Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Wed, 18 Sep 2024 12:03:33 +0200 Subject: [PATCH 5/9] restor pallet_democracy --- runtime/basilisk/src/governance/mod.rs | 2 + runtime/basilisk/src/governance/old.rs | 79 +++ runtime/basilisk/src/lib.rs | 14 +- runtime/basilisk/src/weights/mod.rs | 1 + .../basilisk/src/weights/pallet_democracy.rs | 511 ++++++++++++++++++ 5 files changed, 595 insertions(+), 12 deletions(-) create mode 100644 runtime/basilisk/src/governance/old.rs create mode 100644 runtime/basilisk/src/weights/pallet_democracy.rs diff --git a/runtime/basilisk/src/governance/mod.rs b/runtime/basilisk/src/governance/mod.rs index 7d2de55687..4ab8562145 100644 --- a/runtime/basilisk/src/governance/mod.rs +++ b/runtime/basilisk/src/governance/mod.rs @@ -36,6 +36,8 @@ use sp_runtime::{traits::IdentityLookup, DispatchError}; pub mod origins; mod tracks; +// Old governance pallet, remove once storage is safe to wipe (6mo voting lockup). +pub mod old; pub type TechCommitteeMajority = EnsureProportionAtLeast; diff --git a/runtime/basilisk/src/governance/old.rs b/runtime/basilisk/src/governance/old.rs new file mode 100644 index 0000000000..8ab47b4d5d --- /dev/null +++ b/runtime/basilisk/src/governance/old.rs @@ -0,0 +1,79 @@ +// This file is part of Basilisk-node. + +// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::governance::TechnicalCollective; +use crate::*; + +use primitives::constants::{ + currency::DOLLARS, + time::{DAYS, HOURS}, +}; + +use frame_support::parameter_types; +use frame_system::{EnsureRoot, EnsureSigned}; + +parameter_types! { + pub const LaunchPeriod: BlockNumber = 3 * DAYS; + pub const VotingPeriod: BlockNumber = 3 * DAYS; + pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; + pub const MinimumDeposit: Balance = 1000 * DOLLARS; + pub const EnactmentPeriod: BlockNumber = 12 * HOURS; + // Make sure VoteLockingPeriod > EnactmentPeriod + pub const VoteLockingPeriod: BlockNumber = 6 * DAYS; + pub const CooloffPeriod: BlockNumber = 7 * DAYS; + pub const InstantAllowed: bool = true; + pub const MaxVotes: u32 = 100; + pub const MaxProposals: u32 = 100; +} + +impl pallet_democracy::Config for Runtime { + type WeightInfo = weights::pallet_democracy::BasiliskWeight; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Preimages = Preimage; + type Currency = Balances; + type EnactmentPeriod = EnactmentPeriod; + type LaunchPeriod = LaunchPeriod; + type VotingPeriod = VotingPeriod; + type VoteLockingPeriod = VoteLockingPeriod; + type MinimumDeposit = MinimumDeposit; + type InstantAllowed = InstantAllowed; + type FastTrackVotingPeriod = FastTrackVotingPeriod; + type CooloffPeriod = CooloffPeriod; + type MaxVotes = MaxVotes; + type MaxProposals = MaxProposals; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; + type ExternalOrigin = EnsureRoot; + type ExternalMajorityOrigin = EnsureRoot; + type ExternalDefaultOrigin = EnsureRoot; + /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote + /// be tabled immediately and with a shorter voting/enactment period. + type FastTrackOrigin = EnsureRoot; + type InstantOrigin = EnsureRoot; + type CancellationOrigin = EnsureRoot; + type BlacklistOrigin = EnsureRoot; + // To cancel a proposal before it has been passed, the technical committee must be unanimous or + // Root must agree. + type CancelProposalOrigin = EnsureRoot; + // 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; + type PalletsOrigin = OriginCaller; + type Slash = Treasury; + type SubmitOrigin = EnsureSigned; +} diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 23df91aafb..698dc1b1ea 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -171,6 +171,7 @@ construct_runtime!( Treasury: pallet_treasury = 4, Utility: pallet_utility = 5, //NOTE: 6 - is used by Scheduler which must be after cumulus_pallet_parachain_system + Democracy: pallet_democracy exclude_parts { Config } = 7, TechnicalCommittee: pallet_collective:: = 10, Vesting: orml_vesting = 11, Proxy: pallet_proxy = 12, @@ -273,7 +274,6 @@ pub mod migrations { use frame_system::pallet_prelude::BlockNumberFor; parameter_types! { - pub const DemocracyPalletName: &'static str = "Democracy"; pub const CouncilPalletName: &'static str = "Council"; // pub const TechnicalCommitteePalletName: &'static str = "TechnicalCommittee"; pub const PhragmenElectionPalletName: &'static str = "PhragmenElection"; @@ -287,15 +287,6 @@ pub mod migrations { // Special Config for Gov V1 pallets, allowing us to run migrations for them without // implementing their configs on [`Runtime`]. pub struct UnlockConfig; - impl pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockConfig for UnlockConfig { - type Currency = Balances; - type MaxVotes = ConstU32<100>; - type MaxDeposits = ConstU32<100>; - type AccountId = AccountId; - type BlockNumber = BlockNumberFor; - type DbWeight = ::DbWeight; - type PalletName = DemocracyPalletName; - } impl pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockConfig for UnlockConfig { @@ -323,11 +314,9 @@ pub mod migrations { // Unlock/unreserve balances from Gov v1 pallets that hold them // https://github.com/paritytech/polkadot/issues/6749 pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, - pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, // Delete storage key/values from all Gov v1 pallets - frame_support::migrations::RemovePallet::DbWeight>, frame_support::migrations::RemovePallet::DbWeight>, frame_support::migrations::RemovePallet::DbWeight>, frame_support::migrations::RemovePallet::DbWeight>, @@ -349,6 +338,7 @@ mod benches { [frame_system, SystemBench::] [pallet_balances, Balances] [pallet_timestamp, Timestamp] + [pallet_democracy, Democracy] [pallet_treasury, Treasury] [pallet_scheduler, Scheduler] [pallet_utility, Utility] diff --git a/runtime/basilisk/src/weights/mod.rs b/runtime/basilisk/src/weights/mod.rs index f63e83e2f8..ec969176fc 100644 --- a/runtime/basilisk/src/weights/mod.rs +++ b/runtime/basilisk/src/weights/mod.rs @@ -9,6 +9,7 @@ pub mod pallet_collator_selection; pub mod pallet_collective; pub mod pallet_conviction_voting; pub mod pallet_currencies; +pub mod pallet_democracy; pub mod pallet_duster; pub mod pallet_ema_oracle; pub mod pallet_identity; diff --git a/runtime/basilisk/src/weights/pallet_democracy.rs b/runtime/basilisk/src/weights/pallet_democracy.rs new file mode 100644 index 0000000000..c1b5b5e263 --- /dev/null +++ b/runtime/basilisk/src/weights/pallet_democracy.rs @@ -0,0 +1,511 @@ +// This file is part of Basilisk. + +// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +//! Autogenerated weights for `pallet_democracy` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 +//! DATE: 2024-08-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/basilisk-runtime/basilisk_runtime.compact.compressed.wasm +// --extrinsic +// +// --heap-pages=4096 +// --steps=50 +// --repeat=20 +// --template=scripts/pallet-weight-template.hbs +// --pallet +// pallet_democracy +// --output=./weights/pallet_democracy + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weights for `pallet_democracy`. +pub struct WeightInfo(PhantomData); + +/// Weights for `pallet_democracy` using the Basilisk node and recommended hardware. +pub struct BasiliskWeight(PhantomData); +impl pallet_democracy::WeightInfo for BasiliskWeight { + /// 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: `4627` + // Estimated: `18187` + // Minimum execution time: 46_083_000 picoseconds. + Weight::from_parts(46_453_000, 18187) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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: `3406` + // Estimated: `6695` + // Minimum execution time: 44_498_000 picoseconds. + Weight::from_parts(45_222_000, 6695) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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(49), added: 2524, mode: `MaxEncodedLen`) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `3205` + // Estimated: `7260` + // Minimum execution time: 55_625_000 picoseconds. + Weight::from_parts(56_441_000, 7260) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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(49), added: 2524, mode: `MaxEncodedLen`) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3227` + // Estimated: `7260` + // Minimum execution time: 58_861_000 picoseconds. + Weight::from_parts(59_262_000, 7260) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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: `190` + // Estimated: `3666` + // Minimum execution time: 29_638_000 picoseconds. + Weight::from_parts(30_055_000, 3666) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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: `5724` + // Estimated: `18187` + // Minimum execution time: 123_956_000 picoseconds. + Weight::from_parts(125_240_000, 18187) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// 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: `3214` + // Estimated: `6703` + // Minimum execution time: 12_402_000 picoseconds. + Weight::from_parts(12_669_000, 6703) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: 4_113_000 picoseconds. + Weight::from_parts(4_225_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: 4_187_000 picoseconds. + Weight::from_parts(4_416_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: `87` + // Estimated: `3518` + // Minimum execution time: 27_278_000 picoseconds. + Weight::from_parts(27_999_000, 3518) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// 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: `3317` + // Estimated: `6703` + // Minimum execution time: 30_941_000 picoseconds. + Weight::from_parts(31_478_000, 6703) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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: `5609` + // Estimated: `18187` + // Minimum execution time: 100_203_000 picoseconds. + Weight::from_parts(100_966_000, 18187) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// 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: `121` + // Estimated: `3518` + // Minimum execution time: 21_286_000 picoseconds. + Weight::from_parts(21_774_000, 3518) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// 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: `68 + r * (86 ±0)` + // Estimated: `1489 + r * (2676 ±0)` + // Minimum execution time: 2_676_000 picoseconds. + Weight::from_parts(8_775_227, 1489) + // Standard Error: 5_130 + .saturating_add(Weight::from_parts(3_612_685, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .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: `68 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 5_799_000 picoseconds. + Weight::from_parts(12_578_275, 18187) + // Standard Error: 4_848 + .saturating_add(Weight::from_parts(3_600_799, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .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(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 99]`. + fn delegate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `571 + r * (108 ±0)` + // Estimated: `19800 + r * (2676 ±0)` + // Minimum execution time: 47_607_000 picoseconds. + Weight::from_parts(54_081_819, 19800) + // Standard Error: 6_180 + .saturating_add(Weight::from_parts(4_760_297, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .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: `314 + r * (108 ±0)` + // Estimated: `13530 + r * (2676 ±0)` + // Minimum execution time: 20_646_000 picoseconds. + Weight::from_parts(22_829_571, 13530) + // Standard Error: 8_065 + .saturating_add(Weight::from_parts(4_768_977, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .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: 4_519_000 picoseconds. + Weight::from_parts(4_626_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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(49), added: 2524, 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: `337` + // Estimated: `7260` + // Minimum execution time: 26_306_000 picoseconds. + Weight::from_parts(40_214_749, 7260) + // Standard Error: 3_114 + .saturating_add(Weight::from_parts(35_180, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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(49), added: 2524, 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: `338 + r * (22 ±0)` + // Estimated: `7260` + // Minimum execution time: 38_275_000 picoseconds. + Weight::from_parts(39_998_390, 7260) + // Standard Error: 569 + .saturating_add(Weight::from_parts(59_540, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// 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: `548 + r * (26 ±0)` + // Estimated: `7260` + // Minimum execution time: 18_101_000 picoseconds. + Weight::from_parts(21_024_907, 7260) + // Standard Error: 1_124 + .saturating_add(Weight::from_parts(72_995, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// 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: `548 + r * (26 ±0)` + // Estimated: `7260` + // Minimum execution time: 17_868_000 picoseconds. + Weight::from_parts(20_861_311, 7260) + // Standard Error: 1_168 + .saturating_add(Weight::from_parts(76_810, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// 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: `Preimage::RequestStatusFor` (r:1 w:0) + /// Proof: `Preimage::RequestStatusFor` (`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: `98` + // Estimated: `3556` + // Minimum execution time: 19_457_000 picoseconds. + Weight::from_parts(19_844_000, 3556) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: `87` + // Estimated: `3518` + // Minimum execution time: 15_573_000 picoseconds. + Weight::from_parts(15_934_000, 3518) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: `Preimage::RequestStatusFor` (r:1 w:0) + /// Proof: `Preimage::RequestStatusFor` (`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: `4654` + // Estimated: `18187` + // Minimum execution time: 46_260_000 picoseconds. + Weight::from_parts(46_673_000, 18187) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: `4644` + // Estimated: `18187` + // Minimum execution time: 41_204_000 picoseconds. + Weight::from_parts(41_584_000, 18187) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::RequestStatusFor` (r:1 w:0) + /// Proof: `Preimage::RequestStatusFor` (`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: `84` + // Estimated: `3556` + // Minimum execution time: 17_928_000 picoseconds. + Weight::from_parts(18_390_000, 3556) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// 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: `100` + // Estimated: `3666` + // Minimum execution time: 18_480_000 picoseconds. + Weight::from_parts(18_893_000, 3666) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} From 3b876938a2d0f48a48e49f703518f37f6ea882ff Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Wed, 18 Sep 2024 12:05:44 +0200 Subject: [PATCH 6/9] versions and fmt --- Cargo.lock | 6 +++--- integration-tests/Cargo.toml | 2 +- integration-tests/src/transact_call_filter.rs | 2 +- node/Cargo.toml | 2 +- runtime/basilisk/Cargo.toml | 2 +- runtime/basilisk/src/lib.rs | 13 ++++++------- runtime/basilisk/src/system.rs | 4 +--- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b576c5405b..83ad56e56f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -891,7 +891,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "basilisk" -version = "15.0.0" +version = "16.0.0" dependencies = [ "basilisk-runtime", "clap", @@ -973,7 +973,7 @@ dependencies = [ [[package]] name = "basilisk-runtime" -version = "119.0.0" +version = "120.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -11178,7 +11178,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.0.3" +version = "1.0.4" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 60b423ed18..cf5a340c85 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.0.3" +version = "1.0.4" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/integration-tests/src/transact_call_filter.rs b/integration-tests/src/transact_call_filter.rs index 3ddb248a48..666e59d408 100644 --- a/integration-tests/src/transact_call_filter.rs +++ b/integration-tests/src/transact_call_filter.rs @@ -119,7 +119,7 @@ fn blocked_transact_calls_should_not_pass_filter() { // filtered by SafeCallFilter let call = pallet_treasury::Call::::spend_local { amount: UNITS, - beneficiary: ALICE.into() + beneficiary: ALICE.into(), }; let bsx_loc = Location::new( diff --git a/node/Cargo.toml b/node/Cargo.toml index 67321e501c..87055455c7 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk" -version = "15.0.0" +version = "16.0.0" description = "Basilisk node" authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index c4b45f20e0..5a85ecfdb0 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk-runtime" -version = "119.0.0" +version = "120.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 698dc1b1ea..827fb39a47 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -100,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("basilisk"), impl_name: create_runtime_str!("basilisk"), authoring_version: 1, - spec_version: 119, + spec_version: 120, impl_version: 0, apis: apis::RUNTIME_API_VERSIONS, transaction_version: 1, @@ -287,9 +287,7 @@ pub mod migrations { // Special Config for Gov V1 pallets, allowing us to run migrations for them without // implementing their configs on [`Runtime`]. pub struct UnlockConfig; - impl pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockConfig - for UnlockConfig - { + impl pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockConfig for UnlockConfig { type Currency = Balances; type MaxVotesPerVoter = ConstU32<16>; type PalletId = PhragmenElectionPalletId; @@ -310,15 +308,16 @@ pub mod migrations { pub type Migrations = ( pallet_collator_selection::migration::v2::MigrationToV2, - // Unlock/unreserve balances from Gov v1 pallets that hold them // https://github.com/paritytech/polkadot/issues/6749 pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, - // Delete storage key/values from all Gov v1 pallets frame_support::migrations::RemovePallet::DbWeight>, - frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet< + PhragmenElectionPalletName, + ::DbWeight, + >, frame_support::migrations::RemovePallet::DbWeight>, ); } diff --git a/runtime/basilisk/src/system.rs b/runtime/basilisk/src/system.rs index 99f51625f2..a17ee7b52f 100644 --- a/runtime/basilisk/src/system.rs +++ b/runtime/basilisk/src/system.rs @@ -307,9 +307,7 @@ impl InstanceFilter for ProxyType { ProxyType::CancelProxy => matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })), ProxyType::Governance => matches!( c, - RuntimeCall::TechnicalCommittee(..) - | RuntimeCall::Treasury(..) - | RuntimeCall::Utility(..) + RuntimeCall::TechnicalCommittee(..) | RuntimeCall::Treasury(..) | RuntimeCall::Utility(..) ), ProxyType::Exchange => matches!(c, RuntimeCall::XYK(..) | RuntimeCall::LBP(..) | RuntimeCall::NFT(..)), // Transfer group doesn't include cross-chain transfers From fdca093225e075e607e7048b6c6e19b770796848 Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Wed, 18 Sep 2024 12:37:46 +0200 Subject: [PATCH 7/9] fix pragmen elections UnlockConfig --- runtime/basilisk/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 827fb39a47..92d02de5c5 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -276,7 +276,7 @@ pub mod migrations { parameter_types! { pub const CouncilPalletName: &'static str = "Council"; // pub const TechnicalCommitteePalletName: &'static str = "TechnicalCommittee"; - pub const PhragmenElectionPalletName: &'static str = "PhragmenElection"; + pub const PhragmenElectionPalletName: &'static str = "Elections"; // pub const TechnicalMembershipPalletName: &'static str = "TechnicalMembership"; pub const TipsPalletName: &'static str = "Tips"; pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; From 28032beeaf658540a6584e01ab1f35eb83dad51e Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Wed, 18 Sep 2024 13:41:36 +0200 Subject: [PATCH 8/9] filter out calls to democracy.propose --- runtime/basilisk/src/system.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/basilisk/src/system.rs b/runtime/basilisk/src/system.rs index a17ee7b52f..f57f903759 100644 --- a/runtime/basilisk/src/system.rs +++ b/runtime/basilisk/src/system.rs @@ -76,6 +76,7 @@ impl Contains for BaseFilter { RuntimeCall::Uniques(_) => false, RuntimeCall::PolkadotXcm(_) => false, RuntimeCall::OrmlXcm(_) => false, + RuntimeCall::Democracy(pallet_democracy::Call::propose { .. }) => false, _ => true, } } From 050422486e5989bc14db5fe617e523a07bdf2c05 Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Wed, 18 Sep 2024 13:44:57 +0200 Subject: [PATCH 9/9] retire gov v1 ids --- runtime/basilisk/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 92d02de5c5..5d6e70d80c 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -170,8 +170,9 @@ construct_runtime!( MultiTransactionPayment: pallet_transaction_multi_payment = 106, Treasury: pallet_treasury = 4, Utility: pallet_utility = 5, - //NOTE: 6 - is used by Scheduler which must be after cumulus_pallet_parachain_system + // NOTE: 6 - is used by Scheduler which must be after cumulus_pallet_parachain_system Democracy: pallet_democracy exclude_parts { Config } = 7, + // NOTE 7, 8, 9 are retired (used by gov v1) TechnicalCommittee: pallet_collective:: = 10, Vesting: orml_vesting = 11, Proxy: pallet_proxy = 12,