diff --git a/Cargo.lock b/Cargo.lock index 1f10140b0..289406dc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20248,6 +20248,7 @@ name = "timechain-runtime" version = "0.8.0" dependencies = [ "env_logger 0.11.6", + "hex-literal", "log", "pallet-airdrop", "pallet-dmail", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 5153a27e7..734551c8a 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -80,14 +80,7 @@ impl Default for GenesisKeysConfig { use AccountKeyring::*; GenesisKeysConfig { - admins: vec![ - Alice.into(), - Bob.into(), - Charlie.into(), - Dave.into(), - Eve.into(), - Ferdie.into(), - ], + admins: vec![Eve.into(), Ferdie.into()], bootstraps: vec![( Alice.to_raw_public().unchecked_into(), Ed25519Keyring::Alice.to_raw_public().unchecked_into(), @@ -98,14 +91,7 @@ impl Default for GenesisKeysConfig { // TODO: Would be better to assign individual controllers controller: None, endowments: vec![], - stakes: vec![ - AliceStash.into(), - BobStash.into(), - CharlieStash.into(), - DaveStash.into(), - EveStash.into(), - FerdieStash.into(), - ], + stakes: vec![Alice.into(), Bob.into(), Charlie.into(), Dave.into()], } } } diff --git a/node/src/chains/internal.keys.json b/node/src/chains/internal.keys.json index 76df5c8d8..c66c7dc32 100644 --- a/node/src/chains/internal.keys.json +++ b/node/src/chains/internal.keys.json @@ -1,8 +1,7 @@ { "admins": [ "an65ZUosuFfPTLJ6jRiotRwEBWxfjE3ZA3rN9khAEuEBbP1vN", - "an9CbHiXeALyA5pDGQNfJ8YKF5k8eW5YTHWRsn8ZBEH8tano9", - "an5jsJBqi2whFgKyZqBcgS7iY7qjvG1DGVuQsaVcGZaVu7uio" + "an9CbHiXeALyA5pDGQNfJ8YKF5k8eW5YTHWRsn8ZBEH8tano9" ], "bootstraps": [ [ diff --git a/pallets/governance/src/lib.rs b/pallets/governance/src/lib.rs index 7ab7689bf..dc862ef1f 100644 --- a/pallets/governance/src/lib.rs +++ b/pallets/governance/src/lib.rs @@ -24,7 +24,7 @@ pub mod pallet { use polkadot_sdk::pallet_balances; use polkadot_sdk::{frame_support, frame_system}; - //use polkadot_sdk::{pallet_staking, sp_runtime}; + use polkadot_sdk::{pallet_staking, sp_runtime}; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; @@ -32,23 +32,23 @@ pub mod pallet { // Additional custom imports use frame_system::{RawOrigin, WeightInfo as SystemWeights}; - //use pallet_staking::{ConfigOp, WeightInfo as StakingWeights}; - //use sp_runtime::{Perbill, Percent}; + use pallet_staking::{ConfigOp, WeightInfo as StakingWeights}; + use sp_runtime::{Perbill, Percent}; // Useful coupling shorthands - //type CurrencyBalanceOf = ::CurrencyBalance; + type CurrencyBalanceOf = ::CurrencyBalance; #[pallet::pallet] pub struct Pallet(_); #[pallet::config] - pub trait Config: polkadot_sdk::frame_system::Config + pallet_balances::Config - //+ pallet_staking::Config + pub trait Config: + polkadot_sdk::frame_system::Config + pallet_balances::Config + pallet_staking::Config { /// Allowed origin for system calls type SystemAdmin: EnsureOrigin; // Allowed origin for staking calls - //type StakingAdmin: EnsureOrigin; + type StakingAdmin: EnsureOrigin; } #[pallet::call] @@ -61,7 +61,6 @@ pub mod pallet { frame_system::Pallet::::authorize_upgrade(RawOrigin::Root.into(), code_hash) } - /* // Wrapper around staking pallet calls #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::set_validator_count())] @@ -101,6 +100,5 @@ pub mod pallet { max_staked_rewards, ) } - */ } } diff --git a/pallets/governance/src/mock.rs b/pallets/governance/src/mock.rs index 229fb1721..aab17284c 100644 --- a/pallets/governance/src/mock.rs +++ b/pallets/governance/src/mock.rs @@ -109,7 +109,7 @@ impl pallet_staking::Config for Test { impl pallet_governance::Config for Test { type SystemAdmin = EnsureSignedBy; - //type StakingAdmin = EnsureSignedBy; + type StakingAdmin = EnsureSignedBy; } // Build genesis storage according to the mock runtime. diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index ca86c3916..db3149f4f 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -21,4 +21,4 @@ pub const NANOANLOG: Balance = MICROANLOG / 1000; // 10^3 pub const TOCK: Balance = NANOANLOG / 1000; // 1 /// Total issuance at genesis -pub const TOTAL_ISSUANCE: Balance = 90_570_710 * ANLOG; +pub const TOTAL_ISSUANCE: Balance = 90_570_710_000 * ANLOG; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index a569953c0..60636717c 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -21,6 +21,7 @@ separator = "0.4.1" [dependencies] log = { workspace = true } +hex-literal = "0.4.1" smallvec = "1.8.0" scale-codec = { workspace = true, features = [ "max-encoded-len" ] } @@ -48,11 +49,13 @@ polkadot-sdk = { workspace = true, features = [ "pallet-child-bounties", "pallet-collective", "pallet-election-provider-multi-phase", + "pallet-delegated-staking", "pallet-grandpa", "pallet-identity", "pallet-im-online", "pallet-membership", "pallet-multisig", + "pallet-nomination-pools", "pallet-offences", "pallet-preimage", "pallet-proxy", @@ -151,6 +154,7 @@ runtime-benchmarks = [ "polkadot-sdk/frame-benchmarking", "polkadot-sdk/frame-system-benchmarking", "polkadot-sdk/pallet-election-provider-support-benchmarking", + "polkadot-sdk/pallet-nomination-pools-benchmarking", "polkadot-sdk/pallet-offences-benchmarking", "polkadot-sdk/pallet-session-benchmarking", diff --git a/runtime/src/apis.rs b/runtime/src/apis.rs index 2e1882e0f..f3f965ac3 100644 --- a/runtime/src/apis.rs +++ b/runtime/src/apis.rs @@ -396,6 +396,7 @@ impl_runtime_apis! { // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. use pallet_session_benchmarking::Pallet as SessionBench; + use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; @@ -419,12 +420,14 @@ impl_runtime_apis! { // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. use pallet_session_benchmarking::Pallet as SessionBench; + use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; impl pallet_session_benchmarking::Config for Runtime {} + impl pallet_nomination_pools_benchmarking::Config for Runtime {} impl pallet_offences_benchmarking::Config for Runtime {} impl pallet_election_provider_support_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} diff --git a/runtime/src/benches.rs b/runtime/src/benches.rs index c04f37ab4..3fc85c4ac 100644 --- a/runtime/src/benches.rs +++ b/runtime/src/benches.rs @@ -21,6 +21,7 @@ polkadot_sdk::frame_benchmarking::define_benchmarks!( [pallet_members, Members] [pallet_multisig, Multisig] [pallet_networks, Networks] + [pallet_nomination_pools, NominationPoolsBench::] [pallet_offences, OffencesBench::] [pallet_preimage, Preimage] [pallet_proxy, Proxy] diff --git a/runtime/src/configs/consensus.rs b/runtime/src/configs/consensus.rs index a14c423f0..3a91f078a 100644 --- a/runtime/src/configs/consensus.rs +++ b/runtime/src/configs/consensus.rs @@ -9,18 +9,13 @@ use frame_support::parameter_types; use sp_runtime::{impl_opaque_keys, traits::OpaqueKeys, transaction_validity::TransactionPriority}; // Local module imports -#[cfg(not(feature = "testnet"))] -use crate::ValidatorManager; use crate::{ weights, AccountId, AuthorityDiscovery, Babe, BondingDuration, EpochDuration, ExpectedBlockTime, Grandpa, Historical, ImOnline, MaxAuthorities, MaxNominators, Runtime, RuntimeEvent, SessionsPerEra, }; -#[cfg(feature = "testnet")] use crate::{Balance, Offences, Session, Staking}; -#[cfg(feature = "testnet")] use frame_support::traits::KeyOwnerProofSystem; -#[cfg(feature = "testnet")] use sp_core::crypto::KeyTypeId; /// ## `Authorship` Config @@ -28,9 +23,6 @@ use sp_core::crypto::KeyTypeId; /// Tracks block authorship impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - #[cfg(not(feature = "testnet"))] - type EventHandler = ImOnline; - #[cfg(feature = "testnet")] type EventHandler = (Staking, ImOnline); } @@ -51,44 +43,24 @@ impl sp_runtime::traits::Convert> for IdentityValidator { } } -/// ## `Session`] Config +/// ## [`Session`] Config /// /// Tracks session keys impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; - #[cfg(not(feature = "testnet"))] - type ValidatorIdOf = IdentityValidator; - #[cfg(feature = "testnet")] type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - #[cfg(not(feature = "testnet"))] - type SessionManager = pallet_session::historical::NoteHistoricalRoot; - #[cfg(feature = "testnet")] type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = pallet_session::weights::SubstrateWeight; } -pub struct FullIdentificationOf; -impl sp_runtime::traits::Convert> for FullIdentificationOf { - fn convert(_: AccountId) -> Option<()> { - Some(()) - } -} - /// ## [`Historical`] Config /// /// Tracks historical session -#[cfg(not(feature = "testnet"))] -impl pallet_session::historical::Config for Runtime { - type FullIdentification = (); - type FullIdentificationOf = FullIdentificationOf; -} - -#[cfg(feature = "testnet")] impl pallet_session::historical::Config for Runtime { type FullIdentification = pallet_staking::Exposure; type FullIdentificationOf = pallet_staking::ExposureOf; @@ -110,21 +82,12 @@ impl pallet_babe::Config for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; type EpochChangeTrigger = pallet_babe::ExternalTrigger; - #[cfg(not(feature = "testnet"))] - type DisabledValidators = (); - #[cfg(feature = "testnet")] type DisabledValidators = Session; type WeightInfo = (); type MaxAuthorities = MaxAuthorities; type MaxNominators = MaxNominators; - #[cfg(not(feature = "testnet"))] - type KeyOwnerProof = sp_core::Void; - #[cfg(feature = "testnet")] type KeyOwnerProof = >::Proof; - #[cfg(not(feature = "testnet"))] - type EquivocationReportSystem = (); - #[cfg(feature = "testnet")] type EquivocationReportSystem = pallet_babe::EquivocationReportSystem; } @@ -142,14 +105,8 @@ impl pallet_grandpa::Config for Runtime { type MaxAuthorities = MaxAuthorities; type MaxNominators = MaxNominators; type MaxSetIdSessionEntries = MaxSetIdSessionEntries; - #[cfg(not(feature = "testnet"))] - type KeyOwnerProof = sp_core::Void; - #[cfg(feature = "testnet")] type KeyOwnerProof = >::Proof; - #[cfg(not(feature = "testnet"))] - type EquivocationReportSystem = (); - #[cfg(feature = "testnet")] type EquivocationReportSystem = pallet_grandpa::EquivocationReportSystem; } @@ -169,9 +126,6 @@ impl pallet_im_online::Config for Runtime { type RuntimeEvent = RuntimeEvent; type NextSessionRotation = Babe; type ValidatorSet = Historical; - #[cfg(not(feature = "testnet"))] - type ReportUnresponsiveness = (); - #[cfg(feature = "testnet")] type ReportUnresponsiveness = Offences; type UnsignedPriority = ImOnlineUnsignedPriority; type WeightInfo = weights::pallet_im_online::WeightInfo; diff --git a/runtime/src/configs/funding.rs b/runtime/src/configs/funding.rs index 08674f234..dac0db2da 100644 --- a/runtime/src/configs/funding.rs +++ b/runtime/src/configs/funding.rs @@ -36,7 +36,7 @@ parameter_types! { pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: Balance = 1 * ANLOG; pub const DataDepositPerByte: Balance = deposit(0,1); - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const TreasuryPalletId: PalletId = PalletId(*b"timetrsy"); pub const MaximumReasonLength: u32 = 300; pub const MaxApprovals: u32 = 100; pub const MaxBalance: Balance = Balance::MAX; diff --git a/runtime/src/configs/governance.rs b/runtime/src/configs/governance.rs index 22bbf4e81..ae28f6164 100644 --- a/runtime/src/configs/governance.rs +++ b/runtime/src/configs/governance.rs @@ -132,7 +132,7 @@ impl pallet_governance::Config for Runtime { /// Default admin origin for system related governance type SystemAdmin = EnsureRootOrHalfTechnical; // Default admin origin for staking related governance - //type StakingAdmin = EnsureRootOrHalfTechnical; + type StakingAdmin = EnsureRootOrHalfTechnical; } #[cfg(feature = "testnet")] @@ -140,11 +140,5 @@ impl pallet_governance::Config for Runtime { /// Development admin origin for all system calls type SystemAdmin = EnsureRootOrTechnicalMember; // Development admin origin for all staking calls - //type StakingAdmin = EnsureRootOrTechnicalMember; -} - -#[cfg(not(feature = "testnet"))] -impl pallet_validators::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type PrivilegedOrigin = EnsureRootOrHalfTechnical; + type StakingAdmin = EnsureRootOrTechnicalMember; } diff --git a/runtime/src/configs/mod.rs b/runtime/src/configs/mod.rs index f9c259f52..b89f7b247 100644 --- a/runtime/src/configs/mod.rs +++ b/runtime/src/configs/mod.rs @@ -6,7 +6,6 @@ pub mod funding; pub mod governance; #[cfg(feature = "testnet")] pub mod services; -#[cfg(feature = "testnet")] pub mod staking; pub mod tokenomics; pub mod utilities; diff --git a/runtime/src/configs/staking.rs b/runtime/src/configs/staking.rs index 90fecf93d..e909de4cd 100644 --- a/runtime/src/configs/staking.rs +++ b/runtime/src/configs/staking.rs @@ -1,5 +1,8 @@ //! Nominated Proof of Stake Config +use frame_system::RawOrigin; +use pallet_nomination_pools::ConfigOp as PoolOp; +use pallet_staking::{ConfigOp as StakingOp, RewardDestination}; use scale_codec::Decode; use polkadot_sdk::*; @@ -12,13 +15,16 @@ use frame_support::{ dispatch::DispatchClass, pallet_prelude::Get, parameter_types, - traits::{ConstU32, EitherOfDiverse}, + storage::unhashed, + traits::Currency, + //traits::tokens::imbalance::ResolveTo, + traits::{ConstU32, OnRuntimeUpgrade}, weights::Weight, + PalletId, }; -use frame_system::EnsureRoot; use sp_runtime::{ - curve::PiecewiseLinear, transaction_validity::TransactionPriority, Perbill, Percent, + curve::PiecewiseLinear, transaction_validity::TransactionPriority, FixedU128, Perbill, Percent, }; use sp_std::prelude::*; @@ -28,30 +34,152 @@ use time_primitives::BlockNumber; // Local module imports use crate::{ deposit, weights, AccountId, Balance, Balances, BlockExecutionWeight, BondingDuration, - ElectionProviderMultiPhase, EnsureRootOrHalfTechnical, EpochDuration, Runtime, - RuntimeBlockLength, RuntimeBlockWeights, RuntimeEvent, Session, SessionsPerEra, Staking, - TechnicalCollective, Timestamp, TransactionPayment, Treasury, VoterList, ANLOG, + DelegatedStaking, ElectionProviderMultiPhase, EnsureRootOrHalfTechnical, EpochDuration, + NominationPools, Runtime, RuntimeBlockLength, RuntimeBlockWeights, RuntimeEvent, + RuntimeFreezeReason, RuntimeHoldReason, RuntimeOrigin, Session, SessionsPerEra, Staking, + Timestamp, TransactionPayment, VoterList, ANLOG, }; +const POOL_ADMIN: [u8; 32] = + hex_literal::hex!["36af0a8a854c8e20275474d6de2a5d29c34fa62896847850b6f09b58eb8d6c06"]; +const MIN_STAKE: Balance = 100_000 * ANLOG; + +pub struct StakingMigration(); + +impl OnRuntimeUpgrade for StakingMigration { + /// Set some sensible defaults during the staking update. + fn on_runtime_upgrade() -> frame_support::weights::Weight { + // Fetch current validator count + let count: u32 = Session::validators() + .len() + .try_into() + .expect("Validator count does fit into u32."); + + log::info!("✋ Starting the migration of {count} validators to proof of stake"); + + // Ensure there are always at least a minimum amount of validators + pallet_staking::MinimumValidatorCount::::put(4); + + // Lock down nominations + if let Err(error) = Staking::set_staking_configs( + RawOrigin::Root.into(), + // min nominator and validator bond + StakingOp::Set(MIN_STAKE), + StakingOp::Set(MIN_STAKE), + // max nominator and validator count + StakingOp::Set(1), + StakingOp::Set(count), + // others + StakingOp::Noop, + StakingOp::Noop, + StakingOp::Noop, + ) { + log::error!("🤒 Failed to configure staking: {:?}", error); + } + + // Migrate validators to new pallet + for validator in Session::validators() { + // Provide minimum stake + // FIXME: Add source and vesting here! + let _ = Balances::deposit_creating(&validator, MIN_STAKE); + + // Setup staking by bonding and signaling intent + let origin = RuntimeOrigin::from(Some(validator.clone())); + if Staking::bond(origin.clone(), MIN_STAKE, RewardDestination::Staked).is_err() { + log::error!("😵 Failed to bond validator: {:?}", validator.clone()); + } + if Staking::validate(origin, Default::default()).is_err() { + log::error!("😵‍💫 Failed to enable validator: {:?}", validator.clone()); + } + } + + // Limit validator set size to current count + if Staking::set_validator_count(RawOrigin::Root.into(), count).is_err() { + log::error!("🤕 Failed to set validator count: {count}"); + } + + // Allow only one pool + if let Err(error) = NominationPools::set_configs( + RawOrigin::Root.into(), + PoolOp::Noop, + PoolOp::Set(MIN_STAKE), + PoolOp::Set(1), + // Remove all member limits + PoolOp::Remove, + PoolOp::Remove, + // No max commission + PoolOp::Noop, + ) { + log::error!("🥴 Failed to configure nomination pools: {:?}", error); + } + + // Setup default staking pool + let pool_admin: AccountId = POOL_ADMIN.into(); + // FIXME: Add source and vesting here! + let _ = Balances::deposit_creating(&pool_admin, MIN_STAKE + 10 * ANLOG); + + if let Err(error) = NominationPools::create( + RawOrigin::Signed(pool_admin.clone()).into(), + MIN_STAKE, + pool_admin.clone().into(), + pool_admin.clone().into(), + pool_admin.clone().into(), + ) { + log::error!("🫨 Failed to setup staking pool: {:?}", error); + } + + if NominationPools::set_metadata( + RawOrigin::Signed(pool_admin.clone()).into(), + 1, + b"Analog One - Bootstaking".to_vec(), + ) + .is_err() + { + log::error!("🤧 Failed to setup staking pool metadata"); + } + + // Nominate all validators + if let Err(error) = NominationPools::nominate( + RawOrigin::Signed(pool_admin.clone()).into(), + 1, + Session::validators(), + ) { + log::error!("🤯 Failed to nominate validators: {error:?}"); + } + + // Clear old validator manager + let deleted = unhashed::clear_prefix( + &hex_literal::hex!["084e7f70a295a190e2e33fd3f8cdfcc2"], + None, + None, + ) + .backend; + log::info!("☠ Cleared old validator manager: {deleted}"); + + log::info!("🖖 Completed migration to proof of stake"); + + Weight::zero() + } +} + parameter_types! { - /// This phase determines the time window, in blocks, during which signed transactions (those that - /// are authorized by users with private keys, usually nominators or council members) can be submitted. - /// It is calculated as 1/3 of the total epoch duration, ensuring that signed - /// transactions are allowed for a quarter of the epoch. + /// This phase determines the time window, in blocks, during which signed + /// transactions can be submitted. It is calculated as the duration of one + /// the four epochs during an era. pub const SignedPhase: u32 = EpochDuration::get() as u32; - /// This phase determines the time window, in blocks, during which unsigned transactions (those - /// without authorization, usually by offchain workers) can be submitted. Like the signed phase, - /// it occupies 1/3 of the total epoch duration. + /// This phase determines the time window, in blocks, during which unsigned + /// off-chain transactions can be submitted. Like the signed phase, it is + /// calculated as the duration of one the four epochs during an era. pub const UnsignedPhase: u32 = EpochDuration::get() as u32; // Signed Config /// This represents the fixed reward given to participants for submitting valid signed /// transactions. It is set to 1 ANLOG token, meaning that any participant who successfully /// submits a signed transaction will receive this base reward. - pub const SignedRewardBase: Balance = 1 * ANLOG; + pub const SignedRewardBase: Balance = 100 * ANLOG; /// This deposit ensures that users have economic stakes in the submission of valid signed /// transactions. It is currently set to 1 ANLOG, meaning participants must lock 1 ANLOG as - pub const SignedFixedDeposit: Balance = 1 * ANLOG; + pub const SignedFixedDeposit: Balance = 100 * ANLOG; /// This percentage increase applies to deposits for multiple or repeated signed transactions. /// It is set to 10%, meaning that each additional submission after the first will increase the /// required deposit by 10%. This serves as a disincentive to spamming the system with repeated @@ -96,9 +224,9 @@ parameter_types! { // Note: the EPM in this runtime runs the election on-chain. The election bounds must be // carefully set so that an election round fits in one block. pub ElectionBoundsMultiPhase: ElectionBounds = ElectionBoundsBuilder::default() - .voters_count(10_000.into()).targets_count(1_500.into()).build(); + .voters_count(10_000.into()).targets_count(1_000.into()).build(); pub ElectionBoundsOnChain: ElectionBounds = ElectionBoundsBuilder::default() - .voters_count(5_000.into()).targets_count(1_250.into()).build(); + .voters_count(5_000.into()).targets_count(1_000.into()).build(); pub MaxNominations: u32 = ::LIMIT as u32; pub MaxElectingVotersSolution: u32 = 40_000; @@ -237,7 +365,7 @@ parameter_types! { /// The maximum number of controllers that can be included in a deprecation batch when deprecated staking controllers /// are being phased out. This helps manage the process of retiring controllers to prevent overwhelming the system /// during upgrades. - pub const MaxControllersInDeprecationBatch: u32 = 5900; + pub const MaxControllersInDeprecationBatch: u32 = 4096; /// The number of blocks before an off-chain worker repeats a task. Off-chain workers handle tasks that are performed /// outside the main blockchain execution, such as fetching data or performing computation-heavy operations. This value @@ -267,35 +395,31 @@ impl pallet_staking::Config for Runtime { type CurrencyBalance = Balance; type UnixTime = Timestamp; type CurrencyToVote = sp_staking::currency_to_vote::U128CurrencyToVote; - type RewardRemainder = Treasury; + type RewardRemainder = (); //Treasury; type RuntimeEvent = RuntimeEvent; - type Slash = Treasury; // send the slashed funds to the treasury. + type Slash = (); //Treasury; // send the slashed funds to the treasury. type Reward = (); // rewards are minted from the void type SessionsPerEra = SessionsPerEra; type BondingDuration = BondingDuration; type SlashDeferDuration = SlashDeferDuration; - /// A super-majority of the council can cancel the slash. - type AdminOrigin = EitherOfDiverse< - EnsureRoot, - pallet_collective::EnsureProportionAtLeast, - >; + /// A majority of the council can cancel the slash. + type AdminOrigin = EnsureRootOrHalfTechnical; type SessionInterface = Self; - type EraPayout = pallet_staking::ConvertCurve; - type NextNewSession = Session; + type EraPayout = (); //pallet_staking::ConvertCurve; type MaxExposurePageSize = ConstU32<256>; + type NextNewSession = Session; type ElectionProvider = ElectionProviderMultiPhase; type GenesisElectionProvider = onchain::OnChainExecution; type VoterList = VoterList; - type NominationsQuota = pallet_staking::FixedNominationsQuota; - // This a placeholder, to be introduced in the next PR as an instance of bags-list type TargetList = pallet_staking::UseValidatorsMap; + type NominationsQuota = pallet_staking::FixedNominationsQuota; type MaxUnlockingChunks = ConstU32<32>; - type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; type HistoryDepth = HistoryDepth; - type EventListeners = (); - type WeightInfo = pallet_staking::weights::SubstrateWeight; + type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; type BenchmarkingConfig = StakingBenchmarkingConfig; + type EventListeners = NominationPools; type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy; + type WeightInfo = pallet_staking::weights::SubstrateWeight; } parameter_types! { pub const BagThresholds: &'static [u64] = &crate::staking_bags::THRESHOLDS; @@ -325,6 +449,60 @@ impl pallet_offences::Config for Runtime { type OnOffenceHandler = Staking; } +parameter_types! { + pub const PostUnbondPoolsWindow: u32 = 4; + pub const NominationPoolsPalletId: PalletId = PalletId(*b"timenmpl"); + pub const MaxPointsToBalance: u8 = 10; +} + +use sp_runtime::traits::Convert; +pub struct BalanceToU256; +impl Convert for BalanceToU256 { + fn convert(balance: Balance) -> sp_core::U256 { + sp_core::U256::from(balance) + } +} +pub struct U256ToBalance; +impl Convert for U256ToBalance { + fn convert(n: sp_core::U256) -> Balance { + n.try_into().unwrap_or(Balance::MAX) + } +} + +impl pallet_nomination_pools::Config for Runtime { + type WeightInfo = pallet_nomination_pools::weights::SubstrateWeight; + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type RuntimeFreezeReason = RuntimeFreezeReason; + type RewardCounter = FixedU128; + type BalanceToU256 = BalanceToU256; + type U256ToBalance = U256ToBalance; + type StakeAdapter = + pallet_nomination_pools::adapter::DelegateStake; + type PostUnbondingPoolsWindow = PostUnbondPoolsWindow; + type MaxMetadataLen = ConstU32<256>; + type MaxUnbonding = ::MaxUnlockingChunks; + type PalletId = NominationPoolsPalletId; + type MaxPointsToBalance = MaxPointsToBalance; + type AdminOrigin = EnsureRootOrHalfTechnical; +} + +parameter_types! { + pub const DelegatedStakingPalletId: PalletId = PalletId(*b"timedgsk"); + pub const SlashRewardFraction: Perbill = Perbill::from_percent(1); +} + +impl pallet_delegated_staking::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type PalletId = DelegatedStakingPalletId; + type Currency = Balances; + // slashes are sent to the treasury. + type OnSlash = (); //ResolveTo, Balances>; + type SlashRewardFraction = SlashRewardFraction; + type RuntimeHoldReason = RuntimeHoldReason; + type CoreStaking = Staking; +} + #[cfg(test)] mod tests { use super::*; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index fa6ba5f48..d69d224c9 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -96,6 +96,7 @@ pub use configs::governance::{ EnsureRootOrHalfTechnical, TechnicalMember, TechnicalQualifiedMajority, TechnicalSuperMajority, TechnicalUnanimity, }; +use configs::staking::StakingMigration; pub use configs::tokenomics::{ExistentialDeposit, LengthToFee, WeightToFee}; /// Helpers to handle variant flags @@ -118,7 +119,7 @@ mod weights; pub use weights::{BlockExecutionWeight, ExtrinsicBaseWeight}; /// Automatically generated nomination bag boundaries -#[cfg(feature = "testnet")] +//#[cfg(feature = "testnet")] mod staking_bags; // Make the WASM binary available. @@ -231,7 +232,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("analog-timechain"), impl_name: create_runtime_str!("analog-timechain"), authoring_version: 0, - spec_version: 11, + spec_version: 12, impl_version: 0, apis: apis::RUNTIME_API_VERSIONS, transaction_version: 1, @@ -245,7 +246,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("analog-testnet"), impl_name: create_runtime_str!("analog-testnet"), authoring_version: 0, - spec_version: 11, + spec_version: 12, impl_version: 0, apis: apis::RUNTIME_API_VERSIONS, transaction_version: 1, @@ -259,7 +260,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("analog-develop"), impl_name: create_runtime_str!("analog-develop"), authoring_version: 0, - spec_version: 11, + spec_version: 12, impl_version: 0, apis: apis::RUNTIME_API_VERSIONS, transaction_version: 1, @@ -436,6 +437,26 @@ mod runtime { #[runtime::pallet_index(14)] pub type Multisig = pallet_multisig; + // Nominated proof of stake + + #[runtime::pallet_index(15)] + pub type ElectionProviderMultiPhase = pallet_election_provider_multi_phase; + + #[runtime::pallet_index(16)] + pub type Staking = pallet_staking; + + #[runtime::pallet_index(17)] + pub type VoterList = pallet_bags_list; + + #[runtime::pallet_index(18)] + pub type Offences = pallet_offences; + + #[runtime::pallet_index(28)] + pub type NominationPools = pallet_nomination_pools; + + #[runtime::pallet_index(29)] + pub type DelegatedStaking = pallet_delegated_staking; + // On-chain governance #[runtime::pallet_index(22)] @@ -447,9 +468,6 @@ mod runtime { #[runtime::pallet_index(24)] pub type SafeMode = pallet_safe_mode; - #[runtime::pallet_index(25)] - pub type ValidatorManager = pallet_validators; - // Custom governance #[runtime::pallet_index(32)] @@ -571,6 +589,12 @@ mod runtime { #[runtime::pallet_index(18)] pub type Offences = pallet_offences; + #[runtime::pallet_index(28)] + pub type NominationPools = pallet_nomination_pools; + + #[runtime::pallet_index(29)] + pub type DelegatedStaking = pallet_delegated_staking; + // On-chain identity,storage and scheduler #[runtime::pallet_index(19)] @@ -632,7 +656,7 @@ mod runtime { } // All migrations executed on runtime upgrade implementing `OnRuntimeUpgrade`. -type Migrations = (); +type Migrations = StakingMigration; #[cfg(test)] mod core_tests { diff --git a/runtime/src/staking_bags.rs b/runtime/src/staking_bags.rs index f085b7078..87716f8f5 100644 --- a/runtime/src/staking_bags.rs +++ b/runtime/src/staking_bags.rs @@ -1,426 +1,221 @@ //! Autogenerated bag thresholds. //! -//! Generated on 2024-07-10T00:15:08.440099301+00:00 +//! Generated on 2025-02-02T08:28:56.336254587+00:00 //! Arguments -//! Total issuance: 90570710000000000000 -//! Minimum balance: 1000000000 +//! Total issuance: 90570710000000000000000 +//! Minimum balance: 1000000000000 //! for the analog-timechain runtime. /// Existential weight for this runtime. #[cfg(any(test, feature = "std"))] #[allow(unused)] -pub const EXISTENTIAL_WEIGHT: u64 = 250_000_000; +pub const EXISTENTIAL_WEIGHT: u64 = 203_707_476; /// Constant ratio between bags for this runtime. #[cfg(any(test, feature = "std"))] #[allow(unused)] -pub const CONSTANT_RATIO: f64 = 1.1339997619409634; +pub const CONSTANT_RATIO: f64 = 1.1351672761833793; /// Upper thresholds delimiting the bag list. pub const THRESHOLDS: [u64; 200] = [ - 250_000_000, - 283_499_940, - 321_488_864, - 364_568_295, - 413_420_360, - 468_818_590, - 531_640_169, - 602_879_825, - 683_665_578, - 775_276_603, - 879_163_483, - 996_971_180, - 1_130_565_081, - 1_282_060_533, - 1_453_856_339, - 1_648_672_742, - 1_869_594_497, - 2_120_119_715, - 2_404_215_252, - 2_726_379_523, - 3_091_713_730, - 3_506_002_634, - 3_975_806_152, - 4_508_563_230, - 5_112_709_630, - 5_797_811_503, - 6_574_716_864, - 7_455_727_359, - 8_454_793_050, - 9_587_733_306, - 10_872_487_287, - 12_329_397_995, - 13_981_534_391, - 15_855_056_671, - 17_979_630_490, - 20_388_896_695, - 23_121_003_998, - 26_219_213_030, - 29_732_581_334, - 33_716_740_155, - 38_234_775_309, - 43_358_226_098, - 49_168_218_073, - 55_756_747_590, - 63_228_138_494, - 71_700_694_000, - 81_308_569_927, - 92_203_898_941, - 104_559_199_449, - 118_570_107_284, - 134_458_473_433, - 152_475_876_864, - 172_907_608_066, - 196_077_186_385, - 222_351_482_683, - 252_146_528_430, - 285_934_103_214, - 324_249_204_975, - 367_698_521_251, - 416_970_035_565, - 472_843_921_067, - 536_204_893_925, - 608_056_222_063, - 689_535_611_066, - 781_933_218_799, - 886_712_083_972, - 1_005_531_292_134, - 1_140_272_245_904, - 1_293_068_455_403, - 1_466_339_320_600, - 1_662_828_440_485, - 1_885_647_055_659, - 2_138_323_312_222, - 2_424_858_127_013, - 2_749_788_538_773, - 3_118_259_548_357, - 3_536_105_585_507, - 4_009_942_892_163, - 4_547_274_285_110, - 5_156_607_956_795, - 5_847_592_195_428, - 6_631_168_157_543, - 7_519_743_112_044, - 8_527_386_898_915, - 9_670_054_713_348, - 10_965_839_742_893, - 12_435_259_657_923, - 14_101_581_491_759, - 15_991_190_054_646, - 18_134_005_715_121, - 20_563_958_163_983, - 23_319_523_662_521, - 26_444_334_281_875, - 29_987_868_780_334, - 34_006_236_058_016, - 38_563_063_594_298, - 43_730_504_935_648, - 49_590_382_186_583, - 56_235_481_594_147, - 63_771_022_740_398, - 72_316_324_606_343, - 82_006_694_888_038, - 92_995_572_480_600, - 105_456_957_054_564, - 119_588_164_194_894, - 135_612_949_727_967, - 153_785_052_707_626, - 174_392_213_160_526, - 197_760_728_208_394, - 224_260_618_709_590, - 254_311_488_229_408, - 288_389_167_111_001, - 327_033_246_850_228, - 370_855_624_074_939, - 420_550_189_415_448, - 476_903_814_681_345, - 540_808_812_317_383, - 613_277_064_423_488, - 695_456_045_060_088, - 788_646_989_538_544, - 894_325_498_392_166, - 1_014_164_902_274_450, - 1_150_062_757_748_107, - 1_304_170_893_503_521, - 1_478_929_482_763_326, - 1_677_105_681_381_084, - 1_901_837_443_435_987, - 2_156_683_208_106_820, - 2_445_678_244_575_207, - 2_773_398_547_132_478, - 3_145_033_292_215_644, - 3_566_467_004_668_945, - 4_044_372_734_264_885, - 4_586_317_717_856_903, - 5_200_883_200_235_351, - 5_897_800_310_949_644, - 6_688_104_148_592_236, - 7_584_308_512_339_965, - 8_600_604_047_480_343, - 9_753_082_942_391_196, - 11_059_993_734_862_088, - 12_542_030_262_402_154, - 14_222_659_331_820_402, - 16_128_492_296_451_758, - 18_289_706_424_642_956, - 20_740_522_731_515_220, - 23_519_747_840_069_400, - 26_671_388_451_550_188, - 30_245_348_154_692_872, - 34_298_217_607_243_272, - 38_894_170_601_613_232, - 44_105_980_203_120_624, - 50_016_171_050_511_632, - 56_718_326_064_478_696, - 64_318_568_254_808_784, - 72_937_241_089_336_768, - 82_710_814_031_938_544, - 93_794_043_422_161_600, - 106_362_422_912_211_632, - 120_614_962_261_912_064, - 136_777_338_491_526_560, - 155_105_469_288_309_696, - 175_889_565_248_684_608, - 199_458_725_119_907_904, - 226_186_146_803_023_616, - 256_495_036_628_972_576, - 290_865_310_476_293_568, - 329_841_192_837_001_344, - 374_039_834_155_482_944, - 424_161_082_888_755_072, - 480_998_567_020_469_504, - 545_452_260_495_156_928, - 618_542_733_551_668_352, - 701_427_312_597_904_640, - 795_418_405_504_913_536, - 902_004_282_486_032_640, - 1_022_872_641_608_890_496, - 1_159_937_332_080_406_272, - 1_315_368_658_445_616_896, - 1_491_627_745_541_934_080, - 1_691_505_508_349_089_280, - 1_918_166_843_789_695_488, - 2_175_200_744_220_563_712, - 2_466_677_126_119_925_760, - 2_797_211_273_805_215_744, - 3_172_036_918_593_693_696, - 3_597_089_110_553_196_032, - 4_079_098_195_047_756_288, - 4_625_696_382_117_968_896, - 5_245_538_596_132_952_064, - 5_948_439_519_266_903_040, - 6_745_528_998_768_886_784, - 7_649_428_278_769_782_784, - 8_674_449_847_109_406_720, - 9_836_824_061_590_894_592, - 11_154_956_144_099_215_360, - 12_649_717_611_870_396_416, - 14_344_776_760_481_441_792, - 16_266_973_431_482_218_496, - 18_446_744_073_709_551_615, -]; - -#[allow(dead_code)] -/// Upper thresholds delimiting the bag list. -pub const THRESHOLDS_BALANCES: [u128; 200] = [ - 250_000_000, - 283_499_940, - 321_488_864, - 364_568_295, - 413_420_360, - 468_818_590, - 531_640_169, - 602_879_825, - 683_665_578, - 775_276_603, - 879_163_483, - 996_971_180, - 1_130_565_081, - 1_282_060_533, - 1_453_856_339, - 1_648_672_742, - 1_869_594_497, - 2_120_119_715, - 2_404_215_252, - 2_726_379_523, - 3_091_713_730, - 3_506_002_634, - 3_975_806_152, - 4_508_563_230, - 5_112_709_630, - 5_797_811_503, - 6_574_716_864, - 7_455_727_359, - 8_454_793_050, - 9_587_733_306, - 10_872_487_287, - 12_329_397_995, - 13_981_534_391, - 15_855_056_671, - 17_979_630_490, - 20_388_896_695, - 23_121_003_998, - 26_219_213_030, - 29_732_581_334, - 33_716_740_155, - 38_234_775_309, - 43_358_226_098, - 49_168_218_073, - 55_756_747_590, - 63_228_138_494, - 71_700_694_000, - 81_308_569_927, - 92_203_898_941, - 104_559_199_449, - 118_570_107_284, - 134_458_473_433, - 152_475_876_864, - 172_907_608_066, - 196_077_186_385, - 222_351_482_683, - 252_146_528_430, - 285_934_103_214, - 324_249_204_975, - 367_698_521_251, - 416_970_035_565, - 472_843_921_067, - 536_204_893_925, - 608_056_222_063, - 689_535_611_066, - 781_933_218_799, - 886_712_083_972, - 1_005_531_292_134, - 1_140_272_245_904, - 1_293_068_455_403, - 1_466_339_320_600, - 1_662_828_440_485, - 1_885_647_055_659, - 2_138_323_312_222, - 2_424_858_127_013, - 2_749_788_538_773, - 3_118_259_548_357, - 3_536_105_585_507, - 4_009_942_892_163, - 4_547_274_285_110, - 5_156_607_956_795, - 5_847_592_195_428, - 6_631_168_157_543, - 7_519_743_112_044, - 8_527_386_898_915, - 9_670_054_713_348, - 10_965_839_742_893, - 12_435_259_657_923, - 14_101_581_491_759, - 15_991_190_054_646, - 18_134_005_715_121, - 20_563_958_163_983, - 23_319_523_662_521, - 26_444_334_281_875, - 29_987_868_780_334, - 34_006_236_058_016, - 38_563_063_594_298, - 43_730_504_935_648, - 49_590_382_186_583, - 56_235_481_594_147, - 63_771_022_740_398, - 72_316_324_606_343, - 82_006_694_888_038, - 92_995_572_480_600, - 105_456_957_054_564, - 119_588_164_194_894, - 135_612_949_727_967, - 153_785_052_707_626, - 174_392_213_160_526, - 197_760_728_208_394, - 224_260_618_709_590, - 254_311_488_229_408, - 288_389_167_111_001, - 327_033_246_850_228, - 370_855_624_074_939, - 420_550_189_415_448, - 476_903_814_681_345, - 540_808_812_317_383, - 613_277_064_423_488, - 695_456_045_060_088, - 788_646_989_538_544, - 894_325_498_392_166, - 1_014_164_902_274_450, - 1_150_062_757_748_107, - 1_304_170_893_503_521, - 1_478_929_482_763_326, - 1_677_105_681_381_084, - 1_901_837_443_435_987, - 2_156_683_208_106_820, - 2_445_678_244_575_207, - 2_773_398_547_132_478, - 3_145_033_292_215_644, - 3_566_467_004_668_945, - 4_044_372_734_264_885, - 4_586_317_717_856_903, - 5_200_883_200_235_351, - 5_897_800_310_949_644, - 6_688_104_148_592_236, - 7_584_308_512_339_965, - 8_600_604_047_480_343, - 9_753_082_942_391_196, - 11_059_993_734_862_088, - 12_542_030_262_402_154, - 14_222_659_331_820_402, - 16_128_492_296_451_758, - 18_289_706_424_642_956, - 20_740_522_731_515_220, - 23_519_747_840_069_400, - 26_671_388_451_550_188, - 30_245_348_154_692_872, - 34_298_217_607_243_272, - 38_894_170_601_613_232, - 44_105_980_203_120_624, - 50_016_171_050_511_632, - 56_718_326_064_478_696, - 64_318_568_254_808_784, - 72_937_241_089_336_768, - 82_710_814_031_938_544, - 93_794_043_422_161_600, - 106_362_422_912_211_632, - 120_614_962_261_912_064, - 136_777_338_491_526_560, - 155_105_469_288_309_696, - 175_889_565_248_684_608, - 199_458_725_119_907_904, - 226_186_146_803_023_616, - 256_495_036_628_972_576, - 290_865_310_476_293_568, - 329_841_192_837_001_344, - 374_039_834_155_482_944, - 424_161_082_888_755_072, - 480_998_567_020_469_504, - 545_452_260_495_156_928, - 618_542_733_551_668_352, - 701_427_312_597_904_640, - 795_418_405_504_913_536, - 902_004_282_486_032_640, - 1_022_872_641_608_890_496, - 1_159_937_332_080_406_272, - 1_315_368_658_445_616_896, - 1_491_627_745_541_934_080, - 1_691_505_508_349_089_280, - 1_918_166_843_789_695_488, - 2_175_200_744_220_563_712, - 2_466_677_126_119_925_760, - 2_797_211_273_805_215_744, - 3_172_036_918_593_693_696, - 3_597_089_110_553_196_032, - 4_079_098_195_047_756_288, - 4_625_696_382_117_968_896, - 5_245_538_596_132_952_064, - 5_948_439_519_266_903_040, - 6_745_528_998_768_886_784, - 7_649_428_278_769_782_784, - 8_674_449_847_109_406_720, - 9_836_824_061_590_894_592, - 11_154_956_144_099_215_360, - 12_649_717_611_870_396_416, - 14_344_776_760_481_441_792, - 16_266_973_431_482_218_496, + 203_707_476, + 231_242_061, + 262_498_421, + 297_979_618, + 338_256_711, + 383_977_949, + 435_879_202, + 494_795_806, + 561_676_007, + 637_596_223, + 723_778_368, + 821_609_519, + 932_664_240, + 1_058_729_925, + 1_201_835_565, + 1_364_284_405, + 1_548_691_012, + 1_758_023_358, + 1_995_650_587, + 2_265_397_241, + 2_571_604_816, + 2_919_201_634, + 3_313_782_167, + 3_761_697_076, + 4_270_155_424, + 4_847_340_702, + 5_502_542_541, + 6_246_306_228, + 7_090_602_427, + 8_049_019_844, + 9_136_983_932, + 10_372_005_163, + 11_773_960_849, + 13_365_415_067, + 15_171_981_817, + 17_222_737_274, + 19_550_687_760, + 22_193_300_972, + 25_193_109_014, + 28_598_392_938, + 32_463_959_815, + 36_852_024_837, + 41_833_212_656, + 47_487_694_065, + 53_906_476_324, + 61_192_867_897, + 69_464_141_172, + 78_853_419_927, + 89_511_821_916, + 101_610_891_071, + 115_345_358_448, + 130_936_276_370, + 148_634_576_201, + 168_725_107_013, + 191_531_220_152, + 217_419_973_484, + 246_808_039_088, + 280_168_409_472, + 318_038_010_253, + 361_026_341_822, + 409_825_289_077, + 465_220_257_113, + 528_102_812_092, + 599_485_030_747, + 680_515_789_466, + 772_499_255_128, + 876_915_875_297, + 995_446_205_603, + 1_129_997_957_801, + 1_282_736_703_850, + 1_456_120_730_170, + 1_652_940_603_061, + 1_876_364_082_070, + 2_129_987_104_172, + 2_417_891_659_349, + 2_744_711_489_050, + 3_115_706_664_934, + 3_536_848_248_220, + 4_014_914_392_206, + 4_557_599_434_710, + 5_173_637_736_235, + 5_872_944_257_001, + 6_666_774_135_397, + 7_567_903_836_208, + 8_590_836_784_166, + 9_752_036_792_418, + 11_070_193_042_889, + 12_566_520_883_321, + 14_265_103_282_221, + 16_193_278_437_353, + 18_382_079_776_209, + 20_866_735_430_145, + 23_687_235_221_077, + 26_888_974_286_225, + 30_523_483_699_859, + 34_649_259_851_197, + 39_332_705_927_053, + 44_649_200_652_135, + 50_684_311_488_049, + 57_535_171_817_119, + 65_312_044_276_382, + 74_140_095_403_189, + 84_161_410_154_814, + 95_537_278_725_192, + 108_450_792_464_449, + 123_109_790_681_798, + 139_750_205_759_763, + 158_639_860_418_377, + 180_082_778_245_241, + 204_424_076_868_186, + 232_055_522_524_760, + 263_421_835_427_743, + 299_027_847_409_737, + 339_446_627_047_090, + 385_328_703_034_681, + 437_412_534_259_153, + 496_536_395_083_432, + 563_651_867_132_774, + 639_839_154_728_787, + 726_324_470_468_953, + 824_499_770_767_577, + 935_945_158_996_051, + 1_062_454_316_794_567, + 1_206_063_372_864_962, + 1_369_083_673_879_658, + 1_554_138_984_945_105, + 1_764_207_718_350_537, + 2_002_670_870_261_674, + 2_273_366_436_886_743, + 2_580_651_185_927_439, + 2_929_470_777_508_659, + 3_325_439_363_163_311, + 3_774_929_943_995_088, + 4_285_176_942_307_981, + 4_864_392_637_563_573, + 5_521_899_340_669_525, + 6_268_279_433_906_623, + 7_115_545_691_344_076, + 8_077_334_621_001_435, + 9_169_125_940_543_908, + 10_408_491_718_909_594, + 11_815_379_193_731_864, + 13_412_431_816_422_372, + 15_225_353_692_043_478, + 17_283_323_279_525_552, + 19_619_463_010_615_812, + 22_271_372_385_941_316, + 25_281_733_128_214_732, + 28_698_996_132_350_624, + 32_578_161_268_757_796, + 36_981_662_590_518_656, + 41_980_373_191_611_840, + 47_654_745_889_083_768, + 54_096_108_088_122_312, + 61_408_131_670_515_480, + 69_708_501_563_929_368, + 79_130_809_847_150_544, + 89_826_705_876_374_816, + 101_968_337_038_209_952, + 115_751_119_412_613_584, + 131_396_882_938_793_648, + 149_157_441_704_616_736, + 169_318_646_822_310_976, + 192_204_987_120_338_336, + 218_184_811_698_255_968, + 247_676_258_400_092_736, + 281_153_983_623_324_096, + 319_156_801_777_795_264, + 362_296_357_349_498_560, + 411_266_969_143_590_528, + 466_856_805_146_923_584, + 529_960_567_866_307_904, + 601_593_894_309_393_664, + 682_909_702_371_746_176, + 775_216_746_720_537_344, + 880_000_682_826_493_056, + 998_947_978_163_664_000, + 1_133_973_055_420_940_288, + 1_287_249_104_587_533_056, + 1_461_243_059_824_123_904, + 1_658_755_304_062_417_408, + 1_882_964_740_367_267_584, + 2_137_479_955_472_055_040, + 2_426_397_298_949_783_552, + 2_754_366_812_787_534_336, + 3_126_667_072_481_921_024, + 3_549_290_144_201_563_136, + 4_029_038_025_377_802_240, + 4_573_632_120_907_380_736, + 5_191_837_516_955_243_520, + 5_893_604_052_508_763_136, + 6_690_226_459_189_698_560, + 7_594_526_146_728_344_576, + 8_621_057_559_885_070_336, + 9_786_342_428_074_866_688, + 11_109_135_677_875_585_024, + 12_610_727_288_205_627_392, + 14_315_284_946_443_796_480, + 16_250_243_020_443_537_408, 18_446_744_073_709_551_615, ]; diff --git a/runtime/src/weights/mainnet/mod.rs b/runtime/src/weights/mainnet/mod.rs index 96a325655..0a7c5c303 100644 --- a/runtime/src/weights/mainnet/mod.rs +++ b/runtime/src/weights/mainnet/mod.rs @@ -6,7 +6,7 @@ pub mod extrinsic_weights; pub mod frame_system; pub mod pallet_airdrop; -//pub mod pallet_bags_list; +pub mod pallet_bags_list; pub mod pallet_balances; //pub mod pallet_dmail; //pub mod pallet_elections;