diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs index 1027f03057621..b11d02dbb6efc 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs @@ -294,7 +294,6 @@ impl pallet_staking_async::Config for Runtime { type HistoryDepth = frame_support::traits::ConstU32<84>; type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; type EventListeners = (NominationPools, DelegatedStaking); - type MaxInvulnerables = frame_support::traits::ConstU32<20>; type PlanningEraOffset = pallet_staking_async::PlanningEraOffsetOf>; type RcClientInterface = StakingRcClient; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs index 644c17ff88d80..bfad4a58691bb 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_staking_async` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-09-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-11-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `04e6bcf4596d`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `b5e3f48e1195`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -66,10 +66,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn bond() -> Weight { // Proof Size summary in bytes: - // Measured: `6813` + // Measured: `6793` // Estimated: `4218` - // Minimum execution time: 113_577_000 picoseconds. - Weight::from_parts(116_932_000, 0) + // Minimum execution time: 118_990_000 picoseconds. + Weight::from_parts(122_483_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -94,10 +94,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn bond_extra() -> Weight { // Proof Size summary in bytes: - // Measured: `8274` + // Measured: `8254` // Estimated: `8877` - // Minimum execution time: 289_644_000 picoseconds. - Weight::from_parts(302_513_000, 0) + // Minimum execution time: 291_845_000 picoseconds. + Weight::from_parts(309_556_000, 0) .saturating_add(Weight::from_parts(0, 8877)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(7)) @@ -124,10 +124,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn unbond() -> Weight { // Proof Size summary in bytes: - // Measured: `8422` + // Measured: `8402` // Estimated: `8877` - // Minimum execution time: 248_875_000 picoseconds. - Weight::from_parts(256_830_000, 0) + // Minimum execution time: 261_351_000 picoseconds. + Weight::from_parts(274_219_000, 0) .saturating_add(Weight::from_parts(0, 8877)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(6)) @@ -156,10 +156,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `DelegatedStaking::Agents` (`max_values`: None, `max_size`: Some(120), added: 2595, mode: `MaxEncodedLen`) fn withdraw_unbonded_update() -> Weight { // Proof Size summary in bytes: - // Measured: `7413` + // Measured: `7393` // Estimated: `6696` - // Minimum execution time: 131_705_000 picoseconds. - Weight::from_parts(135_270_000, 0) + // Minimum execution time: 132_943_000 picoseconds. + Weight::from_parts(135_591_000, 0) .saturating_add(Weight::from_parts(0, 6696)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(2)) @@ -200,10 +200,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn withdraw_unbonded_kill() -> Weight { // Proof Size summary in bytes: - // Measured: `8360` + // Measured: `8340` // Estimated: `6696` - // Minimum execution time: 299_116_000 picoseconds. - Weight::from_parts(312_554_000, 0) + // Minimum execution time: 302_871_000 picoseconds. + Weight::from_parts(326_117_000, 0) .saturating_add(Weight::from_parts(0, 6696)) .saturating_add(T::DbWeight::get().reads(17)) .saturating_add(T::DbWeight::get().writes(11)) @@ -234,10 +234,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::CounterForValidators` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn validate() -> Weight { // Proof Size summary in bytes: - // Measured: `8771` + // Measured: `9885` // Estimated: `4218` - // Minimum execution time: 102_777_000 picoseconds. - Weight::from_parts(106_153_000, 0) + // Minimum execution time: 111_471_000 picoseconds. + Weight::from_parts(118_182_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(5)) @@ -251,13 +251,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `k` is `[1, 128]`. fn kick(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `12207 + k * (1121 ±0)` + // Measured: `12187 + k * (1121 ±0)` // Estimated: `4218 + k * (3033 ±0)` - // Minimum execution time: 79_398_000 picoseconds. - Weight::from_parts(87_226_243, 0) + // Minimum execution time: 76_259_000 picoseconds. + Weight::from_parts(60_600_586, 0) .saturating_add(Weight::from_parts(0, 4218)) - // Standard Error: 43_658 - .saturating_add(Weight::from_parts(16_818_523, 0).saturating_mul(k.into())) + // Standard Error: 65_405 + .saturating_add(Weight::from_parts(15_000_929, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) @@ -290,13 +290,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `n` is `[1, 16]`. fn nominate(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4995 + n * (68 ±0)` + // Measured: `5074 + n * (68 ±0)` // Estimated: `6248 + n * (2520 ±0)` - // Minimum execution time: 180_698_000 picoseconds. - Weight::from_parts(202_744_514, 0) + // Minimum execution time: 183_345_000 picoseconds. + Weight::from_parts(200_319_329, 0) .saturating_add(Weight::from_parts(0, 6248)) - // Standard Error: 82_249 - .saturating_add(Weight::from_parts(5_669_284, 0).saturating_mul(n.into())) + // Standard Error: 49_034 + .saturating_add(Weight::from_parts(6_190_799, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -322,10 +322,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `VoterList::CounterForListNodes` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn chill() -> Weight { // Proof Size summary in bytes: - // Measured: `5237` + // Measured: `5217` // Estimated: `6248` - // Minimum execution time: 170_702_000 picoseconds. - Weight::from_parts(184_776_000, 0) + // Minimum execution time: 172_613_000 picoseconds. + Weight::from_parts(181_043_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(6)) @@ -338,10 +338,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn set_payee() -> Weight { // Proof Size summary in bytes: - // Measured: `4060` + // Measured: `4040` // Estimated: `4218` - // Minimum execution time: 38_367_000 picoseconds. - Weight::from_parts(39_752_000, 0) + // Minimum execution time: 39_387_000 picoseconds. + Weight::from_parts(40_614_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -354,10 +354,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn update_payee() -> Weight { // Proof Size summary in bytes: - // Measured: `5732` + // Measured: `5712` // Estimated: `4218` - // Minimum execution time: 48_642_000 picoseconds. - Weight::from_parts(50_461_000, 0) + // Minimum execution time: 49_294_000 picoseconds. + Weight::from_parts(51_097_000, 0) .saturating_add(Weight::from_parts(0, 4218)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -368,10 +368,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) fn set_controller() -> Weight { // Proof Size summary in bytes: - // Measured: `5370` + // Measured: `5383` // Estimated: `7446` - // Minimum execution time: 49_900_000 picoseconds. - Weight::from_parts(51_842_000, 0) + // Minimum execution time: 50_978_000 picoseconds. + Weight::from_parts(53_037_000, 0) .saturating_add(Weight::from_parts(0, 7446)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -382,8 +382,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_517_000 picoseconds. - Weight::from_parts(2_842_000, 0) + // Minimum execution time: 2_830_000 picoseconds. + Weight::from_parts(3_129_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -393,8 +393,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_680_000 picoseconds. - Weight::from_parts(15_760_000, 0) + // Minimum execution time: 15_401_000 picoseconds. + Weight::from_parts(16_194_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -404,8 +404,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_091_000 picoseconds. - Weight::from_parts(15_838_000, 0) + // Minimum execution time: 15_327_000 picoseconds. + Weight::from_parts(16_018_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -415,25 +415,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_927_000 picoseconds. - Weight::from_parts(16_114_000, 0) + // Minimum execution time: 15_319_000 picoseconds. + Weight::from_parts(15_947_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `Staking::Invulnerables` (r:0 w:1) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `v` is `[0, 20]`. - fn set_invulnerables(v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_826_000 picoseconds. - Weight::from_parts(3_433_272, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 967 - .saturating_add(Weight::from_parts(17_572, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().writes(1)) - } /// Storage: `Staking::Ledger` (r:1502 w:1502) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:751 w:751) @@ -443,13 +429,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `u` is `[0, 751]`. fn deprecate_controller_batch(u: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `194937 + u * (1086 ±0)` + // Measured: `195432 + u * (1105 ±0)` // Estimated: `990 + u * (6456 ±0)` - // Minimum execution time: 5_707_000 picoseconds. - Weight::from_parts(416_986_998, 0) + // Minimum execution time: 5_745_000 picoseconds. + Weight::from_parts(5_964_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 83_724 - .saturating_add(Weight::from_parts(48_456_907, 0).saturating_mul(u.into())) + // Standard Error: 75_845 + .saturating_add(Weight::from_parts(51_287_959, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 6456).saturating_mul(u.into())) @@ -482,10 +468,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn force_unstake() -> Weight { // Proof Size summary in bytes: - // Measured: `8305` + // Measured: `8285` // Estimated: `6248` - // Minimum execution time: 268_494_000 picoseconds. - Weight::from_parts(287_320_000, 0) + // Minimum execution time: 284_163_000 picoseconds. + Weight::from_parts(296_313_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) @@ -495,13 +481,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `s` is `[1, 1000]`. fn cancel_deferred_slash(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `653` + // Measured: `633` // Estimated: `39479` - // Minimum execution time: 16_163_000 picoseconds. - Weight::from_parts(16_564_000, 0) + // Minimum execution time: 16_183_000 picoseconds. + Weight::from_parts(16_584_000, 0) .saturating_add(Weight::from_parts(0, 39479)) - // Standard Error: 8_347 - .saturating_add(Weight::from_parts(2_970_506, 0).saturating_mul(s.into())) + // Standard Error: 8_521 + .saturating_add(Weight::from_parts(2_997_518, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -534,13 +520,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `n` is `[0, 64]`. fn payout_stakers_alive_staked(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `32761 + n * (3627 ±0)` + // Measured: `32987 + n * (3657 ±0)` // Estimated: `39483 + n * (3228 ±0)` - // Minimum execution time: 341_005_000 picoseconds. - Weight::from_parts(484_113_723, 0) + // Minimum execution time: 341_693_000 picoseconds. + Weight::from_parts(532_937_521, 0) .saturating_add(Weight::from_parts(0, 39483)) - // Standard Error: 179_884 - .saturating_add(Weight::from_parts(141_242_813, 0).saturating_mul(n.into())) + // Standard Error: 218_096 + .saturating_add(Weight::from_parts(141_756_582, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -568,13 +554,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `l` is `[1, 32]`. fn rebond(l: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `8275 + l * (5 ±0)` + // Measured: `8255 + l * (5 ±0)` // Estimated: `8877` - // Minimum execution time: 241_410_000 picoseconds. - Weight::from_parts(262_304_335, 0) + // Minimum execution time: 241_987_000 picoseconds. + Weight::from_parts(264_579_679, 0) .saturating_add(Weight::from_parts(0, 8877)) - // Standard Error: 46_723 - .saturating_add(Weight::from_parts(309_679, 0).saturating_mul(l.into())) + // Standard Error: 22_642 + .saturating_add(Weight::from_parts(371_741, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -608,10 +594,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn reap_stash() -> Weight { // Proof Size summary in bytes: - // Measured: `8368` + // Measured: `8348` // Estimated: `6248` - // Minimum execution time: 300_336_000 picoseconds. - Weight::from_parts(320_628_000, 0) + // Minimum execution time: 293_246_000 picoseconds. + Weight::from_parts(315_724_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(14)) .saturating_add(T::DbWeight::get().writes(11)) @@ -634,8 +620,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_554_000 picoseconds. - Weight::from_parts(4_900_000, 0) + // Minimum execution time: 5_121_000 picoseconds. + Weight::from_parts(5_590_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -657,8 +643,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_200_000 picoseconds. - Weight::from_parts(4_453_000, 0) + // Minimum execution time: 4_823_000 picoseconds. + Weight::from_parts(5_235_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -688,10 +674,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `VoterList::CounterForListNodes` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn chill_other() -> Weight { // Proof Size summary in bytes: - // Measured: `5360` + // Measured: `5350` // Estimated: `6248` - // Minimum execution time: 210_278_000 picoseconds. - Weight::from_parts(223_503_000, 0) + // Minimum execution time: 207_310_000 picoseconds. + Weight::from_parts(216_759_000, 0) .saturating_add(Weight::from_parts(0, 6248)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(6)) @@ -702,10 +688,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) fn force_apply_min_commission() -> Weight { // Proof Size summary in bytes: - // Measured: `663` + // Measured: `640` // Estimated: `3510` - // Minimum execution time: 37_633_000 picoseconds. - Weight::from_parts(40_846_000, 0) + // Minimum execution time: 38_347_000 picoseconds. + Weight::from_parts(40_576_000, 0) .saturating_add(Weight::from_parts(0, 3510)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -716,8 +702,8 @@ impl pallet_staking_async::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_570_000 picoseconds. - Weight::from_parts(2_849_000, 0) + // Minimum execution time: 2_840_000 picoseconds. + Weight::from_parts(3_057_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -735,10 +721,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) fn restore_ledger() -> Weight { // Proof Size summary in bytes: - // Measured: `6968` + // Measured: `6948` // Estimated: `4764` - // Minimum execution time: 77_211_000 picoseconds. - Weight::from_parts(79_223_000, 0) + // Minimum execution time: 77_339_000 picoseconds. + Weight::from_parts(80_434_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -757,16 +743,18 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(265), added: 2740, mode: `MaxEncodedLen`) fn migrate_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `7039` + // Measured: `7019` // Estimated: `4764` - // Minimum execution time: 124_593_000 picoseconds. - Weight::from_parts(128_244_000, 0) + // Minimum execution time: 127_560_000 picoseconds. + Weight::from_parts(131_931_000, 0) .saturating_add(Weight::from_parts(0, 4764)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Staking::ActiveEra` (r:1 w:0) /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) + /// Storage: `Staking::CancelledSlashes` (r:1 w:0) + /// Proof: `Staking::CancelledSlashes` (`max_values`: None, `max_size`: Some(36014), added: 38489, mode: `MaxEncodedLen`) /// Storage: `Staking::UnappliedSlashes` (r:1 w:1) /// Proof: `Staking::UnappliedSlashes` (`max_values`: None, `max_size`: Some(3231), added: 5706, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:65 w:0) @@ -785,12 +773,12 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(265), added: 2740, mode: `MaxEncodedLen`) fn apply_slash() -> Weight { // Proof Size summary in bytes: - // Measured: `212846` + // Measured: `214677` // Estimated: `210810` - // Minimum execution time: 6_294_738_000 picoseconds. - Weight::from_parts(6_451_211_000, 0) + // Minimum execution time: 6_223_489_000 picoseconds. + Weight::from_parts(6_379_349_000, 0) .saturating_add(Weight::from_parts(0, 210810)) - .saturating_add(T::DbWeight::get().reads(457)) + .saturating_add(T::DbWeight::get().reads(458)) .saturating_add(T::DbWeight::get().writes(261)) } /// Storage: `Staking::ProcessingOffence` (r:1 w:1) @@ -809,10 +797,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::UnappliedSlashes` (`max_values`: None, `max_size`: Some(3231), added: 5706, mode: `MaxEncodedLen`) fn process_offence_queue() -> Weight { // Proof Size summary in bytes: - // Measured: `3622` + // Measured: `3602` // Estimated: `6617` - // Minimum execution time: 160_545_000 picoseconds. - Weight::from_parts(170_185_000, 0) + // Minimum execution time: 158_328_000 picoseconds. + Weight::from_parts(168_068_000, 0) .saturating_add(Weight::from_parts(0, 6617)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) @@ -821,8 +809,6 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::BondedEras` (r:1 w:0) /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:500 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Staking::ValidatorSlashInEra` (r:500 w:500) @@ -834,14 +820,14 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[2, 500]`. fn rc_on_offence(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `687 + v * (96 ±0)` - // Estimated: `2126 + v * (2576 ±0)` - // Minimum execution time: 97_236_000 picoseconds. - Weight::from_parts(7_707_285, 0) - .saturating_add(Weight::from_parts(0, 2126)) - // Standard Error: 15_935 - .saturating_add(Weight::from_parts(19_925_892, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `667 + v * (96 ±0)` + // Estimated: `1510 + v * (2576 ±0)` + // Minimum execution time: 95_622_000 picoseconds. + Weight::from_parts(23_516_576, 0) + .saturating_add(Weight::from_parts(0, 1510)) + // Standard Error: 19_899 + .saturating_add(Weight::from_parts(19_834_052, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(v.into()))) @@ -877,10 +863,10 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ElectableStashes` (`max_values`: Some(1), `max_size`: Some(32002), added: 32497, mode: `MaxEncodedLen`) fn rc_on_session_report() -> Weight { // Proof Size summary in bytes: - // Measured: `1230` + // Measured: `1210` // Estimated: `39483` - // Minimum execution time: 466_552_000 picoseconds. - Weight::from_parts(491_384_000, 0) + // Minimum execution time: 454_212_000 picoseconds. + Weight::from_parts(471_327_000, 0) .saturating_add(Weight::from_parts(0, 39483)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) @@ -894,13 +880,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[1, 1000]`. fn prune_era_stakers_paged(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `7932 + v * (3 ±0)` - // Estimated: `258685 + v * (4 ±0)` - // Minimum execution time: 177_161_000 picoseconds. - Weight::from_parts(215_748_309, 0) - .saturating_add(Weight::from_parts(0, 258685)) - // Standard Error: 1_574 - .saturating_add(Weight::from_parts(63_902, 0).saturating_mul(v.into())) + // Measured: `7912 + v * (3 ±0)` + // Estimated: `258665 + v * (4 ±0)` + // Minimum execution time: 161_987_000 picoseconds. + Weight::from_parts(186_512_175, 0) + .saturating_add(Weight::from_parts(0, 258665)) + // Standard Error: 1_183 + .saturating_add(Weight::from_parts(28_669, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(103)) .saturating_add(T::DbWeight::get().writes(100)) .saturating_add(Weight::from_parts(0, 4).saturating_mul(v.into())) @@ -914,16 +900,16 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[1, 1000]`. fn prune_era_stakers_overview(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `8859` - // Estimated: `203138 + v * (84 ±0)` - // Minimum execution time: 45_108_000 picoseconds. - Weight::from_parts(184_023_118, 0) - .saturating_add(Weight::from_parts(0, 203138)) - // Standard Error: 4_913 - .saturating_add(Weight::from_parts(110_136, 0).saturating_mul(v.into())) + // Measured: `7425` + // Estimated: `202015 + v * (83 ±0)` + // Minimum execution time: 35_891_000 picoseconds. + Weight::from_parts(147_563_202, 0) + .saturating_add(Weight::from_parts(0, 202015)) + // Standard Error: 3_885 + .saturating_add(Weight::from_parts(80_872, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(81)) .saturating_add(T::DbWeight::get().writes(79)) - .saturating_add(Weight::from_parts(0, 84).saturating_mul(v.into())) + .saturating_add(Weight::from_parts(0, 83).saturating_mul(v.into())) } /// Storage: `Staking::ActiveEra` (r:1 w:0) /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `Measured`) @@ -934,13 +920,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[1, 1000]`. fn prune_era_validator_prefs(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `5885` - // Estimated: `200831 + v * (83 ±6)` - // Minimum execution time: 44_850_000 picoseconds. - Weight::from_parts(176_036_211, 0) - .saturating_add(Weight::from_parts(0, 200831)) - // Standard Error: 4_585 - .saturating_add(Weight::from_parts(101_327, 0).saturating_mul(v.into())) + // Measured: `5865` + // Estimated: `200811 + v * (83 ±0)` + // Minimum execution time: 37_112_000 picoseconds. + Weight::from_parts(144_264_739, 0) + .saturating_add(Weight::from_parts(0, 200811)) + // Standard Error: 3_710 + .saturating_add(Weight::from_parts(81_855, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(81)) .saturating_add(T::DbWeight::get().writes(79)) .saturating_add(Weight::from_parts(0, 83).saturating_mul(v.into())) @@ -954,13 +940,13 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// The range of component `v` is `[1, 1000]`. fn prune_era_claimed_rewards(v: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `8859` - // Estimated: `203138 + v * (84 ±0)` - // Minimum execution time: 41_789_000 picoseconds. - Weight::from_parts(168_784_316, 0) - .saturating_add(Weight::from_parts(0, 203138)) - // Standard Error: 4_527 - .saturating_add(Weight::from_parts(123_314, 0).saturating_mul(v.into())) + // Measured: `8839` + // Estimated: `203118 + v * (84 ±0)` + // Minimum execution time: 36_854_000 picoseconds. + Weight::from_parts(148_150_061, 0) + .saturating_add(Weight::from_parts(0, 203118)) + // Standard Error: 3_839 + .saturating_add(Weight::from_parts(78_999, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(81)) .saturating_add(T::DbWeight::get().writes(79)) .saturating_add(Weight::from_parts(0, 84).saturating_mul(v.into())) @@ -973,11 +959,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ErasValidatorReward` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`) fn prune_era_validator_reward() -> Weight { // Proof Size summary in bytes: - // Measured: `809` - // Estimated: `4274` - // Minimum execution time: 32_432_000 picoseconds. - Weight::from_parts(34_510_000, 0) - .saturating_add(Weight::from_parts(0, 4274)) + // Measured: `789` + // Estimated: `4254` + // Minimum execution time: 27_656_000 picoseconds. + Weight::from_parts(28_268_000, 0) + .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -989,11 +975,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ErasRewardPoints` (`max_values`: None, `max_size`: Some(36018), added: 38493, mode: `Measured`) fn prune_era_reward_points() -> Weight { // Proof Size summary in bytes: - // Measured: `809` - // Estimated: `4274` - // Minimum execution time: 32_296_000 picoseconds. - Weight::from_parts(34_923_000, 0) - .saturating_add(Weight::from_parts(0, 4274)) + // Measured: `789` + // Estimated: `4254` + // Minimum execution time: 27_702_000 picoseconds. + Weight::from_parts(28_336_000, 0) + .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -1005,11 +991,11 @@ impl pallet_staking_async::WeightInfo for WeightInfo /// Proof: `Staking::ErasTotalStake` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `Measured`) fn prune_era_total_stake() -> Weight { // Proof Size summary in bytes: - // Measured: `809` - // Estimated: `4274` - // Minimum execution time: 40_141_000 picoseconds. - Weight::from_parts(43_990_000, 0) - .saturating_add(Weight::from_parts(0, 4274)) + // Measured: `789` + // Estimated: `4254` + // Minimum execution time: 32_516_000 picoseconds. + Weight::from_parts(34_316_000, 0) + .saturating_add(Weight::from_parts(0, 4254)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/prdoc/pr_10359.prdoc b/prdoc/pr_10359.prdoc new file mode 100644 index 0000000000000..226c34d979233 --- /dev/null +++ b/prdoc/pr_10359.prdoc @@ -0,0 +1,10 @@ +title: Remove invulnerables form staking-async +doc: +- audience: Runtime Dev + description: |- + The 'staking-async' pallet has inherited the list of invulnerable validators from the 'staking' pallet, but these are no longer used. We can therefore remove them, together with additional clean-up. This includes removing the 'set_invulnerables(...)' call together with the 'Invulnerables' storage type. +crates: +- name: asset-hub-westend-runtime + bump: major +- name: pallet-staking-async + bump: major diff --git a/substrate/frame/staking-async/ahm-test/src/ah/mock.rs b/substrate/frame/staking-async/ahm-test/src/ah/mock.rs index 7e86524a058b6..caa85caddc1ae 100644 --- a/substrate/frame/staking-async/ahm-test/src/ah/mock.rs +++ b/substrate/frame/staking-async/ahm-test/src/ah/mock.rs @@ -353,7 +353,6 @@ impl pallet_staking_async::Config for Runtime { type MaxValidatorSet = MaxValidators; type MaxExposurePageSize = MaxExposurePageSize; - type MaxInvulnerables = MaxValidators; type MaxUnlockingChunks = ConstU32<16>; type NominationsQuota = pallet_staking_async::FixedNominationsQuota<16>; diff --git a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs index 2b0113735e3a2..67f2b2f1a4e4e 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs @@ -450,7 +450,6 @@ impl pallet_staking_async::Config for Runtime { type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; type EventListeners = (NominationPools, DelegatedStaking); type WeightInfo = pallet_staking_async::weights::SubstrateWeight; - type MaxInvulnerables = frame_support::traits::ConstU32<20>; type MaxEraDuration = MaxEraDuration; type MaxPruningItems = MaxPruningItems; type PlanningEraOffset = diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs index 6d5b02bb2b4ba..4e6b16cb89a05 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_staking_async.rs @@ -73,7 +73,6 @@ pub trait WeightInfo { fn force_no_eras() -> Weight; fn force_new_era() -> Weight; fn force_new_era_always() -> Weight; - fn set_invulnerables(v: u32, ) -> Weight; fn deprecate_controller_batch(u: u32, ) -> Weight; fn force_unstake() -> Weight; fn cancel_deferred_slash(s: u32, ) -> Weight; @@ -449,17 +448,6 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(11_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `Staking::Invulnerables` (r:0 w:1) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `v` is `[0, 20]`. - fn set_invulnerables(_v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } /// Storage: `Staking::Ledger` (r:1502 w:1502) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:751 w:751) @@ -822,8 +810,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::BondedEras` (r:1 w:0) /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:500 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Staking::ValidatorSlashInEra` (r:500 w:500) @@ -1342,17 +1328,6 @@ impl WeightInfo for () { Weight::from_parts(11_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `Staking::Invulnerables` (r:0 w:1) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `v` is `[0, 20]`. - fn set_invulnerables(_v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } /// Storage: `Staking::Ledger` (r:1502 w:1502) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:751 w:751) @@ -1715,8 +1690,6 @@ impl WeightInfo for () { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::BondedEras` (r:1 w:0) /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:500 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Staking::ValidatorSlashInEra` (r:500 w:500) diff --git a/substrate/frame/staking-async/runtimes/rc/src/weights/pallet_offences.rs b/substrate/frame/staking-async/runtimes/rc/src/weights/pallet_offences.rs index f656cdb6754d1..9ae419e3cbcab 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/weights/pallet_offences.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/weights/pallet_offences.rs @@ -59,8 +59,6 @@ impl pallet_offences::WeightInfo for WeightInfo { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStartSessionIndex` (r:1 w:0) /// Proof: `Staking::ErasStartSessionIndex` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:1 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Session::DisabledValidators` (r:1 w:1) @@ -94,8 +92,6 @@ impl pallet_offences::WeightInfo for WeightInfo { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStartSessionIndex` (r:1 w:0) /// Proof: `Staking::ErasStartSessionIndex` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:1 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Session::DisabledValidators` (r:1 w:1) diff --git a/substrate/frame/staking-async/runtimes/rc/src/weights/polkadot_runtime_parachains_disputes_slashing.rs b/substrate/frame/staking-async/runtimes/rc/src/weights/polkadot_runtime_parachains_disputes_slashing.rs index 772c72eaea80f..b82d50a864ec6 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/weights/polkadot_runtime_parachains_disputes_slashing.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/weights/polkadot_runtime_parachains_disputes_slashing.rs @@ -65,8 +65,6 @@ impl polkadot_runtime_parachains::disputes::slashing::W /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStartSessionIndex` (r:1 w:0) /// Proof: `Staking::ErasStartSessionIndex` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:1 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Session::DisabledValidators` (r:1 w:1) diff --git a/substrate/frame/staking-async/src/benchmarking.rs b/substrate/frame/staking-async/src/benchmarking.rs index 584a56e40c1ec..b7a9e01df2e53 100644 --- a/substrate/frame/staking-async/src/benchmarking.rs +++ b/substrate/frame/staking-async/src/benchmarking.rs @@ -594,20 +594,6 @@ mod benchmarks { assert_eq!(ForceEra::::get(), Forcing::ForceAlways); } - #[benchmark] - // Worst case scenario, the list of invulnerables is very long. - fn set_invulnerables(v: Linear<0, { T::MaxInvulnerables::get() }>) { - let mut invulnerables = Vec::new(); - for i in 0..v { - invulnerables.push(account("invulnerable", i, SEED)); - } - - #[extrinsic_call] - _(RawOrigin::Root, invulnerables); - - assert_eq!(Invulnerables::::get().len(), v as usize); - } - #[benchmark] fn deprecate_controller_batch( // We pass a dynamic number of controllers to the benchmark, up to diff --git a/substrate/frame/staking-async/src/mock.rs b/substrate/frame/staking-async/src/mock.rs index 2b9809426bfe3..1132e20b3592c 100644 --- a/substrate/frame/staking-async/src/mock.rs +++ b/substrate/frame/staking-async/src/mock.rs @@ -438,7 +438,6 @@ impl crate::pallet::pallet::Config for Test { type BondingDuration = BondingDuration; type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch; type EventListeners = EventListenerMock; - type MaxInvulnerables = ConstU32<20>; type MaxEraDuration = MaxEraDuration; type MaxPruningItems = MaxPruningItems; type PlanningEraOffset = PlanningEraOffset; @@ -477,7 +476,6 @@ parameter_types! { pub struct ExtBuilder { nominate: bool, validator_count: u32, - invulnerables: BoundedVec::MaxInvulnerables>, has_stakers: bool, pub min_nominator_bond: Balance, min_validator_bond: Balance, @@ -494,7 +492,6 @@ impl Default for ExtBuilder { nominate: true, validator_count: 2, balance_factor: 1, - invulnerables: BoundedVec::new(), has_stakers: true, min_nominator_bond: ExistentialDeposit::get(), min_validator_bond: ExistentialDeposit::get(), @@ -548,11 +545,6 @@ impl ExtBuilder { SlashDeferDuration::set(eras); self } - pub(crate) fn invulnerables(mut self, invulnerables: Vec) -> Self { - self.invulnerables = BoundedVec::try_from(invulnerables) - .expect("Too many invulnerable validators: upper limit is MaxInvulnerables"); - self - } pub(crate) fn session_per_era(self, length: SessionIndex) -> Self { SessionsPerEra::set(length); self @@ -687,7 +679,6 @@ impl ExtBuilder { let _ = pallet_staking_async::GenesisConfig:: { stakers: maybe_stakers, validator_count: self.validator_count, - invulnerables: self.invulnerables, active_era: (0, 0, INIT_TIMESTAMP), slash_reward_fraction: Perbill::from_percent(10), min_nominator_bond: self.min_nominator_bond, diff --git a/substrate/frame/staking-async/src/pallet/impls.rs b/substrate/frame/staking-async/src/pallet/impls.rs index e5c594f6998da..a7149a6d84fee 100644 --- a/substrate/frame/staking-async/src/pallet/impls.rs +++ b/substrate/frame/staking-async/src/pallet/impls.rs @@ -1193,16 +1193,9 @@ impl rc_client::AHStakingInterface for Pallet { active_era.index.saturating_sub(T::SlashDeferDuration::get().saturating_sub(1)) }; - let invulnerables = Invulnerables::::get(); - for o in offences { let slash_fraction = o.slash_fraction; let validator: ::AccountId = o.offender.into(); - // Skip if the validator is invulnerable. - if invulnerables.contains(&validator) { - log!(debug, "🦹 on_offence: {:?} is invulnerable; ignoring offence", validator); - continue - } // ignore offence if too old to report. if offence_era < oldest_reportable_offence_era { diff --git a/substrate/frame/staking-async/src/pallet/mod.rs b/substrate/frame/staking-async/src/pallet/mod.rs index 11174e7f26ade..5d481339f7b13 100644 --- a/substrate/frame/staking-async/src/pallet/mod.rs +++ b/substrate/frame/staking-async/src/pallet/mod.rs @@ -323,10 +323,6 @@ pub mod pallet { #[pallet::no_default_bounds] type EventListeners: sp_staking::OnStakingUpdate>; - /// Maximum number of invulnerable validators. - #[pallet::constant] - type MaxInvulnerables: Get; - /// Maximum allowed era duration in milliseconds. /// /// This provides a defensive upper bound to cap the effective era duration, preventing @@ -406,7 +402,6 @@ pub mod pallet { type MaxUnlockingChunks = ConstU32<32>; type MaxValidatorSet = ConstU32<100>; type MaxControllersInDeprecationBatch = ConstU32<100>; - type MaxInvulnerables = ConstU32<20>; type MaxEraDuration = (); type MaxPruningItems = MaxPruningItems; type EventListeners = (); @@ -419,13 +414,6 @@ pub mod pallet { #[pallet::storage] pub type ValidatorCount = StorageValue<_, u32, ValueQuery>; - /// Any validators that may never be slashed or forcibly kicked. It's a Vec since they're - /// easy to initialize and the performance hit is minimal (we expect no more than four - /// invulnerables) and restricted to testnets. - #[pallet::storage] - pub type Invulnerables = - StorageValue<_, BoundedVec, ValueQuery>; - /// Map from all locked "stash" accounts to the controller account. /// /// TWOX-NOTE: SAFE since `AccountId` is a secure hash. @@ -855,7 +843,6 @@ pub mod pallet { #[derive(frame_support::DefaultNoBound, frame_support::DebugNoBound)] pub struct GenesisConfig { pub validator_count: u32, - pub invulnerables: BoundedVec, pub force_era: Forcing, pub slash_reward_fraction: Perbill, pub canceled_payout: BalanceOf, @@ -908,12 +895,6 @@ pub mod pallet { ); ValidatorCount::::put(self.validator_count); - assert!( - self.invulnerables.len() as u32 <= T::MaxInvulnerables::get(), - "Too many invulnerable validators at genesis." - ); - >::put(&self.invulnerables); - ForceEra::::put(self.force_era); CanceledSlashPayout::::put(self.canceled_payout); SlashRewardFraction::::put(self.slash_reward_fraction); @@ -1967,22 +1948,6 @@ pub mod pallet { Ok(()) } - /// Set the validators who cannot be slashed (if any). - /// - /// The dispatch origin must be Root. - #[pallet::call_index(14)] - #[pallet::weight(T::WeightInfo::set_invulnerables(invulnerables.len() as u32))] - pub fn set_invulnerables( - origin: OriginFor, - invulnerables: Vec, - ) -> DispatchResult { - ensure_root(origin)?; - let invulnerables = - BoundedVec::try_from(invulnerables).map_err(|_| Error::::BoundNotMet)?; - >::put(invulnerables); - Ok(()) - } - /// Force a current staker to become completely unstaked, immediately. /// /// The dispatch origin must be Root. diff --git a/substrate/frame/staking-async/src/tests/slashing.rs b/substrate/frame/staking-async/src/tests/slashing.rs index 2f46b6f3721fa..c5a50329d6a24 100644 --- a/substrate/frame/staking-async/src/tests/slashing.rs +++ b/substrate/frame/staking-async/src/tests/slashing.rs @@ -512,42 +512,6 @@ fn retroactive_deferred_slashes_one_before() { }) } -#[test] -fn invulnerables_are_not_slashed() { - // For invulnerable validators no slashing is performed. - ExtBuilder::default() - .invulnerables(vec![11]) - .nominate(false) - .build_and_execute(|| { - assert_eq!(asset::stakeable_balance::(&11), 1000); - assert_eq!(asset::stakeable_balance::(&21), 1000); - - let initial_balance = Staking::slashable_balance_of(&21); - - // slash both - add_slash(11); - add_slash(21); - Session::roll_next(); - assert_eq!( - staking_events_since_last_call(), - vec![ - Event::OffenceReported { - offence_era: 1, - validator: 21, - fraction: Perbill::from_percent(10) - }, - Event::SlashComputed { offence_era: 1, slash_era: 1, offender: 21, page: 0 }, - Event::Slashed { staker: 21, amount: 100 } - ] - ); - - // The validator 11 hasn't been slashed, but 21 has been. - assert_eq!(asset::stakeable_balance::(&11), 1000); - // 1000 - (0.1 * initial_balance) - assert_eq!(asset::stakeable_balance::(&21), 1000 - (initial_balance / 10)); - }); -} - #[test] fn dont_slash_if_fraction_is_zero() { // Don't slash if the fraction is zero. diff --git a/substrate/frame/staking-async/src/weights.rs b/substrate/frame/staking-async/src/weights.rs index 2001a17255303..1df950316263e 100644 --- a/substrate/frame/staking-async/src/weights.rs +++ b/substrate/frame/staking-async/src/weights.rs @@ -71,7 +71,6 @@ pub trait WeightInfo { fn force_no_eras() -> Weight; fn force_new_era() -> Weight; fn force_new_era_always() -> Weight; - fn set_invulnerables(v: u32, ) -> Weight; fn deprecate_controller_batch(u: u32, ) -> Weight; fn force_unstake() -> Weight; fn cancel_deferred_slash(s: u32, ) -> Weight; @@ -447,17 +446,6 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(13_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `Staking::Invulnerables` (r:0 w:1) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `v` is `[0, 20]`. - fn set_invulnerables(_v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } /// Storage: `Staking::Ledger` (r:1502 w:1502) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:751 w:751) @@ -821,8 +809,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::BondedEras` (r:1 w:0) /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:500 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Staking::ValidatorSlashInEra` (r:500 w:500) @@ -1444,17 +1430,6 @@ impl WeightInfo for () { Weight::from_parts(13_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `Staking::Invulnerables` (r:0 w:1) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `v` is `[0, 20]`. - fn set_invulnerables(_v: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } /// Storage: `Staking::Ledger` (r:1502 w:1502) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(753), added: 3228, mode: `MaxEncodedLen`) /// Storage: `Staking::Bonded` (r:751 w:751) @@ -1818,8 +1793,6 @@ impl WeightInfo for () { /// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`) /// Storage: `Staking::BondedEras` (r:1 w:0) /// Proof: `Staking::BondedEras` (`max_values`: Some(1), `max_size`: Some(25), added: 520, mode: `MaxEncodedLen`) - /// Storage: `Staking::Invulnerables` (r:1 w:0) - /// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) /// Storage: `Staking::ErasStakersOverview` (r:500 w:0) /// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `Staking::ValidatorSlashInEra` (r:500 w:500)