From a065a91a59b019ab497e6b9748ed8fc925539f65 Mon Sep 17 00:00:00 2001 From: giuseppere Date: Fri, 20 Dec 2024 12:04:32 +0100 Subject: [PATCH] Set `MaxValidatorsCount` equal to `MaxAuthorities` --- polkadot/runtime/test-runtime/src/lib.rs | 3 ++- substrate/bin/node/runtime/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 71a4580bc56a..62b7c1c8a20c 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -346,6 +346,7 @@ parameter_types! { pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxExposurePageSize: u32 = 64; pub const MaxNominators: u32 = 256; + // This corresponds to the maximum number of validators pub const MaxAuthorities: u32 = 100_000; pub const OnChainMaxWinners: u32 = u32::MAX; // Unbounded number of election targets and voters. @@ -400,7 +401,7 @@ impl pallet_staking::Config for Runtime { type DisablingStrategy = pallet_staking::UpToLimitWithReEnablingDisablingStrategy; type MaxInvulnerables = ConstU32<20>; type MaxRewardPagesPerValidator = ConstU32<20>; - type MaxValidatorsCount = ConstU32<300>; + type MaxValidatorsCount = MaxAuthorities; type MaxDisabledValidators = ConstU32<100>; } diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index dec45b1de711..7a2dc3388ace 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -748,7 +748,7 @@ impl pallet_staking::Config for Runtime { type DisablingStrategy = pallet_staking::UpToLimitWithReEnablingDisablingStrategy; type MaxInvulnerables = ConstU32<20>; type MaxRewardPagesPerValidator = ConstU32<20>; - type MaxValidatorsCount = ConstU32<300>; + type MaxValidatorsCount = MaxAuthorities; type MaxDisabledValidators = ConstU32<100>; } @@ -1485,7 +1485,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); /// We prioritize im-online heartbeats over election solution submission. pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2; - pub const MaxAuthorities: u32 = 100; + pub const MaxAuthorities: u32 = 300; pub const MaxKeys: u32 = 10_000; pub const MaxPeerInHeartbeats: u32 = 10_000; }