diff --git a/Cargo.lock b/Cargo.lock index b7346dfc0b..890c726ecd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,12 +121,13 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "altair-runtime" -version = "0.11.3" +version = "0.12.0" dependencies = [ "axelar-gateway-precompile", "cfg-primitives", "cfg-traits", "cfg-types", + "cfg-utils", "chainbridge", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -167,6 +168,7 @@ dependencies = [ "pallet-collator-allowlist", "pallet-collator-selection", "pallet-collective", + "pallet-conviction-voting", "pallet-democracy", "pallet-elections-phragmen", "pallet-ethereum", @@ -195,6 +197,7 @@ dependencies = [ "pallet-pool-system", "pallet-preimage", "pallet-proxy", + "pallet-referenda", "pallet-remarks", "pallet-restricted-tokens", "pallet-restricted-xtokens", @@ -212,6 +215,7 @@ dependencies = [ "pallet-uniques", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", "pallet-xcm-transactor", "parity-scale-codec", @@ -221,6 +225,7 @@ dependencies = [ "scale-info", "serde", "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", @@ -1372,7 +1377,7 @@ dependencies = [ [[package]] name = "centrifuge-chain" -version = "0.11.3" +version = "0.12.0" dependencies = [ "altair-runtime", "async-trait", @@ -1465,7 +1470,7 @@ dependencies = [ [[package]] name = "centrifuge-runtime" -version = "0.11.3" +version = "0.12.0" dependencies = [ "axelar-gateway-precompile", "cfg-primitives", @@ -1639,6 +1644,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-collective", + "pallet-membership", "parity-scale-codec", "scale-info", "serde", @@ -3095,12 +3101,13 @@ dependencies = [ [[package]] name = "development-runtime" -version = "0.11.3" +version = "0.12.0" dependencies = [ "axelar-gateway-precompile", "cfg-primitives", "cfg-traits", "cfg-types", + "cfg-utils", "chainbridge", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -3142,6 +3149,7 @@ dependencies = [ "pallet-collator-allowlist", "pallet-collator-selection", "pallet-collective", + "pallet-conviction-voting", "pallet-democracy", "pallet-elections-phragmen", "pallet-ethereum", @@ -3170,6 +3178,7 @@ dependencies = [ "pallet-pool-system", "pallet-preimage", "pallet-proxy", + "pallet-referenda", "pallet-remarks", "pallet-restricted-tokens", "pallet-restricted-xtokens", @@ -3187,6 +3196,7 @@ dependencies = [ "pallet-uniques", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", "pallet-xcm-transactor", "parity-scale-codec", @@ -3196,6 +3206,7 @@ dependencies = [ "scale-info", "serde", "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", diff --git a/Cargo.toml b/Cargo.toml index ac804712a6..17be6ae776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ license = "LGPL-3.0" homepage = "https://centrifuge.io/" repository = "https://github.com/centrifuge/centrifuge-chain" documentation = "https://reference.centrifuge.io/centrifuge_chain/index.html" -version = "0.11.3" +version = "0.12.0" [workspace.dependencies] hex-literal = { version = "0.4.1" } @@ -188,11 +188,14 @@ pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-feat pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } @@ -205,7 +208,7 @@ pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", default- pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } +pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" } diff --git a/libs/primitives/Cargo.toml b/libs/primitives/Cargo.toml index bbd0a006f2..f8c83f3c8d 100644 --- a/libs/primitives/Cargo.toml +++ b/libs/primitives/Cargo.toml @@ -29,6 +29,7 @@ sp-std = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } pallet-collective = { workspace = true } +pallet-membership = { workspace = true } # cumulus primitives dependencies cumulus-primitives-core = { workspace = true } @@ -45,6 +46,7 @@ std = [ "frame-support/std", "frame-system/std", "pallet-collective/std", + "pallet-membership/std", "scale-info/std", "serde/std", "sp-arithmetic/std", @@ -60,6 +62,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-collective/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "staging-xcm-executor/runtime-benchmarks", ] @@ -67,5 +70,6 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "pallet-collective/try-runtime", + "pallet-membership/try-runtime", "sp-runtime/try-runtime", ] diff --git a/libs/primitives/src/lib.rs b/libs/primitives/src/lib.rs index cf1ad99966..0d463ccad5 100644 --- a/libs/primitives/src/lib.rs +++ b/libs/primitives/src/lib.rs @@ -23,9 +23,6 @@ pub use types::*; /// Common types for all runtimes pub mod types { - use frame_support::traits::EitherOfDiverse; - use frame_system::EnsureRoot; - use pallet_collective::EnsureProportionAtLeast; use parity_scale_codec::{CompactAs, Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; #[cfg(feature = "std")] @@ -46,24 +43,6 @@ pub mod types { /// EpochId type we use to identify epochs in our revolving pools pub type PoolEpochId = u32; - // Ensure that origin is either Root or fallback to use EnsureOrigin `O` - pub type EnsureRootOr = EitherOfDiverse, O>; - - /// The council - pub type CouncilCollective = pallet_collective::Instance1; - - /// All council members must vote yes to create this origin. - pub type AllOfCouncil = EnsureProportionAtLeast; - - /// 1/2 of all council members must vote yes to create this origin. - pub type HalfOfCouncil = EnsureProportionAtLeast; - - /// 2/3 of all council members must vote yes to create this origin. - pub type TwoThirdOfCouncil = EnsureProportionAtLeast; - - /// 3/4 of all council members must vote yes to create this origin. - pub type ThreeFourthOfCouncil = EnsureProportionAtLeast; - /// An index to a block. pub type BlockNumber = u32; @@ -286,6 +265,19 @@ pub mod constants { /// Identification of the native token of the chain. Used in XCM locations. pub const NATIVE_KEY: &[u8] = &[0, 1]; + + /// The index of the root OpenGov track + pub const TRACK_INDEX_ROOT: u16 = 0; + /// The index of the whitelisted caller OpenGov track + pub const TRACK_INDEX_WHITELISTED_CALLER: u16 = 1; + /// The index of the pool admin OpenGov track + pub const TRACK_INDEX_POOL_ADMIN: u16 = 10; + /// The index of the treasurer OpenGov track + pub const TRACK_INDEX_TREASURER: u16 = 11; + /// The index of the referendum canceller OpenGov track + pub const TRACK_INDEX_REF_CANCELLER: u16 = 20; + /// The index of the referendum killer OpenGov track + pub const TRACK_INDEX_REF_KILLER: u16 = 21; } /// Listing of parachains we integrate with. diff --git a/libs/utils/src/lib.rs b/libs/utils/src/lib.rs index dd447833bd..dc2f1c2f0d 100644 --- a/libs/utils/src/lib.rs +++ b/libs/utils/src/lib.rs @@ -153,6 +153,34 @@ pub mod math { } } + /// Converts the given number to percent. + /// + /// # Example + /// + /// ``` + /// use sp_arithmetic::FixedI64; + /// use cfg_utils::math::to_percent; + /// + /// assert_eq!(to_percent(3u128), FixedI64::from_rational(3, 100)); + /// ``` + pub const fn to_percent(x: u128) -> sp_arithmetic::FixedI64 { + sp_arithmetic::FixedI64::from_rational(x, 100) + } + + /// Converts the given number to parts per million + /// + /// # Example + /// + /// ``` + /// use sp_arithmetic::FixedI64; + /// use cfg_utils::math::to_ppm; + /// + /// assert_eq!(to_ppm(3u128), FixedI64::from_rational(3, 1_000_000)); + /// ``` + pub const fn to_ppm(x: u128) -> sp_arithmetic::FixedI64 { + sp_arithmetic::FixedI64::from_rational(x, 1_000_000) + } + #[cfg(test)] mod test_y_coord_in_function_with_2_points { use super::*; diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 9a7f3a5776..a1e7e76880 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -38,7 +38,7 @@ use runtime_common::account_conversion::AccountConverter; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::{ChainType, Properties}; use serde::{Deserialize, Serialize}; -use sp_core::{sr25519, Encode, Pair, Public}; +use sp_core::{bounded_vec::BoundedVec, sr25519, Encode, Pair, Public}; use sp_runtime::{ traits::{IdentifyAccount, Verify}, FixedPointNumber, @@ -451,6 +451,12 @@ fn altair_genesis( "polkadotXcm": { "safeXcmVersion": Some(SAFE_XCM_VERSION), }, + "techhnicalCommittee": { + "members": council_members + }, + "technicalCommitteeMembership": { + "members": BoundedVec::<_, altair_runtime::TechnicalMaxMembers>::truncate_from(council_members), + } }) } diff --git a/pallets/liquidity-pools/src/contract.rs b/pallets/liquidity-pools/src/contract.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/runtime/altair/Cargo.toml b/runtime/altair/Cargo.toml index 6097a909c5..d89508a619 100644 --- a/runtime/altair/Cargo.toml +++ b/runtime/altair/Cargo.toml @@ -11,7 +11,7 @@ documentation.workspace = true [dependencies] hex = { workspace = true } -hex-literal = { workspace = true, optional = true } +hex-literal = { workspace = true } log = { workspace = true } parity-scale-codec = { workspace = true } scale-info = { workspace = true } @@ -19,6 +19,7 @@ serde = { workspace = true, optional = true } static_assertions = { workspace = true } sp-api = { workspace = true } +sp-arithmetic = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } sp-core = { workspace = true } @@ -66,6 +67,7 @@ fp-self-contained = { workspace = true } cfg-primitives = { workspace = true } cfg-traits = { workspace = true } cfg-types = { workspace = true } +cfg-utils = { workspace = true } liquidity-pools-gateway-routers = { workspace = true } runtime-common = { workspace = true } @@ -91,6 +93,7 @@ pallet-bridge = { workspace = true } pallet-collator-allowlist = { workspace = true } pallet-collator-selection = { workspace = true } pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } pallet-elections-phragmen = { workspace = true } pallet-ethereum = { workspace = true } @@ -119,6 +122,7 @@ pallet-pool-registry = { workspace = true } pallet-pool-system = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } pallet-remarks = { workspace = true } pallet-restricted-tokens = { workspace = true } pallet-restricted-xtokens = { workspace = true } @@ -135,6 +139,7 @@ pallet-treasury = { workspace = true } pallet-uniques = { workspace = true } pallet-utility = { workspace = true } pallet-vesting = { workspace = true } +pallet-whitelist = { workspace = true } pallet-xcm = { workspace = true } pallet-xcm-transactor = { workspace = true } staging-parachain-info = { workspace = true } @@ -153,6 +158,7 @@ std = [ "log/std", # Substrate related "sp-api/std", + "sp-arithmetic/std", "sp-runtime/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -191,6 +197,7 @@ std = [ "polkadot-parachain-primitives/std", # Locals "cfg-primitives/std", + "cfg-utils/std", "cfg-traits/std", "cfg-types/std", "runtime-common/std", @@ -214,6 +221,7 @@ std = [ "pallet-base-fee/std", "pallet-block-rewards/std", "pallet-bridge/std", + "pallet-conviction-voting/std", "pallet-collator-allowlist/std", "pallet-collator-selection/std", "pallet-collective/std", @@ -246,6 +254,7 @@ std = [ "pallet-proxy/std", "pallet-restricted-tokens/std", "pallet-restricted-xtokens/std", + "pallet-referenda/std", "pallet-rewards/std", "pallet-remarks/std", "pallet-scheduler/std", @@ -260,6 +269,7 @@ std = [ "pallet-uniques/std", "pallet-utility/std", "pallet-vesting/std", + "pallet-whitelist/std", "pallet-xcm/std", "pallet-xcm-transactor/std", "pallet-message-queue/std", @@ -268,7 +278,6 @@ std = [ runtime-benchmarks = [ # Enabling optional - "hex-literal", "frame-system-benchmarking/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", @@ -284,6 +293,7 @@ runtime-benchmarks = [ "polkadot-parachain-primitives/runtime-benchmarks", # Locals "cfg-primitives/runtime-benchmarks", + "cfg-utils/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", "runtime-common/runtime-benchmarks", @@ -300,6 +310,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-block-rewards/runtime-benchmarks", "pallet-bridge/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", "pallet-collator-allowlist/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-collective/runtime-benchmarks", @@ -331,6 +342,7 @@ runtime-benchmarks = [ "pallet-proxy/runtime-benchmarks", "pallet-restricted-tokens/runtime-benchmarks", "pallet-restricted-xtokens/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", "pallet-rewards/runtime-benchmarks", "pallet-remarks/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", @@ -343,6 +355,7 @@ runtime-benchmarks = [ "pallet-uniques/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pallet-xcm-transactor/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", @@ -360,6 +373,7 @@ try-runtime = [ "polkadot-runtime-common/try-runtime", # Locals "cfg-primitives/try-runtime", + "cfg-utils/try-runtime", "cfg-traits/try-runtime", "cfg-types/try-runtime", "runtime-common/try-runtime", @@ -383,6 +397,7 @@ try-runtime = [ "pallet-base-fee/try-runtime", "pallet-block-rewards/try-runtime", "pallet-bridge/try-runtime", + "pallet-conviction-voting/try-runtime", "pallet-collator-allowlist/try-runtime", "pallet-collator-selection/try-runtime", "pallet-collective/try-runtime", @@ -415,6 +430,7 @@ try-runtime = [ "pallet-proxy/try-runtime", "pallet-restricted-tokens/try-runtime", "pallet-restricted-xtokens/try-runtime", + "pallet-referenda/try-runtime", "pallet-rewards/try-runtime", "pallet-remarks/try-runtime", "pallet-scheduler/try-runtime", @@ -429,6 +445,7 @@ try-runtime = [ "pallet-uniques/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", + "pallet-whitelist/try-runtime", "pallet-xcm/try-runtime", "pallet-xcm-transactor/try-runtime", "pallet-message-queue/try-runtime", diff --git a/runtime/altair/src/lib.rs b/runtime/altair/src/lib.rs index 7384883f43..6afcc538dc 100644 --- a/runtime/altair/src/lib.rs +++ b/runtime/altair/src/lib.rs @@ -23,10 +23,9 @@ use cfg_primitives::{ constants::*, liquidity_pools::GeneralCurrencyPrefix, types::{ - AccountId, Address, AllOfCouncil, AuraId, Balance, BlockNumber, CollectionId, - CouncilCollective, EnsureRootOr, HalfOfCouncil, Hash, Hashing, Header, IBalance, ItemId, - LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, PoolFeeId, PoolId, - Signature, ThreeFourthOfCouncil, TrancheId, TrancheWeight, TwoThirdOfCouncil, + AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header, + IBalance, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, + PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight, }, }; use cfg_traits::{ @@ -59,7 +58,7 @@ use frame_support::{ traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, Contains, EitherOfDiverse, + AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, Contains, EitherOf, EitherOfDiverse, EqualPrivilegeOnly, Get, InstanceFilter, LinearStoragePrice, LockIdentifier, OnFinalize, PalletInfoAccess, TransformOrigin, UnixTime, WithdrawReasons, }, @@ -71,7 +70,7 @@ use frame_support::{ }; use frame_system::{ limits::{BlockLength, BlockWeights}, - EnsureRoot, EnsureSigned, + EnsureRoot, EnsureSigned, EnsureWithSuccess, }; use orml_traits::currency::MutationHooks; use pallet_anchors::AnchorData; @@ -99,6 +98,7 @@ use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use polkadot_runtime_common::{ prod_or_fast, xcm_sender::NoPriceForMessageDelivery, BlockHashCount, SlowAdjustingFeeUpdate, }; +pub use runtime_common::origins::gov::pallet_custom_origins; use runtime_common::{ account_conversion::{AccountConverter, RuntimeAccountConverter}, asset_registry, @@ -108,11 +108,20 @@ use runtime_common::{ }, fees::{DealWithFees, FeeToTreasury, WeightToFee}, gateway, instances, + instances::{CouncilCollective, TechnicalCollective, TechnicalMembership}, liquidity_pools::LiquidityPoolsMessage, message_queue::{NarrowOriginToSibling, ParaIdToSibling}, oracle::{ Feeder, OracleConverterBridge, OracleRatioProvider, OracleRatioProviderLocalAssetExtension, }, + origins::gov::{ + types::{ + AllOfCouncil, DispatchWhitelistedOrigin, EnsureRootOr, HalfOfCouncil, PoolCreateOrigin, + RefCancelOrigin, RefKillerOrigin, ThreeFourthOfCouncil, TreasuryApproveOrigin, + TwoThirdOfCouncil, WhitelistOrigin, + }, + PoolAdmin, Treasurer, + }, permissions::PoolAdminCheck, remarks::Remark, rewards::SingleCurrencyMovement, @@ -139,10 +148,11 @@ use sp_version::RuntimeVersion; use staging_xcm::v4::{Asset, Location}; use static_assertions::const_assert; -use crate::xcm::*; +use crate::{tracks::TracksInfo, xcm::*}; pub mod constants; mod migrations; +mod tracks; mod weights; pub mod xcm; @@ -163,7 +173,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("altair"), impl_name: create_runtime_str!("altair"), authoring_version: 1, - spec_version: 1103, + spec_version: 1200, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -550,6 +560,11 @@ impl InstanceFilter for ProxyType { RuntimeCall::Council(..) | RuntimeCall::Elections(..) | RuntimeCall::Democracy(..) | + RuntimeCall::ConvictionVoting(..) | + RuntimeCall::Referenda(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::TechnicalCommitteeMembership(..) | + RuntimeCall::Whitelist(..) | RuntimeCall::Identity(..) | RuntimeCall::Vesting(pallet_vesting::Call::vest {..}) | RuntimeCall::Vesting(pallet_vesting::Call::vest_other {..}) | @@ -595,6 +610,12 @@ impl InstanceFilter for ProxyType { | RuntimeCall::Council(..) | RuntimeCall::Elections(..) | RuntimeCall::Utility(..) + // OpenGov calls + | RuntimeCall::ConvictionVoting(..) + | RuntimeCall::Referenda(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalCommitteeMembership(..) + | RuntimeCall::Whitelist(..) ), ProxyType::_Staking => false, ProxyType::NonProxy => { @@ -768,7 +789,7 @@ impl pallet_collective::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type SetMembersOrigin = EnsureRoot; - type WeightInfo = weights::pallet_collective::WeightInfo; + type WeightInfo = weights::pallet_collective_council::WeightInfo; } parameter_types! { @@ -963,7 +984,7 @@ parameter_types! { } impl pallet_treasury::Config for Runtime { - type ApproveOrigin = EnsureRootOr; + type ApproveOrigin = TreasuryApproveOrigin; type AssetKind = (); type BalanceConverter = UnityAssetBalanceConversion; #[cfg(feature = "runtime-benchmarks")] @@ -981,10 +1002,10 @@ impl pallet_treasury::Config for Runtime { type ProposalBond = ProposalBond; type ProposalBondMaximum = ProposalBondMaximum; type ProposalBondMinimum = ProposalBondMinimum; - type RejectOrigin = EnsureRootOr>; + type RejectOrigin = TreasuryApproveOrigin; type RuntimeEvent = RuntimeEvent; type SpendFunds = (); - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; + type SpendOrigin = TreasurySpender; type SpendPeriod = SpendPeriod; type WeightInfo = pallet_treasury::weights::SubstrateWeight; } @@ -1103,7 +1124,7 @@ parameter_types! { } impl pallet_permissions::Config for Runtime { - type AdminOrigin = EnsureRootOr; + type AdminOrigin = EnsureRootOr>; type Editors = Editors; type MaxRolesPerScope = MaxRolesPerPool; type Role = Role; @@ -1501,7 +1522,7 @@ impl pallet_pool_system::Config for Runtime { type PalletId = PoolPalletId; type PalletIndex = PoolPalletIndex; type Permission = Permissions; - type PoolCreateOrigin = EnsureRoot; + type PoolCreateOrigin = PoolCreateOrigin; type PoolCurrency = PoolCurrency; type PoolDeposit = PoolDeposit; type PoolFees = PoolFees; @@ -1530,7 +1551,7 @@ impl pallet_pool_registry::Config for Runtime { type ModifyPool = pallet_pool_system::Pallet; type ModifyWriteOffPolicy = pallet_loans::Pallet; type Permission = Permissions; - type PoolCreateOrigin = EnsureRoot; + type PoolCreateOrigin = PoolCreateOrigin; type PoolFeesInspect = PoolFees; type PoolId = PoolId; type RuntimeEvent = RuntimeEvent; @@ -1932,6 +1953,91 @@ impl axelar_gateway_precompile::Config for Runtime { type WeightInfo = (); } +impl pallet_conviction_voting::Config for Runtime { + type Currency = Balances; + type MaxTurnout = + frame_support::traits::tokens::currency::ActiveIssuanceOf; + type MaxVotes = ConstU32<512>; + type Polls = Referenda; + type RuntimeEvent = RuntimeEvent; + type VoteLockingPeriod = EnactmentPeriod; + type WeightInfo = weights::pallet_conviction_voting::WeightInfo; +} + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub const SubmissionDeposit: Balance = 10 * AIR; + pub const UndecidingTimeout: BlockNumber = 7 * DAYS; +} + +parameter_types! { + pub const MaxBalance: Balance = Balance::max_value(); +} +pub type TreasurySpender = EnsureWithSuccess, AccountId, MaxBalance>; + +impl pallet_custom_origins::Config for Runtime {} + +impl pallet_whitelist::Config for Runtime { + type DispatchWhitelistedOrigin = DispatchWhitelistedOrigin; + type Preimages = Preimage; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_whitelist::WeightInfo; + type WhitelistOrigin = WhitelistOrigin; +} + +impl pallet_referenda::Config for Runtime { + type AlarmInterval = AlarmInterval; + type CancelOrigin = RefCancelOrigin; + type Currency = Balances; + type KillOrigin = RefKillerOrigin; + type MaxQueued = ConstU32<100>; + type Preimages = Preimage; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Slash = Treasury; + type SubmissionDeposit = SubmissionDeposit; + type SubmitOrigin = frame_system::EnsureSigned; + type Tally = pallet_conviction_voting::TallyOf; + type Tracks = TracksInfo; + type UndecidingTimeout = UndecidingTimeout; + type Votes = pallet_conviction_voting::VotesOf; + type WeightInfo = weights::pallet_referenda::WeightInfo; +} + +parameter_types! { + pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS; + pub const TechnicalMaxProposals: u32 = 20; + pub const TechnicalMaxMembers: u32 = 20; +} + +impl pallet_collective::Config for Runtime { + type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxMembers = TechnicalMaxMembers; + type MaxProposalWeight = MaxProposalWeight; + type MaxProposals = TechnicalMaxProposals; + type MotionDuration = TechnicalMotionDuration; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot; + type WeightInfo = weights::pallet_collective_technical_fellowship::WeightInfo; +} + +impl pallet_membership::Config for Runtime { + type AddOrigin = EnsureRoot; + type MaxMembers = TechnicalMaxMembers; + type MembershipChanged = TechnicalCommittee; + type MembershipInitialized = TechnicalCommittee; + type PrimeOrigin = EnsureRoot; + type RemoveOrigin = EnsureRoot; + type ResetOrigin = EnsureRoot; + type RuntimeEvent = RuntimeEvent; + type SwapOrigin = EnsureRoot; + type WeightInfo = weights::pallet_membership::WeightInfo; +} + /// Block type as expected by this runtime. pub type Block = generic::Block; /// A Block signed with a Justification @@ -1966,7 +2072,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - migrations::UpgradeAltair1103, + migrations::UpgradeAltair1200, >; // Frame Order in this block dictates the index of each one in the metadata @@ -2006,6 +2112,14 @@ construct_runtime!( Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason} = 70, Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 72, + // OpenGov + ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 80, + Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 81, + Origins: pallet_custom_origins::{Origin} = 82, + Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 83, + TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 84, + TechnicalCommitteeMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 85, + // our pallets (part 1) Fees: pallet_fees::{Pallet, Call, Storage, Config, Event} = 90, Anchor: pallet_anchors::{Pallet, Call, Storage} = 91, @@ -2732,7 +2846,7 @@ mod benches { [pallet_proxy, Proxy] [pallet_utility, Utility] [pallet_scheduler, Scheduler] - [pallet_collective, Council] + [pallet_collective_council, Council] [pallet_elections_phragmen, Elections] [pallet_democracy, Democracy] [pallet_identity, Identity] @@ -2763,6 +2877,11 @@ mod benches { [pallet_pool_fees, PoolFees] [pallet_remarks, Remarks] [pallet_token_mux, TokenMux] + [pallet_collective_technical_fellowship, TechnicalCommittee] + [pallet_conviction_voting, ConvictionVoting] + [pallet_membership, TechnicalCommitteeMembership] + [pallet_referenda, Referenda] + [pallet_whitelist, Whitelist] ); } diff --git a/runtime/altair/src/migrations.rs b/runtime/altair/src/migrations.rs index 20726a13cf..558c6fb157 100644 --- a/runtime/altair/src/migrations.rs +++ b/runtime/altair/src/migrations.rs @@ -10,14 +10,36 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +use cfg_primitives::AccountId; +use sp_core::parameter_types; + use crate::{ForeignInvestments, OraclePriceCollection, OraclePriceFeed, OrderBook}; // Number of identities on Altair Chain on 30.05.2024 was 34 const IDENTITY_MIGRATION_KEY_LIMIT: u64 = 1000; +parameter_types! { + pub InitialTcMembers: sp_std::vec::Vec = sp_std::vec![ + // Luis: 4ck67NuZLjvbMRijqsmHdRMbGbyq2CoD99urmawqvx73WUn4 + AccountId::new(hex_literal::hex!("3e098bb449c1ab045c84e560c301a04ecd10660b7411b649047c8ca247115265")), + // Cosmin: 4dM5pHAuujs6HT63qpgCa7pMMhq9GpgevY8PSgsaXz6msuB6 + AccountId::new(hex_literal::hex!("58ba2478321eb64560f7e8f1172e8f2b2ba6ea84ecb49efe277bf6228fb35c4b")), + // William: kAKWYPrsqdtdUbQx39xAnNjXJLdHniAbeb96vk1CnjapdVKVt + AccountId::new(hex_literal::hex!("684f4dc6a026ea82a6cb36de4330a1a44428bbe243fb7f26ccf6227b0d0ef054")), + // Frederik: kALk3JfT7QGy4ChQwoV3z45ARuWpgVBGQaRrqt97trG5KPxoy + AccountId::new(hex_literal::hex!("9ed70c707d596bb8687518884161377c2617402f69116ef0970ce0f547b1db5d")), + // Jeroen: kAJ4NgSQg6Jv8JQautnNoHmjt8EYw4Q1Z1G4LsK6bqStqHQyq + AccountId::new(hex_literal::hex!("281dfd3154a3ca796fd870e806fe4d1fa17844ba4b0c03ebae04b8e510b6012e")), + // Lucas: kAMMsuzRLaEgDppbvpcJp2hdCQhiyBTcdWZWFtq3ENrVhtuKg + AccountId::new(hex_literal::hex!("ba2c4540acac96a93e611ec4258ce05338434f12107d35f29783bbd2477dd20e")), + // Cassidy kAM4RNjEyJ1jZiMCA2onHwtLW8EoAtGCjYvNHCGEpvag5jeWF + AccountId::new(hex_literal::hex!("acdbc2ab1dd9274a5d0699a9b666d531b880aef033fd748e5e09522ac5896010")) + ]; +} + /// The migration set for Altair @ Kusama. /// It includes all the migrations that have to be applied on that chain. -pub type UpgradeAltair1103 = ( +pub type UpgradeAltair1200 = ( runtime_common::migrations::increase_storage_version::Migration, runtime_common::migrations::increase_storage_version::Migration, runtime_common::migrations::increase_storage_version::Migration, @@ -35,4 +57,17 @@ pub type UpgradeAltair1103 = ( cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, pallet_identity::migration::versioned::V0ToV1, pallet_uniques::migration::MigrateV0ToV1, + // Initialize OpenGov TechnicalCommittee + runtime_common::migrations::technical_comittee::InitMigration, + runtime_common::migrations::increase_storage_version::Migration, + runtime_common::migrations::increase_storage_version::Migration< + crate::TechnicalCommittee, + 0, + 4, + >, + runtime_common::migrations::increase_storage_version::Migration< + crate::TechnicalCommitteeMembership, + 0, + 4, + >, ); diff --git a/runtime/altair/src/tracks.rs b/runtime/altair/src/tracks.rs new file mode 100644 index 0000000000..c31f262591 --- /dev/null +++ b/runtime/altair/src/tracks.rs @@ -0,0 +1,434 @@ +// Copyright 2024 Centrifuge Foundation (centrifuge.io). +// +// This file is part of the Centrifuge chain project. +// Centrifuge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version (see http://www.gnu.org/licenses). +// Centrifuge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +//! OpenGov Tracks parametrization +//! +//! Based on [Altair Chain parametrization](https://docs.google.com/document/d/1asoDHtIT3bhSnwfQir3SZ7NN-5D1i02s01clh9lEd0k). + +use cfg_primitives::{ + Balance, BlockNumber, DAYS, HOURS, MINUTES, TRACK_INDEX_POOL_ADMIN, TRACK_INDEX_REF_CANCELLER, + TRACK_INDEX_REF_KILLER, TRACK_INDEX_ROOT, TRACK_INDEX_TREASURER, + TRACK_INDEX_WHITELISTED_CALLER, +}; +use cfg_utils::math::{to_percent, to_ppm}; +use pallet_referenda::Curve; + +use crate::{constants::currency::AIR, RuntimeOrigin}; + +const SUP_ROOT: Curve = + Curve::make_reciprocal(1, 168, to_percent(25), to_ppm(3000), to_percent(50)); +const APP_ROOT: Curve = Curve::make_linear(7, 7, to_percent(50), to_percent(100)); + +const SUP_WHITELISTED: Curve = + Curve::make_reciprocal(1, 84, to_ppm(37000), to_ppm(500), to_percent(50)); +const APP_WHITELISTED: Curve = Curve::make_linear(84, 84, to_percent(50), to_percent(100)); + +const SUP_POOL_ADMIN: Curve = + Curve::make_reciprocal(1, 84, to_ppm(142900), to_ppm(2400), to_percent(50)); +const APP_POOL_ADMIN: Curve = Curve::make_linear(84, 84, to_percent(70), to_percent(100)); + +const SUP_TREASURER: Curve = Curve::make_linear(13, 14, to_percent(1), to_percent(50)); +const APP_TREASURER: Curve = Curve::make_linear(14, 14, to_percent(70), to_percent(100)); + +const SUP_REF_CANCELLER: Curve = + Curve::make_reciprocal(24, 84, to_ppm(8200), to_ppm(2400), to_percent(50)); +const APP_REF_CANCELLER: Curve = Curve::make_linear(84, 84, to_percent(70), to_percent(100)); + +const SUP_REF_KILLER: Curve = + Curve::make_reciprocal(24, 84, to_ppm(8200), to_ppm(2400), to_percent(50)); +const APP_REF_KILLER: Curve = Curve::make_linear(84, 84, to_percent(70), to_percent(100)); + +const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 6] = [ + ( + TRACK_INDEX_ROOT, + pallet_referenda::TrackInfo { + name: "root", + max_deciding: 2, + decision_deposit: 3_000_000 * AIR, + prepare_period: 3 * HOURS, + decision_period: 7 * DAYS, + confirm_period: 6 * HOURS, + min_enactment_period: 12 * HOURS, + min_approval: APP_ROOT, + min_support: SUP_ROOT, + }, + ), + ( + TRACK_INDEX_WHITELISTED_CALLER, + pallet_referenda::TrackInfo { + name: "whitelisted_caller", + max_deciding: 20, + decision_deposit: 10_000 * AIR, + prepare_period: 5 * MINUTES, + decision_period: 84 * HOURS, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, + min_approval: APP_WHITELISTED, + min_support: SUP_WHITELISTED, + }, + ), + ( + TRACK_INDEX_POOL_ADMIN, + pallet_referenda::TrackInfo { + name: "pool_admin", + max_deciding: 5, + decision_deposit: 20_000 * AIR, + prepare_period: 30 * MINUTES, + decision_period: 84 * HOURS, + confirm_period: 30 * MINUTES, + min_enactment_period: 30 * MINUTES, + min_approval: APP_POOL_ADMIN, + min_support: SUP_POOL_ADMIN, + }, + ), + ( + TRACK_INDEX_TREASURER, + pallet_referenda::TrackInfo { + name: "treasurer", + max_deciding: 2, + decision_deposit: 150_000 * AIR, + prepare_period: 6 * HOURS, + decision_period: 14 * DAYS, + confirm_period: 12 * HOURS, + min_enactment_period: 12 * HOURS, + min_approval: APP_TREASURER, + min_support: SUP_TREASURER, + }, + ), + ( + TRACK_INDEX_REF_CANCELLER, + pallet_referenda::TrackInfo { + name: "referendum_canceller", + max_deciding: 20, + decision_deposit: 600_000 * AIR, + prepare_period: 30 * MINUTES, + decision_period: 84 * HOURS, + confirm_period: 30 * MINUTES, + min_enactment_period: 5 * MINUTES, + min_approval: APP_REF_CANCELLER, + min_support: SUP_REF_CANCELLER, + }, + ), + ( + TRACK_INDEX_REF_KILLER, + pallet_referenda::TrackInfo { + name: "referendum_killer", + max_deciding: 20, + decision_deposit: 1_000_000 * AIR, + prepare_period: 30 * MINUTES, + decision_period: 84 * HOURS, + confirm_period: 30 * MINUTES, + min_enactment_period: 5 * MINUTES, + min_approval: APP_REF_KILLER, + min_support: SUP_REF_KILLER, + }, + ), +]; + +pub struct TracksInfo; +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = u16; + type RuntimeOrigin = ::PalletsOrigin; + + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + &TRACKS_DATA[..] + } + + fn track_for(id: &Self::RuntimeOrigin) -> Result { + if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) { + match system_origin { + frame_system::RawOrigin::Root => Ok(TRACK_INDEX_ROOT), + _ => Err(()), + } + } else if let Ok(custom_origin) = runtime_common::origins::gov::Origin::try_from(id.clone()) + { + match custom_origin { + runtime_common::origins::gov::Origin::WhitelistedCaller => { + Ok(TRACK_INDEX_WHITELISTED_CALLER) + } + // General admin + runtime_common::origins::gov::Origin::PoolAdmin => Ok(TRACK_INDEX_POOL_ADMIN), + runtime_common::origins::gov::Origin::Treasurer => Ok(TRACK_INDEX_TREASURER), + // Referendum admins + runtime_common::origins::gov::Origin::ReferendumCanceller => { + Ok(TRACK_INDEX_REF_CANCELLER) + } + runtime_common::origins::gov::Origin::ReferendumKiller => { + Ok(TRACK_INDEX_REF_KILLER) + } + } + } else { + Err(()) + } + } +} +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); + +#[cfg(test)] +mod tests { + use sp_arithmetic::Perbill; + + use super::*; + + const DECIMAL_PRECISION: u32 = 4; + const PRECISION: u32 = 10u32.pow(DECIMAL_PRECISION); + + fn round(x: Perbill) -> Perbill { + Perbill::from_rational(x * PRECISION, PRECISION) + } + + #[test] + fn root_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 72, 120, 168]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(997, 1000u32), + Perbill::from_rational(994, 1000u32), + Perbill::from_rational(9911, 10000u32), + Perbill::from_rational(9286, 10000u32), + Perbill::from_rational(7857, 10000u32), + Perbill::from_rational(6429, 10000u32), + Perbill::from_rational(50, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(25, 100u32), + Perbill::from_rational(1667, 10000u32), + Perbill::from_rational(125, 1000u32), + Perbill::from_rational(2, 100u32), + Perbill::from_rational(69, 10000u32), + Perbill::from_rational(42, 10000u32), + Perbill::from_rational(3, 1000u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_ROOT.threshold(Perbill::from_rational(hour, 7u32 * 24u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_ROOT.threshold(Perbill::from_rational(hour, 7u32 * 24u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } + + #[test] + fn whitelisted_caller_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 36, 72, 84]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(994, 1000u32), + Perbill::from_rational(9881, 10000u32), + Perbill::from_rational(9821, 10000u32), + Perbill::from_rational(8571, 10000u32), + Perbill::from_rational(7857, 10000u32), + Perbill::from_rational(5714, 10000u32), + Perbill::from_rational(50, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(37, 1000u32), + Perbill::from_rational(192, 10000u32), + Perbill::from_rational(130, 10000u32), + Perbill::from_rational(17, 10000u32), + Perbill::from_rational(11, 10000u32), + Perbill::from_rational(6, 10000u32), + Perbill::from_rational(5, 10000u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_WHITELISTED.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_WHITELISTED.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } + + #[test] + fn pool_admin_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 36, 72, 84]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(9964, 10000u32), + Perbill::from_rational(9929, 10000u32), + Perbill::from_rational(9893, 10000u32), + Perbill::from_rational(9143, 10000u32), + Perbill::from_rational(8714, 10000u32), + Perbill::from_rational(7429, 10000u32), + Perbill::from_rational(70, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(1429, 10000u32), + Perbill::from_rational(834, 10000u32), + Perbill::from_rational(589, 10000u32), + Perbill::from_rational(82, 10000u32), + Perbill::from_rational(55, 10000u32), + Perbill::from_rational(28, 10000u32), + Perbill::from_rational(24, 10000u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_POOL_ADMIN.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_POOL_ADMIN.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } + + #[test] + fn treasurer_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 312, 324, 336]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(9991, 10000u32), + Perbill::from_rational(9982, 10000u32), + Perbill::from_rational(9973, 10000u32), + Perbill::from_rational(9786, 10000u32), + Perbill::from_rational(7214, 10000u32), + Perbill::from_rational(7107, 10000u32), + Perbill::from_rational(70, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(4984, 10000u32), + Perbill::from_rational(4969, 10000u32), + Perbill::from_rational(4953, 10000u32), + Perbill::from_rational(4623, 10000u32), + Perbill::from_rational(1, 100u32), + Perbill::from_rational(1, 100u32), + Perbill::from_rational(1, 100u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_TREASURER.threshold(Perbill::from_rational(hour, 14u32 * 24u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_TREASURER.threshold(Perbill::from_rational(hour, 14u32 * 24u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } + + #[test] + fn ref_canceller_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 36, 72, 84]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(9964, 10000u32), + Perbill::from_rational(9929, 10000u32), + Perbill::from_rational(9893, 10000u32), + Perbill::from_rational(9143, 10000u32), + Perbill::from_rational(8714, 10000u32), + Perbill::from_rational(7429, 10000u32), + Perbill::from_rational(70, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(1424, 10000u32), + Perbill::from_rational(830, 10000u32), + Perbill::from_rational(586, 10000u32), + Perbill::from_rational(82, 10000u32), + Perbill::from_rational(55, 10000u32), + Perbill::from_rational(28, 10000u32), + Perbill::from_rational(24, 10000u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_REF_CANCELLER.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_REF_CANCELLER.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } + + #[test] + fn ref_killer_track() { + const HOURS: [u32; 8] = [0, 1, 2, 3, 24, 36, 72, 84]; + let approval: [Perbill; 8] = [ + Perbill::from_rational(100, 100u32), + Perbill::from_rational(9964, 10000u32), + Perbill::from_rational(9929, 10000u32), + Perbill::from_rational(9893, 10000u32), + Perbill::from_rational(9143, 10000u32), + Perbill::from_rational(8714, 10000u32), + Perbill::from_rational(7429, 10000u32), + Perbill::from_rational(70, 100u32), + ]; + let sup: [Perbill; 8] = [ + Perbill::from_rational(50, 100u32), + Perbill::from_rational(1424, 10000u32), + Perbill::from_rational(830, 10000u32), + Perbill::from_rational(586, 10000u32), + Perbill::from_rational(82, 10000u32), + Perbill::from_rational(55, 10000u32), + Perbill::from_rational(28, 10000u32), + Perbill::from_rational(24, 10000u32), + ]; + + for (hour, y) in HOURS.into_iter().zip(approval) { + assert_eq!( + round(APP_REF_KILLER.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Approval mismatch at hour {hour}" + ); + } + + for (hour, y) in HOURS.into_iter().zip(sup) { + assert_eq!( + round(SUP_REF_KILLER.threshold(Perbill::from_rational(hour, 7u32 * 12u32))), + y, + "Support mismatch at hour {hour}" + ); + } + } +} diff --git a/runtime/altair/src/weights/mod.rs b/runtime/altair/src/weights/mod.rs index 659c89486d..a4371f34d0 100644 --- a/runtime/altair/src/weights/mod.rs +++ b/runtime/altair/src/weights/mod.rs @@ -16,7 +16,9 @@ pub mod pallet_balances; pub mod pallet_block_rewards; pub mod pallet_collator_allowlist; pub mod pallet_collator_selection; -pub mod pallet_collective; +pub mod pallet_collective_council; +pub mod pallet_collective_technical_fellowship; +pub mod pallet_conviction_voting; pub mod pallet_democracy; pub mod pallet_elections_phragmen; pub mod pallet_fees; @@ -26,6 +28,7 @@ pub mod pallet_investments; pub mod pallet_keystore; pub mod pallet_liquidity_rewards; pub mod pallet_loans; +pub mod pallet_membership; pub mod pallet_multisig; pub mod pallet_oracle_collection; pub mod pallet_oracle_feed; @@ -36,6 +39,7 @@ pub mod pallet_pool_registry; pub mod pallet_pool_system; pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_referenda; pub mod pallet_remarks; pub mod pallet_restricted_tokens; pub mod pallet_scheduler; @@ -46,4 +50,5 @@ pub mod pallet_transfer_allowlist; pub mod pallet_uniques; pub mod pallet_utility; pub mod pallet_vesting; +pub mod pallet_whitelist; pub mod pallet_xcm; diff --git a/runtime/altair/src/weights/pallet_collective.rs b/runtime/altair/src/weights/pallet_collective.rs index 60ada52c4a..8b13789179 100644 --- a/runtime/altair/src/weights/pallet_collective.rs +++ b/runtime/altair/src/weights/pallet_collective.rs @@ -1,286 +1 @@ -//! Autogenerated weights for `pallet_collective` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("altair-local")`, DB CACHE: 1024 - -// Executed Command: -// target/release/centrifuge-chain -// benchmark -// pallet -// --chain=altair-local -// --steps=50 -// --repeat=20 -// --pallet=pallet_collective -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=/tmp/runtime/altair/src/weights/pallet_collective.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_collective`. -pub struct WeightInfo(PhantomData); -impl pallet_collective::WeightInfo for WeightInfo { - /// Storage: `Council::Members` (r:1 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:100 w:100) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:0 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[0, 100]`. - /// The range of component `n` is `[0, 100]`. - /// The range of component `p` is `[0, 100]`. - fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15728 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 19_446_000 picoseconds. - Weight::from_parts(19_767_000, 0) - .saturating_add(Weight::from_parts(0, 15728)) - // Standard Error: 62_906 - .saturating_add(Weight::from_parts(4_710_690, 0).saturating_mul(m.into())) - // Standard Error: 62_906 - .saturating_add(Weight::from_parts(8_750_971, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `69 + m * (32 ±0)` - // Estimated: `1555 + m * (32 ±0)` - // Minimum execution time: 18_083_000 picoseconds. - Weight::from_parts(17_017_673, 0) - .saturating_add(Weight::from_parts(0, 1555)) - // Standard Error: 37 - .saturating_add(Weight::from_parts(1_794, 0).saturating_mul(b.into())) - // Standard Error: 389 - .saturating_add(Weight::from_parts(17_573, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:0) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `69 + m * (32 ±0)` - // Estimated: `3535 + m * (32 ±0)` - // Minimum execution time: 22_242_000 picoseconds. - Weight::from_parts(20_639_986, 0) - .saturating_add(Weight::from_parts(0, 3535)) - // Standard Error: 52 - .saturating_add(Weight::from_parts(2_149, 0).saturating_mul(b.into())) - // Standard Error: 539 - .saturating_add(Weight::from_parts(32_467, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalCount` (r:1 w:1) - /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[2, 100]`. - /// The range of component `p` is `[1, 100]`. - fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `359 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3751 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 27_992_000 picoseconds. - Weight::from_parts(28_320_057, 0) - .saturating_add(Weight::from_parts(0, 3751)) - // Standard Error: 84 - .saturating_add(Weight::from_parts(3_120, 0).saturating_mul(b.into())) - // Standard Error: 883 - .saturating_add(Weight::from_parts(25_820, 0).saturating_mul(m.into())) - // Standard Error: 872 - .saturating_add(Weight::from_parts(236_120, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[5, 100]`. - fn vote(m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `808 + m * (64 ±0)` - // Estimated: `4272 + m * (64 ±0)` - // Minimum execution time: 26_289_000 picoseconds. - Weight::from_parts(26_849_904, 0) - .saturating_add(Weight::from_parts(0, 4272)) - // Standard Error: 751 - .saturating_add(Weight::from_parts(43_639, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `397 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3842 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 30_557_000 picoseconds. - Weight::from_parts(30_301_692, 0) - .saturating_add(Weight::from_parts(0, 3842)) - // Standard Error: 921 - .saturating_add(Weight::from_parts(36_555, 0).saturating_mul(m.into())) - // Standard Error: 898 - .saturating_add(Weight::from_parts(230_926, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `699 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4016 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 44_764_000 picoseconds. - Weight::from_parts(46_285_473, 0) - .saturating_add(Weight::from_parts(0, 4016)) - // Standard Error: 122 - .saturating_add(Weight::from_parts(1_829, 0).saturating_mul(b.into())) - // Standard Error: 1_290 - .saturating_add(Weight::from_parts(32_116, 0).saturating_mul(m.into())) - // Standard Error: 1_258 - .saturating_add(Weight::from_parts(260_757, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `417 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3862 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 33_643_000 picoseconds. - Weight::from_parts(32_822_414, 0) - .saturating_add(Weight::from_parts(0, 3862)) - // Standard Error: 1_489 - .saturating_add(Weight::from_parts(31_142, 0).saturating_mul(m.into())) - // Standard Error: 1_451 - .saturating_add(Weight::from_parts(263_177, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `719 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4036 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 47_669_000 picoseconds. - Weight::from_parts(48_789_236, 0) - .saturating_add(Weight::from_parts(0, 4036)) - // Standard Error: 126 - .saturating_add(Weight::from_parts(2_602, 0).saturating_mul(b.into())) - // Standard Error: 1_342 - .saturating_add(Weight::from_parts(28_839, 0).saturating_mul(m.into())) - // Standard Error: 1_308 - .saturating_add(Weight::from_parts(258_459, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[1, 100]`. - fn disapprove_proposal(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `226 + p * (32 ±0)` - // Estimated: `1711 + p * (32 ±0)` - // Minimum execution time: 17_502_000 picoseconds. - Weight::from_parts(18_524_687, 0) - .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 551 - .saturating_add(Weight::from_parts(220_862, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) - } -} diff --git a/runtime/altair/src/weights/pallet_collective_council.rs b/runtime/altair/src/weights/pallet_collective_council.rs new file mode 100644 index 0000000000..4f7d6ca0d5 --- /dev/null +++ b/runtime/altair/src/weights/pallet_collective_council.rs @@ -0,0 +1,287 @@ + +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { + /// Storage: Council Members (r:1 w:1) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:0) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:100 w:100) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Prime (r:0 w:1) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15762 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 23_504_000 picoseconds. + Weight::from_parts(24_045_000, 0) + .saturating_add(Weight::from_parts(0, 15762)) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(4_726_718, 0).saturating_mul(m.into())) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(8_779_554, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `1589 + m * (32 ±0)` + // Minimum execution time: 24_235_000 picoseconds. + Weight::from_parts(23_250_984, 0) + .saturating_add(Weight::from_parts(0, 1589)) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_948, 0).saturating_mul(b.into())) + // Standard Error: 371 + .saturating_add(Weight::from_parts(18_660, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:0) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 28_623_000 picoseconds. + Weight::from_parts(27_427_537, 0) + .saturating_add(Weight::from_parts(0, 3569)) + // Standard Error: 44 + .saturating_add(Weight::from_parts(1_964, 0).saturating_mul(b.into())) + // Standard Error: 459 + .saturating_add(Weight::from_parts(27_792, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalCount (r:1 w:1) + /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `393 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3785 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 37_019_000 picoseconds. + Weight::from_parts(36_618_582, 0) + .saturating_add(Weight::from_parts(0, 3785)) + // Standard Error: 94 + .saturating_add(Weight::from_parts(2_958, 0).saturating_mul(b.into())) + // Standard Error: 986 + .saturating_add(Weight::from_parts(25_992, 0).saturating_mul(m.into())) + // Standard Error: 973 + .saturating_add(Weight::from_parts(241_104, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `842 + m * (64 ±0)` + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 31_509_000 picoseconds. + Weight::from_parts(32_380_933, 0) + .saturating_add(Weight::from_parts(0, 4306)) + // Standard Error: 670 + .saturating_add(Weight::from_parts(42_211, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `431 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3876 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 40_866_000 picoseconds. + Weight::from_parts(40_128_300, 0) + .saturating_add(Weight::from_parts(0, 3876)) + // Standard Error: 900 + .saturating_add(Weight::from_parts(35_686, 0).saturating_mul(m.into())) + // Standard Error: 878 + .saturating_add(Weight::from_parts(232_805, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4050 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 58_508_000 picoseconds. + Weight::from_parts(58_282_994, 0) + .saturating_add(Weight::from_parts(0, 4050)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(2_776, 0).saturating_mul(b.into())) + // Standard Error: 2_014 + .saturating_add(Weight::from_parts(14_102, 0).saturating_mul(m.into())) + // Standard Error: 1_963 + .saturating_add(Weight::from_parts(284_218, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `451 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3896 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 44_563_000 picoseconds. + Weight::from_parts(44_023_999, 0) + .saturating_add(Weight::from_parts(0, 3896)) + // Standard Error: 807 + .saturating_add(Weight::from_parts(39_142, 0).saturating_mul(m.into())) + // Standard Error: 787 + .saturating_add(Weight::from_parts(229_511, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4070 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 62_106_000 picoseconds. + Weight::from_parts(62_287_266, 0) + .saturating_add(Weight::from_parts(0, 4070)) + // Standard Error: 141 + .saturating_add(Weight::from_parts(2_748, 0).saturating_mul(b.into())) + // Standard Error: 1_497 + .saturating_add(Weight::from_parts(32_032, 0).saturating_mul(m.into())) + // Standard Error: 1_459 + .saturating_add(Weight::from_parts(275_044, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `260 + p * (32 ±0)` + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 23_244_000 picoseconds. + Weight::from_parts(24_758_733, 0) + .saturating_add(Weight::from_parts(0, 1745)) + // Standard Error: 752 + .saturating_add(Weight::from_parts(216_365, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } +} diff --git a/runtime/altair/src/weights/pallet_collective_technical_fellowship.rs b/runtime/altair/src/weights/pallet_collective_technical_fellowship.rs new file mode 100644 index 0000000000..4f7d6ca0d5 --- /dev/null +++ b/runtime/altair/src/weights/pallet_collective_technical_fellowship.rs @@ -0,0 +1,287 @@ + +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { + /// Storage: Council Members (r:1 w:1) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:0) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:100 w:100) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Prime (r:0 w:1) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15762 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 23_504_000 picoseconds. + Weight::from_parts(24_045_000, 0) + .saturating_add(Weight::from_parts(0, 15762)) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(4_726_718, 0).saturating_mul(m.into())) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(8_779_554, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `1589 + m * (32 ±0)` + // Minimum execution time: 24_235_000 picoseconds. + Weight::from_parts(23_250_984, 0) + .saturating_add(Weight::from_parts(0, 1589)) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_948, 0).saturating_mul(b.into())) + // Standard Error: 371 + .saturating_add(Weight::from_parts(18_660, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:0) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 28_623_000 picoseconds. + Weight::from_parts(27_427_537, 0) + .saturating_add(Weight::from_parts(0, 3569)) + // Standard Error: 44 + .saturating_add(Weight::from_parts(1_964, 0).saturating_mul(b.into())) + // Standard Error: 459 + .saturating_add(Weight::from_parts(27_792, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalCount (r:1 w:1) + /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `393 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3785 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 37_019_000 picoseconds. + Weight::from_parts(36_618_582, 0) + .saturating_add(Weight::from_parts(0, 3785)) + // Standard Error: 94 + .saturating_add(Weight::from_parts(2_958, 0).saturating_mul(b.into())) + // Standard Error: 986 + .saturating_add(Weight::from_parts(25_992, 0).saturating_mul(m.into())) + // Standard Error: 973 + .saturating_add(Weight::from_parts(241_104, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `842 + m * (64 ±0)` + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 31_509_000 picoseconds. + Weight::from_parts(32_380_933, 0) + .saturating_add(Weight::from_parts(0, 4306)) + // Standard Error: 670 + .saturating_add(Weight::from_parts(42_211, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `431 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3876 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 40_866_000 picoseconds. + Weight::from_parts(40_128_300, 0) + .saturating_add(Weight::from_parts(0, 3876)) + // Standard Error: 900 + .saturating_add(Weight::from_parts(35_686, 0).saturating_mul(m.into())) + // Standard Error: 878 + .saturating_add(Weight::from_parts(232_805, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4050 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 58_508_000 picoseconds. + Weight::from_parts(58_282_994, 0) + .saturating_add(Weight::from_parts(0, 4050)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(2_776, 0).saturating_mul(b.into())) + // Standard Error: 2_014 + .saturating_add(Weight::from_parts(14_102, 0).saturating_mul(m.into())) + // Standard Error: 1_963 + .saturating_add(Weight::from_parts(284_218, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `451 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3896 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 44_563_000 picoseconds. + Weight::from_parts(44_023_999, 0) + .saturating_add(Weight::from_parts(0, 3896)) + // Standard Error: 807 + .saturating_add(Weight::from_parts(39_142, 0).saturating_mul(m.into())) + // Standard Error: 787 + .saturating_add(Weight::from_parts(229_511, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4070 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 62_106_000 picoseconds. + Weight::from_parts(62_287_266, 0) + .saturating_add(Weight::from_parts(0, 4070)) + // Standard Error: 141 + .saturating_add(Weight::from_parts(2_748, 0).saturating_mul(b.into())) + // Standard Error: 1_497 + .saturating_add(Weight::from_parts(32_032, 0).saturating_mul(m.into())) + // Standard Error: 1_459 + .saturating_add(Weight::from_parts(275_044, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `260 + p * (32 ±0)` + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 23_244_000 picoseconds. + Weight::from_parts(24_758_733, 0) + .saturating_add(Weight::from_parts(0, 1745)) + // Standard Error: 752 + .saturating_add(Weight::from_parts(216_365, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } +} diff --git a/runtime/altair/src/weights/pallet_conviction_voting.rs b/runtime/altair/src/weights/pallet_conviction_voting.rs new file mode 100644 index 0000000000..ceacadefaa --- /dev/null +++ b/runtime/altair/src/weights/pallet_conviction_voting.rs @@ -0,0 +1,176 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_conviction_voting.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_conviction_voting`. +pub struct WeightInfo(PhantomData); +impl pallet_conviction_voting::WeightInfo for WeightInfo { + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `13445` + // Estimated: `42428` + // Minimum execution time: 128_222_000 picoseconds. + Weight::from_parts(133_397_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `14166` + // Estimated: `83866` + // Minimum execution time: 193_274_000 picoseconds. + Weight::from_parts(206_120_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn remove_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `13918` + // Estimated: `83866` + // Minimum execution time: 169_729_000 picoseconds. + Weight::from_parts(181_847_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn remove_other_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `13004` + // Estimated: `30706` + // Minimum execution time: 74_834_000 picoseconds. + Weight::from_parts(83_047_000, 0) + .saturating_add(Weight::from_parts(0, 30706)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:2 w:2) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 512]`. + fn delegate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `29640 + r * (365 ±0)` + // Estimated: `83866 + r * (3411 ±0)` + // Minimum execution time: 65_741_000 picoseconds. + Weight::from_parts(1_683_585_056, 0) + .saturating_add(Weight::from_parts(0, 83866)) + // Standard Error: 146_560 + .saturating_add(Weight::from_parts(40_661_211, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into())) + } + /// Storage: `ConvictionVoting::VotingFor` (r:2 w:2) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 512]`. + fn undelegate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `29555 + r * (365 ±0)` + // Estimated: `83866 + r * (3411 ±0)` + // Minimum execution time: 38_557_000 picoseconds. + Weight::from_parts(1_664_510_198, 0) + .saturating_add(Weight::from_parts(0, 83866)) + // Standard Error: 147_721 + .saturating_add(Weight::from_parts(40_405_805, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into())) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `12218` + // Estimated: `30706` + // Minimum execution time: 94_790_000 picoseconds. + Weight::from_parts(100_982_000, 0) + .saturating_add(Weight::from_parts(0, 30706)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/altair/src/weights/pallet_membership.rs b/runtime/altair/src/weights/pallet_membership.rs new file mode 100644 index 0000000000..8641ae5ff1 --- /dev/null +++ b/runtime/altair/src/weights/pallet_membership.rs @@ -0,0 +1,188 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_membership.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_membership`. +pub struct WeightInfo(PhantomData); +impl pallet_membership::WeightInfo for WeightInfo { + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 99]`. + fn add_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `174 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 17_443_000 picoseconds. + Weight::from_parts(18_272_399, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 376 + .saturating_add(Weight::from_parts(33_633, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn remove_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 19_826_000 picoseconds. + Weight::from_parts(20_859_732, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 667 + .saturating_add(Weight::from_parts(33_155, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn swap_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 20_151_000 picoseconds. + Weight::from_parts(20_774_114, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 447 + .saturating_add(Weight::from_parts(44_052, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn reset_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 19_846_000 picoseconds. + Weight::from_parts(20_903_563, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 865 + .saturating_add(Weight::from_parts(149_306, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn change_key(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 20_523_000 picoseconds. + Weight::from_parts(21_705_085, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 948 + .saturating_add(Weight::from_parts(44_568, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:0) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalMembership Prime (r:0 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn set_prime(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `32 + m * (32 ±0)` + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 8_032_000 picoseconds. + Weight::from_parts(8_386_682, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(9_724, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Prime (r:0 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn clear_prime(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_061_000 picoseconds. + Weight::from_parts(3_304_217, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 80 + .saturating_add(Weight::from_parts(273, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/altair/src/weights/pallet_referenda.rs b/runtime/altair/src/weights/pallet_referenda.rs new file mode 100644 index 0000000000..f65c6cd82a --- /dev/null +++ b/runtime/altair/src/weights/pallet_referenda.rs @@ -0,0 +1,480 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_referenda.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_referenda`. +pub struct WeightInfo(PhantomData); +impl pallet_referenda::WeightInfo for WeightInfo { + /// Storage: `Referenda::ReferendumCount` (r:1 w:1) + /// Proof: `Referenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:0 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn submit() -> Weight { + // Proof Size summary in bytes: + // Measured: `186` + // Estimated: `42428` + // Minimum execution time: 35_376_000 picoseconds. + Weight::from_parts(36_517_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 49_778_000 picoseconds. + Weight::from_parts(50_686_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3226` + // Estimated: `42428` + // Minimum execution time: 61_681_000 picoseconds. + Weight::from_parts(63_483_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3246` + // Estimated: `42428` + // Minimum execution time: 60_699_000 picoseconds. + Weight::from_parts(62_223_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 61_401_000 picoseconds. + Weight::from_parts(62_890_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 57_572_000 picoseconds. + Weight::from_parts(59_953_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn refund_decision_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `279` + // Estimated: `4401` + // Minimum execution time: 26_730_000 picoseconds. + Weight::from_parts(28_055_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn refund_submission_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `269` + // Estimated: `4401` + // Minimum execution time: 27_341_000 picoseconds. + Weight::from_parts(28_373_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn cancel() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `83866` + // Minimum execution time: 33_650_000 picoseconds. + Weight::from_parts(35_107_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:1 w:0) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn kill() -> Weight { + // Proof Size summary in bytes: + // Measured: `588` + // Estimated: `83866` + // Minimum execution time: 96_383_000 picoseconds. + Weight::from_parts(99_296_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:0) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + fn one_fewer_deciding_queue_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `102` + // Estimated: `5477` + // Minimum execution time: 8_323_000 picoseconds. + Weight::from_parts(8_776_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn one_fewer_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3116` + // Estimated: `42428` + // Minimum execution time: 46_817_000 picoseconds. + Weight::from_parts(48_988_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn one_fewer_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3116` + // Estimated: `42428` + // Minimum execution time: 50_644_000 picoseconds. + Weight::from_parts(51_929_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_insertion() -> Weight { + // Proof Size summary in bytes: + // Measured: `2939` + // Estimated: `5477` + // Minimum execution time: 22_716_000 picoseconds. + Weight::from_parts(23_508_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_slide() -> Weight { + // Proof Size summary in bytes: + // Measured: `2939` + // Estimated: `5477` + // Minimum execution time: 22_223_000 picoseconds. + Weight::from_parts(23_359_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `2943` + // Estimated: `5477` + // Minimum execution time: 26_541_000 picoseconds. + Weight::from_parts(27_446_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `2963` + // Estimated: `5477` + // Minimum execution time: 25_749_000 picoseconds. + Weight::from_parts(26_662_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_no_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `299` + // Estimated: `42428` + // Minimum execution time: 21_944_000 picoseconds. + Weight::from_parts(23_129_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 22_252_000 picoseconds. + Weight::from_parts(23_071_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn nudge_referendum_timed_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `4401` + // Minimum execution time: 14_336_000 picoseconds. + Weight::from_parts(15_039_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 31_108_000 picoseconds. + Weight::from_parts(32_446_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 33_666_000 picoseconds. + Weight::from_parts(34_575_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 30_250_000 picoseconds. + Weight::from_parts(31_267_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_end_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `383` + // Estimated: `42428` + // Minimum execution time: 30_782_000 picoseconds. + Weight::from_parts(32_258_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_not_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 28_260_000 picoseconds. + Weight::from_parts(29_450_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `404` + // Estimated: `42428` + // Minimum execution time: 27_024_000 picoseconds. + Weight::from_parts(28_253_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + fn nudge_referendum_approved() -> Weight { + // Proof Size summary in bytes: + // Measured: `404` + // Estimated: `83866` + // Minimum execution time: 41_811_000 picoseconds. + Weight::from_parts(42_989_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_rejected() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 30_478_000 picoseconds. + Weight::from_parts(31_556_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:0 w:1) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn set_some_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `350` + // Estimated: `4401` + // Minimum execution time: 18_549_000 picoseconds. + Weight::from_parts(19_181_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:1 w:1) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `283` + // Estimated: `4401` + // Minimum execution time: 16_085_000 picoseconds. + Weight::from_parts(16_480_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/altair/src/weights/pallet_whitelist.rs b/runtime/altair/src/weights/pallet_whitelist.rs new file mode 100644 index 0000000000..ca08d2c3c1 --- /dev/null +++ b/runtime/altair/src/weights/pallet_whitelist.rs @@ -0,0 +1,99 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_whitelist.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_whitelist`. +pub struct WeightInfo(PhantomData); +impl pallet_whitelist::WeightInfo for WeightInfo { + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn whitelist_call() -> Weight { + // Proof Size summary in bytes: + // Measured: `84` + // Estimated: `3556` + // Minimum execution time: 18_497_000 picoseconds. + Weight::from_parts(18_977_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn remove_whitelisted_call() -> Weight { + // Proof Size summary in bytes: + // Measured: `213` + // Estimated: `3556` + // Minimum execution time: 16_070_000 picoseconds. + Weight::from_parts(16_697_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:1 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// The range of component `n` is `[1, 4194294]`. + fn dispatch_whitelisted_call(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `289 + n * (1 ±0)` + // Estimated: `3753 + n * (1 ±0)` + // Minimum execution time: 27_611_000 picoseconds. + Weight::from_parts(27_934_000, 0) + .saturating_add(Weight::from_parts(0, 3753)) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_213, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// The range of component `n` is `[1, 10000]`. + fn dispatch_whitelisted_call_with_preimage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `213` + // Estimated: `3556` + // Minimum execution time: 19_188_000 picoseconds. + Weight::from_parts(19_932_877, 0) + .saturating_add(Weight::from_parts(0, 3556)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_418, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/altair/src/xcm.rs b/runtime/altair/src/xcm.rs index 379a0606e2..40e10a1a95 100644 --- a/runtime/altair/src/xcm.rs +++ b/runtime/altair/src/xcm.rs @@ -10,7 +10,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use cfg_primitives::types::{EnsureRootOr, HalfOfCouncil}; use cfg_types::tokens::CurrencyId; use frame_support::{ parameter_types, @@ -22,6 +21,7 @@ use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; use orml_xcm_support::MultiNativeAsset; use pallet_xcm::XcmPassthrough; use runtime_common::{ + origins::gov::types::{EnsureRootOr, HalfOfCouncil}, transfer_filter::PreXcmTransfer, xcm::{ AccountIdToLocation, Barrier, CanonicalNativePerSecond, FixedConversionRateProvider, diff --git a/runtime/centrifuge/src/lib.rs b/runtime/centrifuge/src/lib.rs index bff5b9355b..286b80c639 100644 --- a/runtime/centrifuge/src/lib.rs +++ b/runtime/centrifuge/src/lib.rs @@ -23,10 +23,9 @@ use cfg_primitives::{ constants::*, liquidity_pools::GeneralCurrencyPrefix, types::{ - AccountId, Address, AllOfCouncil, AuraId, Balance, BlockNumber, CollectionId, - CouncilCollective, EnsureRootOr, HalfOfCouncil, Hash, Hashing, Header, IBalance, ItemId, - LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, PoolFeeId, PoolId, - Signature, ThreeFourthOfCouncil, TrancheId, TrancheWeight, TwoThirdOfCouncil, + AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header, + IBalance, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, + PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight, }, }; use cfg_traits::{ @@ -111,12 +110,16 @@ use runtime_common::{ }, fees::{DealWithFees, FeeToTreasury, WeightToFee}, gateway, instances, + instances::CouncilCollective, liquidity_pools::LiquidityPoolsMessage, message_queue::{NarrowOriginToSibling, ParaIdToSibling}, oracle::{ Feeder, OracleConverterBridge, OracleRatioProvider, OracleRatioProviderLocalAssetExtension, }, origin::EnsureAccountOrRootOr, + origins::gov::types::{ + AllOfCouncil, EnsureRootOr, HalfOfCouncil, ThreeFourthOfCouncil, TwoThirdOfCouncil, + }, permissions::PoolAdminCheck, rewards::SingleCurrencyMovement, transfer_filter::{PreLpTransfer, PreNativeTransfer}, @@ -165,7 +168,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("centrifuge"), impl_name: create_runtime_str!("centrifuge"), authoring_version: 1, - spec_version: 1103, + spec_version: 1200, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -2080,7 +2083,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - migrations::UpgradeCentrifuge1103, + migrations::UpgradeCentrifuge1200, >; // Frame Order in this block dictates the index of each one in the metadata diff --git a/runtime/centrifuge/src/migrations.rs b/runtime/centrifuge/src/migrations.rs index 05cabf53aa..0defe2a353 100644 --- a/runtime/centrifuge/src/migrations.rs +++ b/runtime/centrifuge/src/migrations.rs @@ -10,45 +10,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use cfg_primitives::AccountId; -use frame_support::parameter_types; -use sp_std::{vec, vec::Vec}; - -use crate::{OraclePriceCollection, OraclePriceFeed}; - -// Number of identities on Centrifuge Chain on 29.05.2024 was 34 -const IDENTITY_MIGRATION_KEY_LIMIT: u64 = 1000; - -parameter_types! { - // Address used by Anemoy to withdraw in AssetHub - // 4dTeMxuPJCK7zQGhFcgCivSJqBs9Wo2SuMSQeYCCuVJ9xrE2 --> 5CSfibAR9HHEwKpXbdsDHguAmLgKS6yKat2joTLA75DZ152L - pub AccountMap: Vec<(AccountId, AccountId)> = vec![ - ( - AccountId::new(hex_literal::hex!("5dbb2cec05b6bda775f7945827b887b0e7b5245eae8b4ef266c60820c9377185")), - AccountId::new(hex_literal::hex!("10c03288a534d77418e3c19e745dfbc952423e179e1e3baa89e287092fc7802f")) - ) - ]; -} - /// The migration set for Centrifuge @ Polkadot. /// It includes all the migrations that have to be applied on that chain. -pub type UpgradeCentrifuge1103 = ( - runtime_common::migrations::increase_storage_version::Migration, - runtime_common::migrations::increase_storage_version::Migration, - pallet_collator_selection::migration::v1::MigrateToV1, - pallet_collator_selection::migration::v2::MigrationToV2, - runtime_common::migrations::loans::AddWithLinearPricing, - runtime_common::migrations::hold_reason::MigrateTransferAllowListHolds< - crate::Runtime, - crate::RuntimeHoldReason, - >, - // Migrations below this comment originate from Polkadot SDK - pallet_xcm::migration::MigrateToLatestXcmVersion, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - pallet_identity::migration::versioned::V0ToV1, - pallet_uniques::migration::MigrateV0ToV1, - runtime_common::migrations::restricted_location::MigrateRestrictedTransferLocation< - crate::Runtime, - AccountMap, - >, -); +pub type UpgradeCentrifuge1200 = (); diff --git a/runtime/centrifuge/src/xcm.rs b/runtime/centrifuge/src/xcm.rs index ef74d41fe1..f454f5f695 100644 --- a/runtime/centrifuge/src/xcm.rs +++ b/runtime/centrifuge/src/xcm.rs @@ -10,7 +10,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use cfg_primitives::types::{EnsureRootOr, HalfOfCouncil}; use cfg_traits::TryConvert; use cfg_types::{tokens::CurrencyId, EVMChainId}; use frame_support::{ @@ -23,6 +22,7 @@ use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; use orml_xcm_support::MultiNativeAsset; use pallet_xcm::XcmPassthrough; use runtime_common::{ + origins::gov::types::{EnsureRootOr, HalfOfCouncil}, transfer_filter::PreXcmTransfer, xcm::{ AccountIdToLocation, Barrier, CanonicalNativePerSecond, FixedConversionRateProvider, diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 29dd4bd01c..01cfd23ebc 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -39,6 +39,7 @@ pub mod fees; pub mod gateway; pub mod migrations; pub mod oracle; +pub mod origins; pub mod pool; pub mod remarks; pub mod transfer_filter; @@ -47,6 +48,19 @@ pub mod xcm; pub mod instances { /// The rewards associated to block rewards pub type BlockRewards = pallet_rewards::Instance1; + + /// The technical fellowship collective which can whitelist proposal for the + /// WhitelistedCaller track + pub type TechnicalCollective = pallet_collective::Instance2; + + /// The technical membership which handles membership of the + /// TechnicalCollective. It is not linked to the WhitelistedCaller track. + pub type TechnicalMembership = pallet_membership::Instance1; + + /// The council collective which is used in Gov1. + /// + /// NOTE: Will be deprecated once we have fully transitioned to OpenGov. + pub type CouncilCollective = pallet_collective::Instance1; } parameter_types! { @@ -547,7 +561,6 @@ pub mod origin { #[cfg(test)] mod test { - use cfg_primitives::HalfOfCouncil; use frame_support::traits::EnsureOrigin; use sp_core::{crypto::AccountId32, parameter_types}; @@ -613,6 +626,7 @@ pub mod origin { mod ensure_account_or_root_or { use super::*; + use crate::origins::gov::types::HalfOfCouncil; #[test] fn works_with_account() { diff --git a/runtime/common/src/migrations/mod.rs b/runtime/common/src/migrations/mod.rs index c74db367ff..dd3cd7bb78 100644 --- a/runtime/common/src/migrations/mod.rs +++ b/runtime/common/src/migrations/mod.rs @@ -18,6 +18,7 @@ pub mod loans; pub mod nuke; pub mod precompile_account_codes; pub mod restricted_location; +pub mod technical_comittee; pub mod utils { use frame_support::storage::unhashed; diff --git a/runtime/common/src/migrations/technical_comittee.rs b/runtime/common/src/migrations/technical_comittee.rs new file mode 100644 index 0000000000..edd38df836 --- /dev/null +++ b/runtime/common/src/migrations/technical_comittee.rs @@ -0,0 +1,90 @@ +// Copyright 2024 Centrifuge Foundation (centrifuge.io). +// +// This file is part of the Centrifuge chain project. +// Centrifuge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version (see http://www.gnu.org/licenses). +// Centrifuge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +use frame_support::traits::{Get, InitializeMembers, OnRuntimeUpgrade}; +use pallet_order_book::weights::Weight; +use sp_arithmetic::traits::SaturatedConversion; +use sp_runtime::BoundedVec; +use sp_std::vec::Vec; + +use crate::instances::{TechnicalCollective, TechnicalMembership}; + +const LOG_PREFIX: &str = "InitTechnicalCommittee:"; + +pub struct InitMigration(sp_std::marker::PhantomData<(T, Members)>); + +impl OnRuntimeUpgrade for InitMigration +where + T: frame_system::Config + + pallet_membership::Config + + pallet_collective::Config, + Members: Get>, +{ + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::DispatchError> { + let membership_members = pallet_membership::Members::::get(); + let collective_members = pallet_collective::Members::::get(); + assert!(membership_members.is_empty()); + assert!(collective_members.is_empty()); + assert!(!Members::get().is_empty()); + + log::info!("{LOG_PREFIX} Pre checks done"); + + Ok(sp_std::vec![]) + } + + fn on_runtime_upgrade() -> Weight { + let membership_members = pallet_membership::Members::::get(); + let collective_members = pallet_collective::Members::::get(); + + if membership_members.is_empty() && collective_members.is_empty() { + log::info!("{LOG_PREFIX} Setting up members"); + as InitializeMembers< + T::AccountId, + >>::initialize_members(&Members::get()); + pallet_membership::Members::::put(BoundedVec::truncate_from( + Members::get(), + )); + + log::info!("{LOG_PREFIX} Migration done"); + T::DbWeight::get() + .reads_writes(2, Members::get().len().saturating_add(1).saturated_into()) + } else { + log::warn!("{LOG_PREFIX} Members are not empty. Skipping initialization. This migration should probably be removed"); + T::DbWeight::get().reads(2) + } + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), sp_runtime::DispatchError> { + let membership_members = pallet_membership::Members::::get(); + let collective_members = pallet_collective::Members::::get(); + assert_eq!( + collective_members, + Members::get(), + "Collective members {} vs input {}", + collective_members.len(), + Members::get().len() + ); + assert_eq!( + membership_members.clone().into_inner(), + Members::get(), + "Membership members {} vs input {}", + membership_members.len(), + Members::get().len() + ); + + log::info!("{LOG_PREFIX} Post checks done"); + + Ok(()) + } +} diff --git a/runtime/common/src/origins.rs b/runtime/common/src/origins.rs new file mode 100644 index 0000000000..f9010441e5 --- /dev/null +++ b/runtime/common/src/origins.rs @@ -0,0 +1,132 @@ +// Copyright 2024 Centrifuge Foundation (centrifuge.io). +// +// This file is part of the Centrifuge chain project. +// Centrifuge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version (see http://www.gnu.org/licenses). +// Centrifuge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +/// Custom origins for governance interventions. +pub mod gov { + pub use pallet_custom_origins::*; + + #[frame_support::pallet] + pub mod pallet_custom_origins { + use frame_support::pallet_prelude::*; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); + + #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] + #[pallet::origin] + pub enum Origin { + /// Origin able to dispatch a whitelisted call. + WhitelistedCaller, + /// Origin for spending (any amount of) funds. + Treasurer, + /// Origin for pool related referenda. + PoolAdmin, + /// Origin able to cancel referenda. + ReferendumCanceller, + /// Origin able to kill referenda. + ReferendumKiller, + } + + macro_rules! decl_unit_ensures { + ( $name:ident: $success_type:ty = $success:expr ) => { + pub struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::$name => Ok($success), + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::$name)) + } + } + }; + ( $name:ident ) => { decl_unit_ensures! { $name : () = () } }; + ( $name:ident: $success_type:ty = $success:expr, $( $rest:tt )* ) => { + decl_unit_ensures! { $name: $success_type = $success } + decl_unit_ensures! { $( $rest )* } + }; + ( $name:ident, $( $rest:tt )* ) => { + decl_unit_ensures! { $name } + decl_unit_ensures! { $( $rest )* } + }; + () => {} + } + + decl_unit_ensures!( + WhitelistedCaller, + PoolAdmin, + Treasurer, + ReferendumCanceller, + ReferendumKiller, + ); + } + + pub mod types { + use cfg_primitives::AccountId; + use frame_support::traits::{EitherOf, EitherOfDiverse}; + use frame_system::EnsureRoot; + use pallet_collective::EnsureProportionAtLeast; + + use super::*; + use crate::instances::{CouncilCollective, TechnicalCollective}; + + // Ensure that origin is either Root or fallback to use EnsureOrigin `O` + pub type EnsureRootOr = EitherOfDiverse, O>; + + /// All council members must vote yes to create this origin. + pub type AllOfCouncil = EnsureProportionAtLeast; + + /// 1/2 of all council members must vote yes to create this origin. + pub type HalfOfCouncil = EnsureProportionAtLeast; + + /// 2/3 of all council members must vote yes to create this origin. + pub type TwoThirdOfCouncil = EnsureProportionAtLeast; + + /// 3/4 of all council members must vote yes to create this origin. + pub type ThreeFourthOfCouncil = EnsureProportionAtLeast; + + /// 1/2 of all technical committee members must vote yes to create this + /// origin. + pub type HalfOfTechnicalCommitte = + EnsureProportionAtLeast; + + /// The origin which approves and rejects treasury spends. + /// + /// NOTE: The council will be removed once the OpenGov transition has + /// concluded. + pub type TreasuryApproveOrigin = EnsureRootOr>; + + /// The origin which can whitelist calls. + pub type WhitelistOrigin = EnsureRootOr; + + /// The origin which dispatches whitelisted calls. + pub type DispatchWhitelistedOrigin = EnsureRootOr; + + /// The origin which can cancel ongoing referenda. + pub type RefCancelOrigin = EnsureRootOr; + + /// The origin which can kill ongoing referenda. + pub type RefKillerOrigin = EnsureRootOr; + + /// The origin which can create new pools. + pub type PoolCreateOrigin = EnsureRootOr; + } +} diff --git a/runtime/development/Cargo.toml b/runtime/development/Cargo.toml index 62c00bdaf2..af8e2eb92f 100644 --- a/runtime/development/Cargo.toml +++ b/runtime/development/Cargo.toml @@ -19,6 +19,7 @@ serde = { workspace = true, optional = true } static_assertions = { workspace = true } sp-api = { workspace = true } +sp-arithmetic = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } sp-core = { workspace = true } @@ -66,6 +67,7 @@ fp-self-contained = { workspace = true } cfg-primitives = { workspace = true } cfg-traits = { workspace = true } cfg-types = { workspace = true } +cfg-utils = { workspace = true } liquidity-pools-gateway-routers = { workspace = true } runtime-common = { workspace = true } @@ -92,6 +94,7 @@ pallet-bridge = { workspace = true } pallet-collator-allowlist = { workspace = true } pallet-collator-selection = { workspace = true } pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } pallet-elections-phragmen = { workspace = true } pallet-ethereum = { workspace = true } @@ -120,6 +123,7 @@ pallet-pool-registry = { workspace = true } pallet-pool-system = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } pallet-remarks = { workspace = true } pallet-restricted-tokens = { workspace = true } pallet-restricted-xtokens = { workspace = true } @@ -136,6 +140,7 @@ pallet-treasury = { workspace = true } pallet-uniques = { workspace = true } pallet-utility = { workspace = true } pallet-vesting = { workspace = true } +pallet-whitelist = { workspace = true } pallet-xcm = { workspace = true } pallet-xcm-transactor = { workspace = true } staging-parachain-info = { workspace = true } @@ -154,6 +159,7 @@ std = [ "serde/std", # Substrate related "sp-api/std", + "sp-arithmetic/std", "sp-runtime/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -192,6 +198,7 @@ std = [ "polkadot-parachain-primitives/std", # Locals "cfg-primitives/std", + "cfg-utils/std", "cfg-traits/std", "cfg-types/std", "runtime-common/std", @@ -219,6 +226,7 @@ std = [ "pallet-collator-allowlist/std", "pallet-collator-selection/std", "pallet-collective/std", + "pallet-conviction-voting/std", "pallet-democracy/std", "pallet-elections-phragmen/std", "pallet-ethereum/std", @@ -246,6 +254,7 @@ std = [ "pallet-pool-system/std", "pallet-preimage/std", "pallet-proxy/std", + "pallet-referenda/std", "pallet-remarks/std", "pallet-restricted-tokens/std", "pallet-restricted-xtokens/std", @@ -262,6 +271,7 @@ std = [ "pallet-uniques/std", "pallet-utility/std", "pallet-vesting/std", + "pallet-whitelist/std", "pallet-xcm/std", "pallet-xcm-transactor/std", "pallet-message-queue/std", @@ -285,6 +295,7 @@ runtime-benchmarks = [ "polkadot-parachain-primitives/runtime-benchmarks", # Locals "cfg-primitives/runtime-benchmarks", + "cfg-utils/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", "runtime-common/runtime-benchmarks", @@ -305,6 +316,7 @@ runtime-benchmarks = [ "pallet-collator-allowlist/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-collective/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", @@ -332,6 +344,7 @@ runtime-benchmarks = [ "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-remarks/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", "pallet-restricted-tokens/runtime-benchmarks", "pallet-restricted-xtokens/runtime-benchmarks", "pallet-rewards/runtime-benchmarks", @@ -345,6 +358,7 @@ runtime-benchmarks = [ "pallet-uniques/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pallet-xcm-transactor/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", @@ -362,6 +376,7 @@ try-runtime = [ "polkadot-runtime-common/try-runtime", # Locals "cfg-primitives/try-runtime", + "cfg-utils/try-runtime", "cfg-traits/try-runtime", "cfg-types/try-runtime", "runtime-common/try-runtime", @@ -389,6 +404,7 @@ try-runtime = [ "pallet-collator-allowlist/try-runtime", "pallet-collator-selection/try-runtime", "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", "pallet-democracy/try-runtime", "pallet-elections-phragmen/try-runtime", "pallet-ethereum/try-runtime", @@ -416,6 +432,7 @@ try-runtime = [ "pallet-pool-system/try-runtime", "pallet-preimage/try-runtime", "pallet-proxy/try-runtime", + "pallet-referenda/try-runtime", "pallet-remarks/try-runtime", "pallet-restricted-tokens/try-runtime", "pallet-restricted-xtokens/try-runtime", @@ -432,6 +449,7 @@ try-runtime = [ "pallet-uniques/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", + "pallet-whitelist/try-runtime", "pallet-xcm/try-runtime", "pallet-xcm-transactor/try-runtime", "pallet-message-queue/try-runtime", diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index 4d0360b097..8dd575a7ca 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -23,10 +23,9 @@ use cfg_primitives::{ constants::*, liquidity_pools::GeneralCurrencyPrefix, types::{ - AccountId, Address, AllOfCouncil, AuraId, Balance, BlockNumber, CollectionId, - CouncilCollective, EnsureRootOr, HalfOfCouncil, Hash, Hashing, Header, IBalance, ItemId, - LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, PoolFeeId, PoolId, - Signature, TrancheId, TrancheWeight, TwoThirdOfCouncil, + AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header, + IBalance, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex, PoolEpochId, + PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight, }, }; use cfg_traits::{ @@ -61,7 +60,7 @@ use frame_support::{ traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, Contains, EitherOfDiverse, + AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, Contains, EitherOf, EitherOfDiverse, EqualPrivilegeOnly, Get, InstanceFilter, LinearStoragePrice, LockIdentifier, OnFinalize, PalletInfoAccess, TransformOrigin, UnixTime, WithdrawReasons, }, @@ -73,7 +72,7 @@ use frame_support::{ }; use frame_system::{ limits::{BlockLength, BlockWeights}, - EnsureRoot, EnsureSigned, + EnsureRoot, EnsureSigned, EnsureWithSuccess, }; use orml_traits::currency::MutationHooks; use pallet_anchors::AnchorData; @@ -113,11 +112,20 @@ use runtime_common::{ }, fees::{DealWithFees, FeeToTreasury, WeightToFee}, gateway, instances, + instances::{CouncilCollective, TechnicalCollective, TechnicalMembership}, liquidity_pools::LiquidityPoolsMessage, message_queue::{NarrowOriginToSibling, ParaIdToSibling}, oracle::{ Feeder, OracleConverterBridge, OracleRatioProvider, OracleRatioProviderLocalAssetExtension, }, + origins::gov::{ + pallet_custom_origins, + types::{ + AllOfCouncil, DispatchWhitelistedOrigin, EnsureRootOr, HalfOfCouncil, RefCancelOrigin, + RefKillerOrigin, TreasuryApproveOrigin, TwoThirdOfCouncil, WhitelistOrigin, + }, + PoolAdmin, Treasurer, + }, permissions::PoolAdminCheck, remarks::Remark, rewards::SingleCurrencyMovement, @@ -144,9 +152,10 @@ use sp_version::RuntimeVersion; use staging_xcm::v4::{Asset, Location}; use static_assertions::const_assert; -use crate::xcm::*; +use crate::{tracks::TracksInfo, xcm::*}; mod migrations; +mod tracks; mod weights; pub mod xcm; @@ -167,7 +176,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("centrifuge-devel"), impl_name: create_runtime_str!("centrifuge-devel"), authoring_version: 1, - spec_version: 1103, + spec_version: 1200, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -553,6 +562,11 @@ impl InstanceFilter for ProxyType { RuntimeCall::Council(..) | RuntimeCall::Elections(..) | RuntimeCall::Democracy(..) | + RuntimeCall::ConvictionVoting(..) | + RuntimeCall::Referenda(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::TechnicalCommitteeMembership(..) | + RuntimeCall::Whitelist(..) | RuntimeCall::Identity(..) | RuntimeCall::Vesting(pallet_vesting::Call::vest {..}) | RuntimeCall::Vesting(pallet_vesting::Call::vest_other {..}) | @@ -600,6 +614,12 @@ impl InstanceFilter for ProxyType { | RuntimeCall::Council(..) | RuntimeCall::Elections(..) | RuntimeCall::Utility(..) + // OpenGov calls + | RuntimeCall::ConvictionVoting(..) + | RuntimeCall::Referenda(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::TechnicalCommitteeMembership(..) + | RuntimeCall::Whitelist(..) ), ProxyType::_Staking => false, ProxyType::NonProxy => { @@ -773,7 +793,7 @@ impl pallet_collective::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type SetMembersOrigin = EnsureRoot; - type WeightInfo = weights::pallet_collective::WeightInfo; + type WeightInfo = weights::pallet_collective_council::WeightInfo; } parameter_types! { @@ -1013,9 +1033,7 @@ parameter_types! { } impl pallet_treasury::Config for Runtime { - type ApproveOrigin = EnsureRootOr< - pallet_collective::EnsureProportionAtLeast, - >; + type ApproveOrigin = TreasuryApproveOrigin; type AssetKind = (); type BalanceConverter = UnityAssetBalanceConversion; #[cfg(feature = "runtime-benchmarks")] @@ -1033,10 +1051,10 @@ impl pallet_treasury::Config for Runtime { type ProposalBond = ProposalBond; type ProposalBondMaximum = ProposalBondMaximum; type ProposalBondMinimum = ProposalBondMinimum; - type RejectOrigin = EnsureRootOr; + type RejectOrigin = TreasuryApproveOrigin; type RuntimeEvent = RuntimeEvent; type SpendFunds = (); - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; + type SpendOrigin = TreasurySpender; type SpendPeriod = SpendPeriod; type WeightInfo = pallet_treasury::weights::SubstrateWeight; } @@ -1426,7 +1444,7 @@ parameter_types! { } impl pallet_permissions::Config for Runtime { - type AdminOrigin = EnsureRootOr; + type AdminOrigin = EnsureRootOr>; type Editors = Editors; type MaxRolesPerScope = MaxRolesPerPool; type Role = Role; @@ -2036,6 +2054,91 @@ impl axelar_gateway_precompile::Config for Runtime { type WeightInfo = (); } +impl pallet_conviction_voting::Config for Runtime { + type Currency = Balances; + type MaxTurnout = + frame_support::traits::tokens::currency::ActiveIssuanceOf; + type MaxVotes = ConstU32<512>; + type Polls = Referenda; + type RuntimeEvent = RuntimeEvent; + type VoteLockingPeriod = EnactmentPeriod; + type WeightInfo = weights::pallet_conviction_voting::WeightInfo; +} + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub const SubmissionDeposit: Balance = 10 * CFG; + pub const UndecidingTimeout: BlockNumber = 14 * MINUTES; +} + +parameter_types! { + pub const MaxBalance: Balance = Balance::max_value(); +} +pub type TreasurySpender = EnsureWithSuccess, AccountId, MaxBalance>; + +impl pallet_custom_origins::Config for Runtime {} + +impl pallet_whitelist::Config for Runtime { + type DispatchWhitelistedOrigin = DispatchWhitelistedOrigin; + type Preimages = Preimage; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_whitelist::WeightInfo; + type WhitelistOrigin = WhitelistOrigin; +} + +impl pallet_referenda::Config for Runtime { + type AlarmInterval = AlarmInterval; + type CancelOrigin = RefCancelOrigin; + type Currency = Balances; + type KillOrigin = RefKillerOrigin; + type MaxQueued = ConstU32<100>; + type Preimages = Preimage; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Slash = Treasury; + type SubmissionDeposit = SubmissionDeposit; + type SubmitOrigin = frame_system::EnsureSigned; + type Tally = pallet_conviction_voting::TallyOf; + type Tracks = TracksInfo; + type UndecidingTimeout = UndecidingTimeout; + type Votes = pallet_conviction_voting::VotesOf; + type WeightInfo = weights::pallet_referenda::WeightInfo; +} + +parameter_types! { + pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS; + pub const TechnicalMaxProposals: u32 = 20; + pub const TechnicalMaxMembers: u32 = 20; +} + +impl pallet_collective::Config for Runtime { + type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxMembers = TechnicalMaxMembers; + type MaxProposalWeight = MaxProposalWeight; + type MaxProposals = TechnicalMaxProposals; + type MotionDuration = TechnicalMotionDuration; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot; + type WeightInfo = weights::pallet_collective_technical_fellowship::WeightInfo; +} + +impl pallet_membership::Config for Runtime { + type AddOrigin = EnsureRoot; + type MaxMembers = TechnicalMaxMembers; + type MembershipChanged = TechnicalCommittee; + type MembershipInitialized = TechnicalCommittee; + type PrimeOrigin = EnsureRoot; + type RemoveOrigin = EnsureRoot; + type ResetOrigin = EnsureRoot; + type RuntimeEvent = RuntimeEvent; + type SwapOrigin = EnsureRoot; + type WeightInfo = weights::pallet_membership::WeightInfo; +} + /// Block type as expected by this runtime. pub type Block = generic::Block; /// A Block signed with a Justification @@ -2069,7 +2172,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - crate::migrations::UpgradeDevelopment1103, + crate::migrations::UpgradeDevelopment1200, >; // Frame Order in this block dictates the index of each one in the metadata @@ -2109,6 +2212,14 @@ construct_runtime!( Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 70, Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason} = 72, + // OpenGov + ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 80, + Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 81, + Origins: pallet_custom_origins::{Origin} = 82, + Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 83, + TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 84, + TechnicalCommitteeMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 85, + // our pallets part 1 Fees: pallet_fees::{Pallet, Call, Storage, Config, Event} = 90, Anchor: pallet_anchors::{Pallet, Call, Storage} = 91, @@ -2838,7 +2949,7 @@ mod benches { [pallet_proxy, Proxy] [pallet_utility, Utility] [pallet_scheduler, Scheduler] - [pallet_collective, Council] + [pallet_collective_council, Council] [pallet_democracy, Democracy] [pallet_elections_phragmen, Elections] [pallet_identity, Identity] @@ -2870,6 +2981,11 @@ mod benches { [pallet_remarks, Remarks] [pallet_pool_fees, PoolFees] [pallet_token_mux, TokenMux] + [pallet_collective_technical_fellowship, TechnicalCommittee] + [pallet_conviction_voting, ConvictionVoting] + [pallet_membership, TechnicalCommitteeMembership] + [pallet_referenda, Referenda] + [pallet_whitelist, Whitelist] ); } diff --git a/runtime/development/src/migrations.rs b/runtime/development/src/migrations.rs index dd18836530..4addb188ee 100644 --- a/runtime/development/src/migrations.rs +++ b/runtime/development/src/migrations.rs @@ -10,6 +10,29 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +use cfg_primitives::AccountId; +use sp_core::parameter_types; +use sp_std::{vec, vec::Vec}; + +parameter_types! { + // Alice + pub InitialTcMembers: Vec = vec![AccountId::new(hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"))]; +} + /// The migration set for Development & Demo. /// It includes all the migrations that have to be applied on that chain. -pub type UpgradeDevelopment1103 = (); +pub type UpgradeDevelopment1200 = ( + // Initialize OpenGov Technical Committee with Alice + runtime_common::migrations::technical_comittee::InitMigration, + runtime_common::migrations::increase_storage_version::Migration, + runtime_common::migrations::increase_storage_version::Migration< + crate::TechnicalCommittee, + 0, + 4, + >, + runtime_common::migrations::increase_storage_version::Migration< + crate::TechnicalCommitteeMembership, + 0, + 4, + >, +); diff --git a/runtime/development/src/tracks.rs b/runtime/development/src/tracks.rs new file mode 100644 index 0000000000..a9b1fabee2 --- /dev/null +++ b/runtime/development/src/tracks.rs @@ -0,0 +1,176 @@ +// Copyright 2024 Centrifuge Foundation (centrifuge.io). +// +// This file is part of the Centrifuge chain project. +// Centrifuge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version (see http://www.gnu.org/licenses). +// Centrifuge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +//! OpenGov Tracks parametrization +//! +//! Based on [Centrifuge Chain parametrization](https://docs.google.com/document/d/1aPH1sTfAttD3K0f4AoOF2iDb3nH1GHlx5TfIP4Xi4SM) +//! whereas `DAYS` and `HOURS` were replaced with `MINUTES` for Development +//! runtime. + +use cfg_primitives::{ + Balance, BlockNumber, CFG, MINUTES, TRACK_INDEX_POOL_ADMIN, TRACK_INDEX_REF_CANCELLER, + TRACK_INDEX_REF_KILLER, TRACK_INDEX_ROOT, TRACK_INDEX_TREASURER, + TRACK_INDEX_WHITELISTED_CALLER, +}; +use cfg_utils::math::{to_percent, to_ppm}; +use pallet_referenda::Curve; + +use crate::RuntimeOrigin; + +const SUP_ROOT: Curve = + Curve::make_reciprocal(1, 14, to_percent(10), to_ppm(8800), to_percent(100)); +const APP_ROOT: Curve = Curve::make_linear(14, 14, to_percent(50), to_percent(100)); + +const SUP_WHITELISTED: Curve = + Curve::make_reciprocal(1, 7, to_ppm(800), to_ppm(100), to_percent(50)); +const APP_WHITELISTED: Curve = Curve::make_linear(7, 7, to_percent(50), to_percent(100)); + +const SUP_POOL_ADMIN: Curve = + Curve::make_reciprocal(1, 7, to_ppm(38500), to_ppm(5900), to_percent(50)); +const APP_POOL_ADMIN: Curve = Curve::make_linear(7, 7, to_percent(70), to_percent(100)); + +const SUP_TREASURER: Curve = Curve::make_linear(25, 28, to_percent(1), to_percent(50)); +const APP_TREASURER: Curve = Curve::make_linear(14, 14, to_percent(70), to_percent(100)); + +const SUP_REF_CANCELLER: Curve = + Curve::make_reciprocal(1, 7, to_ppm(38500), to_ppm(5900), to_percent(50)); +const APP_REF_CANCELLER: Curve = Curve::make_linear(7, 7, to_percent(70), to_percent(100)); + +const SUP_REF_KILLER: Curve = + Curve::make_reciprocal(1, 7, to_ppm(38500), to_ppm(5900), to_percent(50)); +const APP_REF_KILLER: Curve = Curve::make_linear(7, 7, to_percent(70), to_percent(100)); + +const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 6] = [ + ( + TRACK_INDEX_ROOT, + pallet_referenda::TrackInfo { + name: "root", + max_deciding: 2, + decision_deposit: 300_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_ROOT, + min_support: SUP_ROOT, + }, + ), + ( + TRACK_INDEX_WHITELISTED_CALLER, + pallet_referenda::TrackInfo { + name: "whitelisted_caller", + max_deciding: 20, + decision_deposit: 1_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_WHITELISTED, + min_support: SUP_WHITELISTED, + }, + ), + ( + TRACK_INDEX_POOL_ADMIN, + pallet_referenda::TrackInfo { + name: "pool_admin", + max_deciding: 5, + decision_deposit: 1_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_POOL_ADMIN, + min_support: SUP_POOL_ADMIN, + }, + ), + ( + TRACK_INDEX_TREASURER, + pallet_referenda::TrackInfo { + name: "treasurer", + max_deciding: 2, + decision_deposit: 10_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_TREASURER, + min_support: SUP_TREASURER, + }, + ), + ( + TRACK_INDEX_REF_CANCELLER, + pallet_referenda::TrackInfo { + name: "referendum_canceller", + max_deciding: 20, + decision_deposit: 50_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_REF_CANCELLER, + min_support: SUP_REF_CANCELLER, + }, + ), + ( + TRACK_INDEX_REF_KILLER, + pallet_referenda::TrackInfo { + name: "referendum_killer", + max_deciding: 20, + decision_deposit: 75_000 * CFG, + prepare_period: 1 * MINUTES, + decision_period: 1 * MINUTES, + confirm_period: 1 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: APP_REF_KILLER, + min_support: SUP_REF_KILLER, + }, + ), +]; + +pub struct TracksInfo; +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = u16; + type RuntimeOrigin = ::PalletsOrigin; + + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + &TRACKS_DATA[..] + } + + fn track_for(id: &Self::RuntimeOrigin) -> Result { + if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) { + match system_origin { + frame_system::RawOrigin::Root => Ok(TRACK_INDEX_ROOT), + _ => Err(()), + } + } else if let Ok(custom_origin) = runtime_common::origins::gov::Origin::try_from(id.clone()) + { + match custom_origin { + runtime_common::origins::gov::Origin::WhitelistedCaller => { + Ok(TRACK_INDEX_WHITELISTED_CALLER) + } + // General admin + runtime_common::origins::gov::Origin::PoolAdmin => Ok(TRACK_INDEX_POOL_ADMIN), + runtime_common::origins::gov::Origin::Treasurer => Ok(TRACK_INDEX_TREASURER), + // Referendum admins + runtime_common::origins::gov::Origin::ReferendumCanceller => { + Ok(TRACK_INDEX_REF_CANCELLER) + } + runtime_common::origins::gov::Origin::ReferendumKiller => { + Ok(TRACK_INDEX_REF_KILLER) + } + } + } else { + Err(()) + } + } +} +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); diff --git a/runtime/development/src/weights/mod.rs b/runtime/development/src/weights/mod.rs index 857944649e..3ceb435a64 100644 --- a/runtime/development/src/weights/mod.rs +++ b/runtime/development/src/weights/mod.rs @@ -17,7 +17,9 @@ pub mod pallet_balances; pub mod pallet_block_rewards; pub mod pallet_collator_allowlist; pub mod pallet_collator_selection; -pub mod pallet_collective; +pub mod pallet_collective_council; +pub mod pallet_collective_technical_fellowship; +pub mod pallet_conviction_voting; pub mod pallet_democracy; pub mod pallet_elections_phragmen; pub mod pallet_fees; @@ -27,6 +29,7 @@ pub mod pallet_investments; pub mod pallet_keystore; pub mod pallet_liquidity_rewards; pub mod pallet_loans; +pub mod pallet_membership; pub mod pallet_multisig; pub mod pallet_oracle_collection; pub mod pallet_oracle_feed; @@ -37,6 +40,7 @@ pub mod pallet_pool_registry; pub mod pallet_pool_system; pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_referenda; pub mod pallet_remarks; pub mod pallet_restricted_tokens; pub mod pallet_scheduler; @@ -47,4 +51,5 @@ pub mod pallet_transfer_allowlist; pub mod pallet_uniques; pub mod pallet_utility; pub mod pallet_vesting; +pub mod pallet_whitelist; pub mod pallet_xcm; diff --git a/runtime/development/src/weights/pallet_collective.rs b/runtime/development/src/weights/pallet_collective.rs index 7cc75ea3da..8b13789179 100644 --- a/runtime/development/src/weights/pallet_collective.rs +++ b/runtime/development/src/weights/pallet_collective.rs @@ -1,286 +1 @@ -//! Autogenerated weights for `pallet_collective` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("centrifuge-local")`, DB CACHE: 1024 - -// Executed Command: -// target/release/centrifuge-chain -// benchmark -// pallet -// --chain=centrifuge-local -// --steps=50 -// --repeat=20 -// --pallet=pallet_collective -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=/tmp/runtime/centrifuge/src/weights/pallet_collective.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_collective`. -pub struct WeightInfo(PhantomData); -impl pallet_collective::WeightInfo for WeightInfo { - /// Storage: `Council::Members` (r:1 w:1) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:0) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:100 w:100) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:0 w:1) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[0, 100]`. - /// The range of component `n` is `[0, 100]`. - /// The range of component `p` is `[0, 100]`. - fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `15728 + m * (1967 ±23) + p * (4332 ±23)` - // Minimum execution time: 19_556_000 picoseconds. - Weight::from_parts(20_007_000, 0) - .saturating_add(Weight::from_parts(0, 15728)) - // Standard Error: 74_399 - .saturating_add(Weight::from_parts(5_524_602, 0).saturating_mul(m.into())) - // Standard Error: 74_399 - .saturating_add(Weight::from_parts(9_565_431, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `69 + m * (32 ±0)` - // Estimated: `1555 + m * (32 ±0)` - // Minimum execution time: 18_104_000 picoseconds. - Weight::from_parts(17_054_763, 0) - .saturating_add(Weight::from_parts(0, 1555)) - // Standard Error: 41 - .saturating_add(Weight::from_parts(1_755, 0).saturating_mul(b.into())) - // Standard Error: 426 - .saturating_add(Weight::from_parts(20_471, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:0) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[1, 100]`. - fn propose_execute(b: u32, m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `69 + m * (32 ±0)` - // Estimated: `3535 + m * (32 ±0)` - // Minimum execution time: 22_542_000 picoseconds. - Weight::from_parts(21_565_280, 0) - .saturating_add(Weight::from_parts(0, 3535)) - // Standard Error: 39 - .saturating_add(Weight::from_parts(1_712, 0).saturating_mul(b.into())) - // Standard Error: 407 - .saturating_add(Weight::from_parts(30_984, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalCount` (r:1 w:1) - /// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[2, 100]`. - /// The range of component `p` is `[1, 100]`. - fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `359 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `3751 + m * (33 ±0) + p * (36 ±0)` - // Minimum execution time: 28_043_000 picoseconds. - Weight::from_parts(26_227_432, 0) - .saturating_add(Weight::from_parts(0, 3751)) - // Standard Error: 94 - .saturating_add(Weight::from_parts(3_916, 0).saturating_mul(b.into())) - // Standard Error: 987 - .saturating_add(Weight::from_parts(29_870, 0).saturating_mul(m.into())) - // Standard Error: 975 - .saturating_add(Weight::from_parts(254_754, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[5, 100]`. - fn vote(m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `808 + m * (64 ±0)` - // Estimated: `4272 + m * (64 ±0)` - // Minimum execution time: 25_889_000 picoseconds. - Weight::from_parts(26_738_449, 0) - .saturating_add(Weight::from_parts(0, 4272)) - // Standard Error: 924 - .saturating_add(Weight::from_parts(49_812, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `397 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3842 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 31_359_000 picoseconds. - Weight::from_parts(29_091_035, 0) - .saturating_add(Weight::from_parts(0, 3842)) - // Standard Error: 1_020 - .saturating_add(Weight::from_parts(48_599, 0).saturating_mul(m.into())) - // Standard Error: 994 - .saturating_add(Weight::from_parts(239_919, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `699 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4016 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 45_085_000 picoseconds. - Weight::from_parts(46_121_007, 0) - .saturating_add(Weight::from_parts(0, 4016)) - // Standard Error: 139 - .saturating_add(Weight::from_parts(2_251, 0).saturating_mul(b.into())) - // Standard Error: 1_470 - .saturating_add(Weight::from_parts(38_832, 0).saturating_mul(m.into())) - // Standard Error: 1_433 - .saturating_add(Weight::from_parts(274_797, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_disapproved(m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `417 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `3862 + m * (65 ±0) + p * (36 ±0)` - // Minimum execution time: 33_684_000 picoseconds. - Weight::from_parts(33_538_693, 0) - .saturating_add(Weight::from_parts(0, 3862)) - // Standard Error: 1_739 - .saturating_add(Weight::from_parts(22_766, 0).saturating_mul(m.into())) - // Standard Error: 1_695 - .saturating_add(Weight::from_parts(267_242, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) - } - /// Storage: `Council::Voting` (r:1 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Members` (r:1 w:0) - /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Prime` (r:1 w:0) - /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:1 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[2, 1024]`. - /// The range of component `m` is `[4, 100]`. - /// The range of component `p` is `[1, 100]`. - fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `719 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `4036 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` - // Minimum execution time: 47_620_000 picoseconds. - Weight::from_parts(46_356_705, 0) - .saturating_add(Weight::from_parts(0, 4036)) - // Standard Error: 139 - .saturating_add(Weight::from_parts(2_913, 0).saturating_mul(b.into())) - // Standard Error: 1_472 - .saturating_add(Weight::from_parts(44_652, 0).saturating_mul(m.into())) - // Standard Error: 1_435 - .saturating_add(Weight::from_parts(285_528, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) - } - /// Storage: `Council::Proposals` (r:1 w:1) - /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Council::Voting` (r:0 w:1) - /// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Council::ProposalOf` (r:0 w:1) - /// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[1, 100]`. - fn disapprove_proposal(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `226 + p * (32 ±0)` - // Estimated: `1711 + p * (32 ±0)` - // Minimum execution time: 16_641_000 picoseconds. - Weight::from_parts(17_756_526, 0) - .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 687 - .saturating_add(Weight::from_parts(226_934, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) - } -} diff --git a/runtime/development/src/weights/pallet_collective_council.rs b/runtime/development/src/weights/pallet_collective_council.rs new file mode 100644 index 0000000000..4f7d6ca0d5 --- /dev/null +++ b/runtime/development/src/weights/pallet_collective_council.rs @@ -0,0 +1,287 @@ + +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { + /// Storage: Council Members (r:1 w:1) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:0) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:100 w:100) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Prime (r:0 w:1) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15762 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 23_504_000 picoseconds. + Weight::from_parts(24_045_000, 0) + .saturating_add(Weight::from_parts(0, 15762)) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(4_726_718, 0).saturating_mul(m.into())) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(8_779_554, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `1589 + m * (32 ±0)` + // Minimum execution time: 24_235_000 picoseconds. + Weight::from_parts(23_250_984, 0) + .saturating_add(Weight::from_parts(0, 1589)) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_948, 0).saturating_mul(b.into())) + // Standard Error: 371 + .saturating_add(Weight::from_parts(18_660, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:0) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 28_623_000 picoseconds. + Weight::from_parts(27_427_537, 0) + .saturating_add(Weight::from_parts(0, 3569)) + // Standard Error: 44 + .saturating_add(Weight::from_parts(1_964, 0).saturating_mul(b.into())) + // Standard Error: 459 + .saturating_add(Weight::from_parts(27_792, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalCount (r:1 w:1) + /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `393 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3785 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 37_019_000 picoseconds. + Weight::from_parts(36_618_582, 0) + .saturating_add(Weight::from_parts(0, 3785)) + // Standard Error: 94 + .saturating_add(Weight::from_parts(2_958, 0).saturating_mul(b.into())) + // Standard Error: 986 + .saturating_add(Weight::from_parts(25_992, 0).saturating_mul(m.into())) + // Standard Error: 973 + .saturating_add(Weight::from_parts(241_104, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `842 + m * (64 ±0)` + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 31_509_000 picoseconds. + Weight::from_parts(32_380_933, 0) + .saturating_add(Weight::from_parts(0, 4306)) + // Standard Error: 670 + .saturating_add(Weight::from_parts(42_211, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `431 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3876 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 40_866_000 picoseconds. + Weight::from_parts(40_128_300, 0) + .saturating_add(Weight::from_parts(0, 3876)) + // Standard Error: 900 + .saturating_add(Weight::from_parts(35_686, 0).saturating_mul(m.into())) + // Standard Error: 878 + .saturating_add(Weight::from_parts(232_805, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4050 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 58_508_000 picoseconds. + Weight::from_parts(58_282_994, 0) + .saturating_add(Weight::from_parts(0, 4050)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(2_776, 0).saturating_mul(b.into())) + // Standard Error: 2_014 + .saturating_add(Weight::from_parts(14_102, 0).saturating_mul(m.into())) + // Standard Error: 1_963 + .saturating_add(Weight::from_parts(284_218, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `451 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3896 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 44_563_000 picoseconds. + Weight::from_parts(44_023_999, 0) + .saturating_add(Weight::from_parts(0, 3896)) + // Standard Error: 807 + .saturating_add(Weight::from_parts(39_142, 0).saturating_mul(m.into())) + // Standard Error: 787 + .saturating_add(Weight::from_parts(229_511, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4070 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 62_106_000 picoseconds. + Weight::from_parts(62_287_266, 0) + .saturating_add(Weight::from_parts(0, 4070)) + // Standard Error: 141 + .saturating_add(Weight::from_parts(2_748, 0).saturating_mul(b.into())) + // Standard Error: 1_497 + .saturating_add(Weight::from_parts(32_032, 0).saturating_mul(m.into())) + // Standard Error: 1_459 + .saturating_add(Weight::from_parts(275_044, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `260 + p * (32 ±0)` + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 23_244_000 picoseconds. + Weight::from_parts(24_758_733, 0) + .saturating_add(Weight::from_parts(0, 1745)) + // Standard Error: 752 + .saturating_add(Weight::from_parts(216_365, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } +} diff --git a/runtime/development/src/weights/pallet_collective_technical_fellowship.rs b/runtime/development/src/weights/pallet_collective_technical_fellowship.rs new file mode 100644 index 0000000000..4f7d6ca0d5 --- /dev/null +++ b/runtime/development/src/weights/pallet_collective_technical_fellowship.rs @@ -0,0 +1,287 @@ + +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { + /// Storage: Council Members (r:1 w:1) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:0) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:100 w:100) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Prime (r:0 w:1) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15762 + m * (1967 ±23) + p * (4332 ±23)` + // Minimum execution time: 23_504_000 picoseconds. + Weight::from_parts(24_045_000, 0) + .saturating_add(Weight::from_parts(0, 15762)) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(4_726_718, 0).saturating_mul(m.into())) + // Standard Error: 62_373 + .saturating_add(Weight::from_parts(8_779_554, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `1589 + m * (32 ±0)` + // Minimum execution time: 24_235_000 picoseconds. + Weight::from_parts(23_250_984, 0) + .saturating_add(Weight::from_parts(0, 1589)) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_948, 0).saturating_mul(b.into())) + // Standard Error: 371 + .saturating_add(Weight::from_parts(18_660, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:0) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `103 + m * (32 ±0)` + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 28_623_000 picoseconds. + Weight::from_parts(27_427_537, 0) + .saturating_add(Weight::from_parts(0, 3569)) + // Standard Error: 44 + .saturating_add(Weight::from_parts(1_964, 0).saturating_mul(b.into())) + // Standard Error: 459 + .saturating_add(Weight::from_parts(27_792, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalCount (r:1 w:1) + /// Proof Skipped: Council ProposalCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `393 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3785 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 37_019_000 picoseconds. + Weight::from_parts(36_618_582, 0) + .saturating_add(Weight::from_parts(0, 3785)) + // Standard Error: 94 + .saturating_add(Weight::from_parts(2_958, 0).saturating_mul(b.into())) + // Standard Error: 986 + .saturating_add(Weight::from_parts(25_992, 0).saturating_mul(m.into())) + // Standard Error: 973 + .saturating_add(Weight::from_parts(241_104, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `842 + m * (64 ±0)` + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 31_509_000 picoseconds. + Weight::from_parts(32_380_933, 0) + .saturating_add(Weight::from_parts(0, 4306)) + // Standard Error: 670 + .saturating_add(Weight::from_parts(42_211, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `431 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3876 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 40_866_000 picoseconds. + Weight::from_parts(40_128_300, 0) + .saturating_add(Weight::from_parts(0, 3876)) + // Standard Error: 900 + .saturating_add(Weight::from_parts(35_686, 0).saturating_mul(m.into())) + // Standard Error: 878 + .saturating_add(Weight::from_parts(232_805, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4050 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 58_508_000 picoseconds. + Weight::from_parts(58_282_994, 0) + .saturating_add(Weight::from_parts(0, 4050)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(2_776, 0).saturating_mul(b.into())) + // Standard Error: 2_014 + .saturating_add(Weight::from_parts(14_102, 0).saturating_mul(m.into())) + // Standard Error: 1_963 + .saturating_add(Weight::from_parts(284_218, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `451 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3896 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 44_563_000 picoseconds. + Weight::from_parts(44_023_999, 0) + .saturating_add(Weight::from_parts(0, 3896)) + // Standard Error: 807 + .saturating_add(Weight::from_parts(39_142, 0).saturating_mul(m.into())) + // Standard Error: 787 + .saturating_add(Weight::from_parts(229_511, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Council Voting (r:1 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Members (r:1 w:0) + /// Proof Skipped: Council Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Prime (r:1 w:0) + /// Proof Skipped: Council Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:1 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4070 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 62_106_000 picoseconds. + Weight::from_parts(62_287_266, 0) + .saturating_add(Weight::from_parts(0, 4070)) + // Standard Error: 141 + .saturating_add(Weight::from_parts(2_748, 0).saturating_mul(b.into())) + // Standard Error: 1_497 + .saturating_add(Weight::from_parts(32_032, 0).saturating_mul(m.into())) + // Standard Error: 1_459 + .saturating_add(Weight::from_parts(275_044, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Council Proposals (r:1 w:1) + /// Proof Skipped: Council Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Council Voting (r:0 w:1) + /// Proof Skipped: Council Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Council ProposalOf (r:0 w:1) + /// Proof Skipped: Council ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `260 + p * (32 ±0)` + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 23_244_000 picoseconds. + Weight::from_parts(24_758_733, 0) + .saturating_add(Weight::from_parts(0, 1745)) + // Standard Error: 752 + .saturating_add(Weight::from_parts(216_365, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } +} diff --git a/runtime/development/src/weights/pallet_conviction_voting.rs b/runtime/development/src/weights/pallet_conviction_voting.rs new file mode 100644 index 0000000000..ceacadefaa --- /dev/null +++ b/runtime/development/src/weights/pallet_conviction_voting.rs @@ -0,0 +1,176 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_conviction_voting.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_conviction_voting`. +pub struct WeightInfo(PhantomData); +impl pallet_conviction_voting::WeightInfo for WeightInfo { + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `13445` + // Estimated: `42428` + // Minimum execution time: 128_222_000 picoseconds. + Weight::from_parts(133_397_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `14166` + // Estimated: `83866` + // Minimum execution time: 193_274_000 picoseconds. + Weight::from_parts(206_120_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn remove_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `13918` + // Estimated: `83866` + // Minimum execution time: 169_729_000 picoseconds. + Weight::from_parts(181_847_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn remove_other_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `13004` + // Estimated: `30706` + // Minimum execution time: 74_834_000 picoseconds. + Weight::from_parts(83_047_000, 0) + .saturating_add(Weight::from_parts(0, 30706)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ConvictionVoting::VotingFor` (r:2 w:2) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 512]`. + fn delegate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `29640 + r * (365 ±0)` + // Estimated: `83866 + r * (3411 ±0)` + // Minimum execution time: 65_741_000 picoseconds. + Weight::from_parts(1_683_585_056, 0) + .saturating_add(Weight::from_parts(0, 83866)) + // Standard Error: 146_560 + .saturating_add(Weight::from_parts(40_661_211, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into())) + } + /// Storage: `ConvictionVoting::VotingFor` (r:2 w:2) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:512 w:512) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 512]`. + fn undelegate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `29555 + r * (365 ±0)` + // Estimated: `83866 + r * (3411 ±0)` + // Minimum execution time: 38_557_000 picoseconds. + Weight::from_parts(1_664_510_198, 0) + .saturating_add(Weight::from_parts(0, 83866)) + // Standard Error: 147_721 + .saturating_add(Weight::from_parts(40_405_805, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 3411).saturating_mul(r.into())) + } + /// Storage: `ConvictionVoting::VotingFor` (r:1 w:1) + /// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`) + /// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1) + /// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(311), added: 2786, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `12218` + // Estimated: `30706` + // Minimum execution time: 94_790_000 picoseconds. + Weight::from_parts(100_982_000, 0) + .saturating_add(Weight::from_parts(0, 30706)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/development/src/weights/pallet_membership.rs b/runtime/development/src/weights/pallet_membership.rs new file mode 100644 index 0000000000..8641ae5ff1 --- /dev/null +++ b/runtime/development/src/weights/pallet_membership.rs @@ -0,0 +1,188 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_membership.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_membership`. +pub struct WeightInfo(PhantomData); +impl pallet_membership::WeightInfo for WeightInfo { + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 99]`. + fn add_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `174 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 17_443_000 picoseconds. + Weight::from_parts(18_272_399, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 376 + .saturating_add(Weight::from_parts(33_633, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn remove_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 19_826_000 picoseconds. + Weight::from_parts(20_859_732, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 667 + .saturating_add(Weight::from_parts(33_155, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn swap_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 20_151_000 picoseconds. + Weight::from_parts(20_774_114, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 447 + .saturating_add(Weight::from_parts(44_052, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:0) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn reset_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 19_846_000 picoseconds. + Weight::from_parts(20_903_563, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 865 + .saturating_add(Weight::from_parts(149_306, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:1) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Proposals (r:1 w:0) + /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalMembership Prime (r:1 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Members (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn change_key(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `278 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 20_523_000 picoseconds. + Weight::from_parts(21_705_085, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 948 + .saturating_add(Weight::from_parts(44_568, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Members (r:1 w:0) + /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: TechnicalMembership Prime (r:0 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn set_prime(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `32 + m * (32 ±0)` + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 8_032_000 picoseconds. + Weight::from_parts(8_386_682, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 190 + .saturating_add(Weight::from_parts(9_724, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: TechnicalMembership Prime (r:0 w:1) + /// Proof: TechnicalMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: TechnicalCommittee Prime (r:0 w:1) + /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn clear_prime(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_061_000 picoseconds. + Weight::from_parts(3_304_217, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 80 + .saturating_add(Weight::from_parts(273, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/development/src/weights/pallet_referenda.rs b/runtime/development/src/weights/pallet_referenda.rs new file mode 100644 index 0000000000..f65c6cd82a --- /dev/null +++ b/runtime/development/src/weights/pallet_referenda.rs @@ -0,0 +1,480 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_referenda.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_referenda`. +pub struct WeightInfo(PhantomData); +impl pallet_referenda::WeightInfo for WeightInfo { + /// Storage: `Referenda::ReferendumCount` (r:1 w:1) + /// Proof: `Referenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:0 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn submit() -> Weight { + // Proof Size summary in bytes: + // Measured: `186` + // Estimated: `42428` + // Minimum execution time: 35_376_000 picoseconds. + Weight::from_parts(36_517_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 49_778_000 picoseconds. + Weight::from_parts(50_686_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3226` + // Estimated: `42428` + // Minimum execution time: 61_681_000 picoseconds. + Weight::from_parts(63_483_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `3246` + // Estimated: `42428` + // Minimum execution time: 60_699_000 picoseconds. + Weight::from_parts(62_223_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 61_401_000 picoseconds. + Weight::from_parts(62_890_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn place_decision_deposit_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `439` + // Estimated: `83866` + // Minimum execution time: 57_572_000 picoseconds. + Weight::from_parts(59_953_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn refund_decision_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `279` + // Estimated: `4401` + // Minimum execution time: 26_730_000 picoseconds. + Weight::from_parts(28_055_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn refund_submission_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `269` + // Estimated: `4401` + // Minimum execution time: 27_341_000 picoseconds. + Weight::from_parts(28_373_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn cancel() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `83866` + // Minimum execution time: 33_650_000 picoseconds. + Weight::from_parts(35_107_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:1 w:0) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn kill() -> Weight { + // Proof Size summary in bytes: + // Measured: `588` + // Estimated: `83866` + // Minimum execution time: 96_383_000 picoseconds. + Weight::from_parts(99_296_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:0) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + fn one_fewer_deciding_queue_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `102` + // Estimated: `5477` + // Minimum execution time: 8_323_000 picoseconds. + Weight::from_parts(8_776_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn one_fewer_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3116` + // Estimated: `42428` + // Minimum execution time: 46_817_000 picoseconds. + Weight::from_parts(48_988_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn one_fewer_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `3116` + // Estimated: `42428` + // Minimum execution time: 50_644_000 picoseconds. + Weight::from_parts(51_929_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_insertion() -> Weight { + // Proof Size summary in bytes: + // Measured: `2939` + // Estimated: `5477` + // Minimum execution time: 22_716_000 picoseconds. + Weight::from_parts(23_508_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_slide() -> Weight { + // Proof Size summary in bytes: + // Measured: `2939` + // Estimated: `5477` + // Minimum execution time: 22_223_000 picoseconds. + Weight::from_parts(23_359_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `2943` + // Estimated: `5477` + // Minimum execution time: 26_541_000 picoseconds. + Weight::from_parts(27_446_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:0) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Referenda::TrackQueue` (r:1 w:1) + /// Proof: `Referenda::TrackQueue` (`max_values`: None, `max_size`: Some(2012), added: 4487, mode: `MaxEncodedLen`) + fn nudge_referendum_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `2963` + // Estimated: `5477` + // Minimum execution time: 25_749_000 picoseconds. + Weight::from_parts(26_662_000, 0) + .saturating_add(Weight::from_parts(0, 5477)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_no_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `299` + // Estimated: `42428` + // Minimum execution time: 21_944_000 picoseconds. + Weight::from_parts(23_129_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 22_252_000 picoseconds. + Weight::from_parts(23_071_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + fn nudge_referendum_timed_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `4401` + // Minimum execution time: 14_336_000 picoseconds. + Weight::from_parts(15_039_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 31_108_000 picoseconds. + Weight::from_parts(32_446_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::DecidingCount` (r:1 w:1) + /// Proof: `Referenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `42428` + // Minimum execution time: 33_666_000 picoseconds. + Weight::from_parts(34_575_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 30_250_000 picoseconds. + Weight::from_parts(31_267_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_end_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `383` + // Estimated: `42428` + // Minimum execution time: 30_782_000 picoseconds. + Weight::from_parts(32_258_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_not_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 28_260_000 picoseconds. + Weight::from_parts(29_450_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `404` + // Estimated: `42428` + // Minimum execution time: 27_024_000 picoseconds. + Weight::from_parts(28_253_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + fn nudge_referendum_approved() -> Weight { + // Proof Size summary in bytes: + // Measured: `404` + // Estimated: `83866` + // Minimum execution time: 41_811_000 picoseconds. + Weight::from_parts(42_989_000, 0) + .saturating_add(Weight::from_parts(0, 83866)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) + fn nudge_referendum_rejected() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `42428` + // Minimum execution time: 30_478_000 picoseconds. + Weight::from_parts(31_556_000, 0) + .saturating_add(Weight::from_parts(0, 42428)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:0 w:1) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn set_some_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `350` + // Estimated: `4401` + // Minimum execution time: 18_549_000 picoseconds. + Weight::from_parts(19_181_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(936), added: 3411, mode: `MaxEncodedLen`) + /// Storage: `Referenda::MetadataOf` (r:1 w:1) + /// Proof: `Referenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `283` + // Estimated: `4401` + // Minimum execution time: 16_085_000 picoseconds. + Weight::from_parts(16_480_000, 0) + .saturating_add(Weight::from_parts(0, 4401)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/development/src/weights/pallet_whitelist.rs b/runtime/development/src/weights/pallet_whitelist.rs new file mode 100644 index 0000000000..ca08d2c3c1 --- /dev/null +++ b/runtime/development/src/weights/pallet_whitelist.rs @@ -0,0 +1,99 @@ +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("centrifuge-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// pallet +// --chain=centrifuge-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=/tmp/runtime/centrifuge/src/weights/pallet_whitelist.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_whitelist`. +pub struct WeightInfo(PhantomData); +impl pallet_whitelist::WeightInfo for WeightInfo { + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn whitelist_call() -> Weight { + // Proof Size summary in bytes: + // Measured: `84` + // Estimated: `3556` + // Minimum execution time: 18_497_000 picoseconds. + Weight::from_parts(18_977_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn remove_whitelisted_call() -> Weight { + // Proof Size summary in bytes: + // Measured: `213` + // Estimated: `3556` + // Minimum execution time: 16_070_000 picoseconds. + Weight::from_parts(16_697_000, 0) + .saturating_add(Weight::from_parts(0, 3556)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:1 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// The range of component `n` is `[1, 4194294]`. + fn dispatch_whitelisted_call(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `289 + n * (1 ±0)` + // Estimated: `3753 + n * (1 ±0)` + // Minimum execution time: 27_611_000 picoseconds. + Weight::from_parts(27_934_000, 0) + .saturating_add(Weight::from_parts(0, 3753)) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_213, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Whitelist::WhitelistedCall` (r:1 w:1) + /// Proof: `Whitelist::WhitelistedCall` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// The range of component `n` is `[1, 10000]`. + fn dispatch_whitelisted_call_with_preimage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `213` + // Estimated: `3556` + // Minimum execution time: 19_188_000 picoseconds. + Weight::from_parts(19_932_877, 0) + .saturating_add(Weight::from_parts(0, 3556)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_418, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/development/src/xcm.rs b/runtime/development/src/xcm.rs index ac260246f0..eaecd65851 100644 --- a/runtime/development/src/xcm.rs +++ b/runtime/development/src/xcm.rs @@ -9,7 +9,6 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use cfg_primitives::types::{EnsureRootOr, HalfOfCouncil}; use cfg_traits::TryConvert; use cfg_types::{tokens::CurrencyId, EVMChainId}; use frame_support::{ @@ -22,6 +21,7 @@ use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; use orml_xcm_support::MultiNativeAsset; use pallet_xcm::XcmPassthrough; use runtime_common::{ + origins::gov::types::{EnsureRootOr, HalfOfCouncil}, transfer_filter::PreXcmTransfer, xcm::{ AccountIdToLocation, Barrier, CanonicalNativePerSecond, FixedConversionRateProvider, diff --git a/runtime/integration-tests/src/config.rs b/runtime/integration-tests/src/config.rs index 8c026eb113..58a68f29a1 100644 --- a/runtime/integration-tests/src/config.rs +++ b/runtime/integration-tests/src/config.rs @@ -1,8 +1,8 @@ use std::fmt::Debug; use cfg_primitives::{ - AccountId, Address, AuraId, Balance, CollectionId, CouncilCollective, Header, IBalance, ItemId, - LoanId, Nonce, OrderId, PoolId, Signature, TrancheId, + AccountId, Address, AuraId, Balance, CollectionId, Header, IBalance, ItemId, LoanId, Nonce, + OrderId, PoolId, Signature, TrancheId, }; use cfg_traits::Millis; use cfg_types::{ @@ -30,6 +30,7 @@ use runtime_common::{ evm::precompile::H160Addresses, fees::{DealWithFees, WeightToFee}, instances, + instances::CouncilCollective, oracle::Feeder, remarks::Remark, rewards::SingleCurrencyMovement, diff --git a/runtime/integration-tests/src/utils/genesis.rs b/runtime/integration-tests/src/utils/genesis.rs index d6a721d0b5..ae1c7b1710 100644 --- a/runtime/integration-tests/src/utils/genesis.rs +++ b/runtime/integration-tests/src/utils/genesis.rs @@ -7,6 +7,7 @@ use cfg_types::{ tokens::{AssetMetadata, CurrencyId}, }; use parity_scale_codec::Encode; +use runtime_common::instances::CouncilCollective; use sp_core::Get; use sp_runtime::{BuildStorage, FixedPointNumber, Storage}; @@ -78,7 +79,7 @@ pub fn assets<'a, T: Runtime>( pub fn council_members( members: impl IntoIterator, ) -> impl BuildStorage { - pallet_collective::GenesisConfig:: { + pallet_collective::GenesisConfig:: { phantom: Default::default(), members: members.into_iter().map(|acc| acc.id().into()).collect(), }