@@ -279,7 +279,7 @@ impl pallet_babe::Config for Runtime {
279279 type WeightInfo = ( ) ;
280280
281281 type MaxAuthorities = MaxAuthorities ;
282- type MaxNominators = MaxNominatorRewardedPerValidator ;
282+ type MaxNominators = MaxNominators ;
283283
284284 type KeyOwnerProof =
285285 <Historical as KeyOwnerProofSystem < ( KeyTypeId , pallet_babe:: AuthorityId ) > >:: Proof ;
@@ -330,7 +330,7 @@ parameter_types! {
330330impl pallet_beefy:: Config for Runtime {
331331 type BeefyId = BeefyId ;
332332 type MaxAuthorities = MaxAuthorities ;
333- type MaxNominators = MaxNominatorRewardedPerValidator ;
333+ type MaxNominators = MaxNominators ;
334334 type MaxSetIdSessionEntries = BeefySetIdSessionEntries ;
335335 type OnNewValidatorSet = BeefyMmrLeaf ;
336336 type WeightInfo = ( ) ;
@@ -667,7 +667,12 @@ parameter_types! {
667667 "DOT_SLASH_DEFER_DURATION"
668668 ) ;
669669 pub const RewardCurve : & ' static PiecewiseLinear <' static > = & REWARD_CURVE ;
670- pub const MaxNominatorRewardedPerValidator : u32 = 512 ;
670+ // TODO:(PR#137) - check MaxExposurePageSize/MaxNominators 512?
671+ pub const MaxExposurePageSize : u32 = 512 ;
672+ // Note: this is not really correct as Max Nominators is (MaxExposurePageSize * page_count) but
673+ // this is an unbounded number. We just set it to a reasonably high value, 1 full page
674+ // of nominators.
675+ pub const MaxNominators : u32 = 512 ;
671676 pub const OffendingValidatorsThreshold : Perbill = Perbill :: from_percent( 17 ) ;
672677 // 16
673678 pub const MaxNominations : u32 = <NposCompactSolution16 as frame_election_provider_support:: NposSolution >:: LIMIT as u32 ;
@@ -764,7 +769,7 @@ impl pallet_staking::Config for Runtime {
764769 type AdminOrigin = EitherOf < EnsureRoot < Self :: AccountId > , StakingAdmin > ;
765770 type SessionInterface = Self ;
766771 type EraPayout = EraPayout ;
767- type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator ;
772+ type MaxExposurePageSize = MaxExposurePageSize ;
768773 type OffendingValidatorsThreshold = OffendingValidatorsThreshold ;
769774 type NextNewSession = Session ;
770775 type ElectionProvider = ElectionProviderMultiPhase ;
@@ -787,8 +792,6 @@ impl pallet_fast_unstake::Config for Runtime {
787792 type ControlOrigin = EnsureRoot < AccountId > ;
788793 type Staking = Staking ;
789794 type MaxErasToCheckPerBlock = ConstU32 < 1 > ;
790- #[ cfg( feature = "runtime-benchmarks" ) ]
791- type MaxBackersPerValidator = MaxNominatorRewardedPerValidator ;
792795 type WeightInfo = weights:: pallet_fast_unstake:: WeightInfo < Runtime > ;
793796}
794797
@@ -953,7 +956,7 @@ impl pallet_grandpa::Config for Runtime {
953956
954957 type WeightInfo = ( ) ;
955958 type MaxAuthorities = MaxAuthorities ;
956- type MaxNominators = MaxNominatorRewardedPerValidator ;
959+ type MaxNominators = MaxNominators ;
957960 type MaxSetIdSessionEntries = MaxSetIdSessionEntries ;
958961
959962 type KeyOwnerProof = <Historical as KeyOwnerProofSystem < ( KeyTypeId , GrandpaId ) > >:: Proof ;
@@ -1705,6 +1708,7 @@ pub mod migrations {
17051708 UpgradeSessionKeys ,
17061709 pallet_nomination_pools:: migration:: versioned:: V5toV6 < Runtime > ,
17071710 pallet_nomination_pools:: migration:: versioned:: V6ToV7 < Runtime > ,
1711+ pallet_staking:: migrations:: v14:: MigrateToV14 < Runtime > ,
17081712 ) ;
17091713}
17101714
@@ -1848,10 +1852,14 @@ sp_api::impl_runtime_apis! {
18481852 }
18491853 }
18501854
1851- impl pallet_staking_runtime_api:: StakingApi <Block , Balance > for Runtime {
1855+ impl pallet_staking_runtime_api:: StakingApi <Block , Balance , AccountId > for Runtime {
18521856 fn nominations_quota( balance: Balance ) -> u32 {
18531857 Staking :: api_nominations_quota( balance)
18541858 }
1859+
1860+ fn eras_stakers_page_count( era: sp_staking:: EraIndex , account: AccountId ) -> sp_staking:: Page {
1861+ Staking :: api_eras_stakers_page_count( era, account)
1862+ }
18551863 }
18561864
18571865 impl tx_pool_api:: runtime_api:: TaggedTransactionQueue <Block > for Runtime {
@@ -2449,7 +2457,7 @@ mod test_fees {
24492457 use pallet_staking:: WeightInfo ;
24502458 let payout_weight =
24512459 <Runtime as pallet_staking:: Config >:: WeightInfo :: payout_stakers_alive_staked (
2452- MaxNominatorRewardedPerValidator :: get ( ) ,
2460+ MaxNominators :: get ( ) ,
24532461 )
24542462 . ref_time ( ) as f64 ;
24552463 let block_weight = BlockWeights :: get ( ) . max_block . ref_time ( ) as f64 ;
0 commit comments