diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 858240b81e8c..e7ed4d54a654 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -396,7 +396,7 @@ impl pallet_staking::Config for Runtime { type EventListeners = (); type WeightInfo = (); type DisablingStrategy = pallet_staking::UpToLimitWithReEnablingDisablingStrategy; - type MaxInvulnerables = ConstU32<4>; + type MaxInvulnerables = ConstU32<20>; } parameter_types! { diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 3bd3d8bffe1b..8b7863cab7b3 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -756,7 +756,7 @@ impl pallet_staking::Config for Runtime { type EventListeners = (NominationPools, DelegatedStaking); type WeightInfo = weights::pallet_staking::WeightInfo; type DisablingStrategy = pallet_staking::UpToLimitWithReEnablingDisablingStrategy; - type MaxInvulnerables = frame_support::traits::ConstU32<4>; + type MaxInvulnerables = frame_support::traits::ConstU32<20>; } impl pallet_fast_unstake::Config for Runtime { diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index f1689a11b2a9..8adeed309620 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -745,7 +745,7 @@ impl pallet_staking::Config for Runtime { type WeightInfo = pallet_staking::weights::SubstrateWeight; type BenchmarkingConfig = StakingBenchmarkingConfig; type DisablingStrategy = pallet_staking::UpToLimitWithReEnablingDisablingStrategy; - type MaxInvulnerables = ConstU32<4>; + type MaxInvulnerables = ConstU32<20>; } impl pallet_fast_unstake::Config for Runtime { diff --git a/substrate/frame/staking/src/migrations.rs b/substrate/frame/staking/src/migrations.rs index 1b27b85e76a8..ee489c6b4d26 100644 --- a/substrate/frame/staking/src/migrations.rs +++ b/substrate/frame/staking/src/migrations.rs @@ -67,25 +67,28 @@ pub mod v17 { pub struct VersionUncheckedMigrateV16ToV17(core::marker::PhantomData); impl UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV16ToV17 { fn on_runtime_upgrade() -> Weight { + let mut migration_errors = false; + let old_disabled_validators = v16::DisabledValidators::::get(); // BoundedVec with MaxWinners limit, this should always work let disabled_validators_maybe = BoundedVec::try_from(old_disabled_validators); match disabled_validators_maybe { Ok(disabled_validators) => DisabledValidators::::set(disabled_validators), - Err(_) => log!(warn, "Migration failed for DisabledValidators from v16 to v17."), + Err(_) => { + log!(warn, "Migration failed for DisabledValidators from v16 to v17."); + migration_errors = true; + }, } let old_invulnerables = v16::Invulnerables::::get(); - let old_invulnerables_len = old_invulnerables.len(); // BoundedVec with MaxWinners limit, this should always work let invulnerables_maybe = BoundedVec::try_from(old_invulnerables); match invulnerables_maybe { Ok(invulnerables) => Invulnerables::::set(invulnerables), - Err(_) => log!( - warn, - "Migration failed for Invulnerables from v16 to v17: {} old invulnerables may get lost.", - old_invulnerables_len, - ), + Err(_) => { + log!(warn, "Migration failed for Invulnerables from v16 to v17."); + migration_errors = true; + }, } for (era_index, era_rewards) in v16::ErasRewardPoints::::iter() { @@ -101,11 +104,18 @@ pub mod v17 { }; ErasRewardPoints::::insert(era_index, bounded_era_rewards); }, - Err(_) => log!(warn, "Migration failed for ErasRewardPoints from v16 to v17."), + Err(_) => { + log!(warn, "Migration failed for ErasRewardPoints from v16 to v17."); + migration_errors = true; + }, } } - log!(info, "v17 applied successfully."); + if migration_errors { + log!(warn, "v17 applied with some errors."); + } else { + log!(info, "v17 applied successfully."); + } T::DbWeight::get().reads_writes(1, 1) } } diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index cd3773fb8e29..77c21ac01a6f 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -347,7 +347,7 @@ pub mod pallet { type MaxControllersInDeprecationBatch = ConstU32<100>; type EventListeners = (); type DisablingStrategy = crate::UpToLimitDisablingStrategy; - type MaxInvulnerables = ConstU32<4>; + type MaxInvulnerables = ConstU32<20>; #[cfg(feature = "std")] type BenchmarkingConfig = crate::TestBenchmarkingConfig; type WeightInfo = ();