From 9c5e772938157b07eb0738817bc69c381871c565 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Mon, 27 Nov 2023 14:42:49 +0700 Subject: [PATCH 1/6] chill_other takes stash --- substrate/frame/staking/src/benchmarking.rs | 2 +- substrate/frame/staking/src/pallet/mod.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/substrate/frame/staking/src/benchmarking.rs b/substrate/frame/staking/src/benchmarking.rs index 6f60c4909f4d..c0c6a838aa59 100644 --- a/substrate/frame/staking/src/benchmarking.rs +++ b/substrate/frame/staking/src/benchmarking.rs @@ -873,7 +873,7 @@ benchmarks! { )?; let caller = whitelisted_caller(); - }: _(RawOrigin::Signed(caller), controller) + }: _(RawOrigin::Signed(caller), stash.clone()) verify { assert!(!T::VoterList::contains(&stash)); } diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 1f79ef63a475..2a46d0120853 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1764,11 +1764,13 @@ pub mod pallet { /// who do not satisfy these requirements. #[pallet::call_index(23)] #[pallet::weight(T::WeightInfo::chill_other())] - pub fn chill_other(origin: OriginFor, controller: T::AccountId) -> DispatchResult { + pub fn chill_other(origin: OriginFor, stash: T::AccountId) -> DispatchResult { // Anyone can call this function. let caller = ensure_signed(origin)?; - let ledger = Self::ledger(Controller(controller.clone()))?; - let stash = ledger.stash; + let ledger = Self::ledger(Stash(stash.clone()))?; + let controller = ledger.controller() + .defensive_proof("ledger was fetched used the StakingInterface, so controller field must exist; qed.") + .ok_or(Error::::NotController)?; // In order for one user to chill another user, the following conditions must be met: // From 95ee59ce281ac0862d81e800c248cfca53fc59ae Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Mon, 27 Nov 2023 14:48:15 +0700 Subject: [PATCH 2/6] amend proof comment --- substrate/frame/staking/src/pallet/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 2a46d0120853..7a6fc88dc7af 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1327,7 +1327,7 @@ pub mod pallet { // (temporary) passive migration. Self::ledger(StakingAccount::Stash(stash.clone())).map(|ledger| { let controller = ledger.controller() - .defensive_proof("ledger was fetched used the StakingInterface, so controller field must exist; qed.") + .defensive_proof("ledger was fetched using StakingLedger, so controller field must exist; qed.") .ok_or(Error::::NotController)?; if controller == stash { @@ -1768,8 +1768,11 @@ pub mod pallet { // Anyone can call this function. let caller = ensure_signed(origin)?; let ledger = Self::ledger(Stash(stash.clone()))?; - let controller = ledger.controller() - .defensive_proof("ledger was fetched used the StakingInterface, so controller field must exist; qed.") + let controller = ledger + .controller() + .defensive_proof( + "ledger was fetched using StakingLedger, so controller field must exist; qed.", + ) .ok_or(Error::::NotController)?; // In order for one user to chill another user, the following conditions must be met: From 44f02064905b0767e374f063c9458175387f0772 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 27 Nov 2023 08:56:55 +0000 Subject: [PATCH 3/6] ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_staking --- substrate/frame/staking/src/weights.rs | 382 +++++++++++++------------ 1 file changed, 193 insertions(+), 189 deletions(-) diff --git a/substrate/frame/staking/src/weights.rs b/substrate/frame/staking/src/weights.rs index ad9ca75a0328..ae00509eaa84 100644 --- a/substrate/frame/staking/src/weights.rs +++ b/substrate/frame/staking/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `runner-yprdrvc7-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` @@ -98,8 +98,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4764` - // Minimum execution time: 43_427_000 picoseconds. - Weight::from_parts(45_221_000, 4764) + // Minimum execution time: 42_895_000 picoseconds. + Weight::from_parts(44_924_000, 4764) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -119,8 +119,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1990` // Estimated: `8877` - // Minimum execution time: 87_100_000 picoseconds. - Weight::from_parts(90_599_000, 8877) + // Minimum execution time: 87_734_000 picoseconds. + Weight::from_parts(90_762_000, 8877) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -146,8 +146,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2195` // Estimated: `8877` - // Minimum execution time: 91_488_000 picoseconds. - Weight::from_parts(94_126_000, 8877) + // Minimum execution time: 90_914_000 picoseconds. + Weight::from_parts(94_156_000, 8877) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -166,10 +166,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1115` // Estimated: `4764` - // Minimum execution time: 42_713_000 picoseconds. - Weight::from_parts(44_530_499, 4764) - // Standard Error: 1_067 - .saturating_add(Weight::from_parts(51_411, 0).saturating_mul(s.into())) + // Minimum execution time: 43_141_000 picoseconds. + Weight::from_parts(45_081_969, 4764) + // Standard Error: 1_010 + .saturating_add(Weight::from_parts(39_539, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -206,10 +206,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 88_700_000 picoseconds. - Weight::from_parts(98_329_624, 6248) - // Standard Error: 4_477 - .saturating_add(Weight::from_parts(1_347_380, 0).saturating_mul(s.into())) + // Minimum execution time: 87_743_000 picoseconds. + Weight::from_parts(96_983_484, 6248) + // Standard Error: 4_271 + .saturating_add(Weight::from_parts(1_382_993, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -241,8 +241,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1372` // Estimated: `4556` - // Minimum execution time: 51_877_000 picoseconds. - Weight::from_parts(53_503_000, 4556) + // Minimum execution time: 51_888_000 picoseconds. + Weight::from_parts(54_353_000, 4556) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -255,10 +255,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1280 + k * (569 ±0)` // Estimated: `4556 + k * (3033 ±0)` - // Minimum execution time: 29_604_000 picoseconds. - Weight::from_parts(31_726_296, 4556) - // Standard Error: 6_350 - .saturating_add(Weight::from_parts(6_416_846, 0).saturating_mul(k.into())) + // Minimum execution time: 28_944_000 picoseconds. + Weight::from_parts(31_116_533, 4556) + // Standard Error: 11_848 + .saturating_add(Weight::from_parts(6_422_601, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) @@ -291,10 +291,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1866 + n * (102 ±0)` // Estimated: `6248 + n * (2520 ±0)` - // Minimum execution time: 64_276_000 picoseconds. - Weight::from_parts(62_615_844, 6248) - // Standard Error: 14_914 - .saturating_add(Weight::from_parts(4_097_019, 0).saturating_mul(n.into())) + // Minimum execution time: 63_921_000 picoseconds. + Weight::from_parts(62_662_863, 6248) + // Standard Error: 15_071 + .saturating_add(Weight::from_parts(3_950_084, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) @@ -318,8 +318,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `6248` - // Minimum execution time: 55_064_000 picoseconds. - Weight::from_parts(56_566_000, 6248) + // Minimum execution time: 54_605_000 picoseconds. + Weight::from_parts(56_406_000, 6248) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -333,8 +333,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `902` // Estimated: `4556` - // Minimum execution time: 16_626_000 picoseconds. - Weight::from_parts(17_519_000, 4556) + // Minimum execution time: 16_826_000 picoseconds. + Weight::from_parts(17_326_000, 4556) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -348,8 +348,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `969` // Estimated: `4556` - // Minimum execution time: 20_545_000 picoseconds. - Weight::from_parts(21_395_000, 4556) + // Minimum execution time: 20_831_000 picoseconds. + Weight::from_parts(21_615_000, 4556) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -361,8 +361,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `902` // Estimated: `4556` - // Minimum execution time: 20_179_000 picoseconds. - Weight::from_parts(20_728_000, 4556) + // Minimum execution time: 20_190_000 picoseconds. + Weight::from_parts(20_993_000, 4556) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -372,8 +372,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_594_000 picoseconds. - Weight::from_parts(2_777_000, 0) + // Minimum execution time: 2_603_000 picoseconds. + Weight::from_parts(2_747_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -382,8 +382,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_302_000 picoseconds. - Weight::from_parts(8_741_000, 0) + // Minimum execution time: 8_070_000 picoseconds. + Weight::from_parts(8_745_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -392,8 +392,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_504_000 picoseconds. - Weight::from_parts(8_774_000, 0) + // Minimum execution time: 7_999_000 picoseconds. + Weight::from_parts(8_624_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -402,8 +402,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_474_000 picoseconds. - Weight::from_parts(8_740_000, 0) + // Minimum execution time: 8_131_000 picoseconds. + Weight::from_parts(8_467_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Staking::Invulnerables` (r:0 w:1) @@ -413,10 +413,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_732_000 picoseconds. - Weight::from_parts(3_360_048, 0) - // Standard Error: 34 - .saturating_add(Weight::from_parts(9_964, 0).saturating_mul(v.into())) + // Minimum execution time: 2_731_000 picoseconds. + Weight::from_parts(3_298_421, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(10_075, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Staking::SlashingSpans` (r:1 w:1) @@ -452,10 +452,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 87_495_000 picoseconds. - Weight::from_parts(95_710_388, 6248) - // Standard Error: 5_849 - .saturating_add(Weight::from_parts(1_339_335, 0).saturating_mul(s.into())) + // Minimum execution time: 86_305_000 picoseconds. + Weight::from_parts(94_494_401, 6248) + // Standard Error: 3_602 + .saturating_add(Weight::from_parts(1_339_477, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(12_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -468,10 +468,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `66672` // Estimated: `70137` - // Minimum execution time: 98_255_000 picoseconds. - Weight::from_parts(892_807_378, 70137) - // Standard Error: 57_735 - .saturating_add(Weight::from_parts(4_876_449, 0).saturating_mul(s.into())) + // Minimum execution time: 100_007_000 picoseconds. + Weight::from_parts(894_033_025, 70137) + // Standard Error: 57_584 + .saturating_add(Weight::from_parts(4_870_504, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -507,11 +507,11 @@ impl WeightInfo for SubstrateWeight { fn payout_stakers_alive_staked(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `33297 + n * (377 ±0)` - // Estimated: `30944 + n * (3774 ±3)` - // Minimum execution time: 144_258_000 picoseconds. - Weight::from_parts(175_256_796, 30944) - // Standard Error: 24_339 - .saturating_add(Weight::from_parts(46_011_700, 0).saturating_mul(n.into())) + // Estimated: `30944 + n * (3774 ±0)` + // Minimum execution time: 142_575_000 picoseconds. + Weight::from_parts(196_320_577, 30944) + // Standard Error: 29_330 + .saturating_add(Weight::from_parts(45_325_062, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -535,10 +535,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1991 + l * (7 ±0)` // Estimated: `8877` - // Minimum execution time: 83_532_000 picoseconds. - Weight::from_parts(86_757_943, 8877) - // Standard Error: 6_379 - .saturating_add(Weight::from_parts(57_566, 0).saturating_mul(l.into())) + // Minimum execution time: 81_113_000 picoseconds. + Weight::from_parts(84_470_927, 8877) + // Standard Error: 5_588 + .saturating_add(Weight::from_parts(97_606, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -573,10 +573,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 96_776_000 picoseconds. - Weight::from_parts(100_950_027, 6248) - // Standard Error: 4_719 - .saturating_add(Weight::from_parts(1_432_091, 0).saturating_mul(s.into())) + // Minimum execution time: 94_810_000 picoseconds. + Weight::from_parts(99_292_156, 6248) + // Standard Error: 3_677 + .saturating_add(Weight::from_parts(1_345_598, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -621,13 +621,13 @@ impl WeightInfo for SubstrateWeight { fn new_era(v: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + n * (720 ±0) + v * (3598 ±0)` - // Estimated: `512390 + n * (3566 ±0) + v * (3566 ±0)` - // Minimum execution time: 577_699_000 picoseconds. - Weight::from_parts(582_827_000, 512390) - // Standard Error: 2_000_851 - .saturating_add(Weight::from_parts(67_316_744, 0).saturating_mul(v.into())) - // Standard Error: 199_373 - .saturating_add(Weight::from_parts(18_503_387, 0).saturating_mul(n.into())) + // Estimated: `512390 + n * (3566 ±4) + v * (3566 ±40)` + // Minimum execution time: 583_230_000 picoseconds. + Weight::from_parts(585_794_000, 512390) + // Standard Error: 1_984_644 + .saturating_add(Weight::from_parts(65_914_551, 0).saturating_mul(v.into())) + // Standard Error: 197_758 + .saturating_add(Weight::from_parts(18_105_424, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(206_u64)) .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(n.into()))) @@ -658,12 +658,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `3175 + n * (911 ±0) + v * (395 ±0)` // Estimated: `512390 + n * (3566 ±0) + v * (3566 ±0)` - // Minimum execution time: 34_048_778_000 picoseconds. - Weight::from_parts(34_397_777_000, 512390) - // Standard Error: 346_115 - .saturating_add(Weight::from_parts(3_704_941, 0).saturating_mul(v.into())) - // Standard Error: 346_115 - .saturating_add(Weight::from_parts(4_064_819, 0).saturating_mul(n.into())) + // Minimum execution time: 33_312_958_000 picoseconds. + Weight::from_parts(4_949_866_209, 512390) + // Standard Error: 402_931 + .saturating_add(Weight::from_parts(16_448_367, 0).saturating_mul(v.into())) + // Standard Error: 402_931 + .saturating_add(Weight::from_parts(25_361_503, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(201_u64)) .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(v.into()))) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(n.into()))) @@ -680,10 +680,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `979 + v * (50 ±0)` // Estimated: `3510 + v * (2520 ±0)` - // Minimum execution time: 2_473_149_000 picoseconds. - Weight::from_parts(84_721_859, 3510) - // Standard Error: 8_690 - .saturating_add(Weight::from_parts(4_870_439, 0).saturating_mul(v.into())) + // Minimum execution time: 2_474_646_000 picoseconds. + Weight::from_parts(2_512_113_000, 3510) + // Standard Error: 33_996 + .saturating_add(Weight::from_parts(1_992_173, 0).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(v.into()))) .saturating_add(Weight::from_parts(0, 2520).saturating_mul(v.into())) @@ -704,8 +704,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_312_000 picoseconds. - Weight::from_parts(5_897_000, 0) + // Minimum execution time: 5_466_000 picoseconds. + Weight::from_parts(5_861_000, 0) .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `Staking::MinCommission` (r:0 w:1) @@ -724,10 +724,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_676_000 picoseconds. - Weight::from_parts(4_913_000, 0) + // Minimum execution time: 4_780_000 picoseconds. + Weight::from_parts(4_998_000, 0) .saturating_add(T::DbWeight::get().writes(6_u64)) } + /// Storage: `Staking::Bonded` (r:1 w:0) + /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// Storage: `Staking::Ledger` (r:1 w:0) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`) /// Storage: `Staking::Nominators` (r:1 w:1) @@ -750,11 +752,11 @@ impl WeightInfo for SubstrateWeight { /// 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: `1773` + // Measured: `1939` // Estimated: `6248` - // Minimum execution time: 67_286_000 picoseconds. - Weight::from_parts(69_081_000, 6248) - .saturating_add(T::DbWeight::get().reads(11_u64)) + // Minimum execution time: 71_261_000 picoseconds. + Weight::from_parts(72_778_000, 6248) + .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: `Staking::MinCommission` (r:1 w:0) @@ -765,8 +767,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `691` // Estimated: `3510` - // Minimum execution time: 12_749_000 picoseconds. - Weight::from_parts(13_275_000, 3510) + // Minimum execution time: 12_497_000 picoseconds. + Weight::from_parts(13_049_000, 3510) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -776,8 +778,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_155_000 picoseconds. - Weight::from_parts(3_319_000, 0) + // Minimum execution time: 3_044_000 picoseconds. + Weight::from_parts(3_278_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -798,8 +800,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `927` // Estimated: `4764` - // Minimum execution time: 43_427_000 picoseconds. - Weight::from_parts(45_221_000, 4764) + // Minimum execution time: 42_895_000 picoseconds. + Weight::from_parts(44_924_000, 4764) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -819,8 +821,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1990` // Estimated: `8877` - // Minimum execution time: 87_100_000 picoseconds. - Weight::from_parts(90_599_000, 8877) + // Minimum execution time: 87_734_000 picoseconds. + Weight::from_parts(90_762_000, 8877) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -846,8 +848,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2195` // Estimated: `8877` - // Minimum execution time: 91_488_000 picoseconds. - Weight::from_parts(94_126_000, 8877) + // Minimum execution time: 90_914_000 picoseconds. + Weight::from_parts(94_156_000, 8877) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -866,10 +868,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1115` // Estimated: `4764` - // Minimum execution time: 42_713_000 picoseconds. - Weight::from_parts(44_530_499, 4764) - // Standard Error: 1_067 - .saturating_add(Weight::from_parts(51_411, 0).saturating_mul(s.into())) + // Minimum execution time: 43_141_000 picoseconds. + Weight::from_parts(45_081_969, 4764) + // Standard Error: 1_010 + .saturating_add(Weight::from_parts(39_539, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -906,10 +908,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 88_700_000 picoseconds. - Weight::from_parts(98_329_624, 6248) - // Standard Error: 4_477 - .saturating_add(Weight::from_parts(1_347_380, 0).saturating_mul(s.into())) + // Minimum execution time: 87_743_000 picoseconds. + Weight::from_parts(96_983_484, 6248) + // Standard Error: 4_271 + .saturating_add(Weight::from_parts(1_382_993, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -941,8 +943,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1372` // Estimated: `4556` - // Minimum execution time: 51_877_000 picoseconds. - Weight::from_parts(53_503_000, 4556) + // Minimum execution time: 51_888_000 picoseconds. + Weight::from_parts(54_353_000, 4556) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -955,10 +957,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1280 + k * (569 ±0)` // Estimated: `4556 + k * (3033 ±0)` - // Minimum execution time: 29_604_000 picoseconds. - Weight::from_parts(31_726_296, 4556) - // Standard Error: 6_350 - .saturating_add(Weight::from_parts(6_416_846, 0).saturating_mul(k.into())) + // Minimum execution time: 28_944_000 picoseconds. + Weight::from_parts(31_116_533, 4556) + // Standard Error: 11_848 + .saturating_add(Weight::from_parts(6_422_601, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) @@ -991,10 +993,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1866 + n * (102 ±0)` // Estimated: `6248 + n * (2520 ±0)` - // Minimum execution time: 64_276_000 picoseconds. - Weight::from_parts(62_615_844, 6248) - // Standard Error: 14_914 - .saturating_add(Weight::from_parts(4_097_019, 0).saturating_mul(n.into())) + // Minimum execution time: 63_921_000 picoseconds. + Weight::from_parts(62_662_863, 6248) + // Standard Error: 15_071 + .saturating_add(Weight::from_parts(3_950_084, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(6_u64)) @@ -1018,8 +1020,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `6248` - // Minimum execution time: 55_064_000 picoseconds. - Weight::from_parts(56_566_000, 6248) + // Minimum execution time: 54_605_000 picoseconds. + Weight::from_parts(56_406_000, 6248) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1033,8 +1035,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `902` // Estimated: `4556` - // Minimum execution time: 16_626_000 picoseconds. - Weight::from_parts(17_519_000, 4556) + // Minimum execution time: 16_826_000 picoseconds. + Weight::from_parts(17_326_000, 4556) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1048,8 +1050,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `969` // Estimated: `4556` - // Minimum execution time: 20_545_000 picoseconds. - Weight::from_parts(21_395_000, 4556) + // Minimum execution time: 20_831_000 picoseconds. + Weight::from_parts(21_615_000, 4556) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1061,8 +1063,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `902` // Estimated: `4556` - // Minimum execution time: 20_179_000 picoseconds. - Weight::from_parts(20_728_000, 4556) + // Minimum execution time: 20_190_000 picoseconds. + Weight::from_parts(20_993_000, 4556) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1072,8 +1074,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_594_000 picoseconds. - Weight::from_parts(2_777_000, 0) + // Minimum execution time: 2_603_000 picoseconds. + Weight::from_parts(2_747_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -1082,8 +1084,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_302_000 picoseconds. - Weight::from_parts(8_741_000, 0) + // Minimum execution time: 8_070_000 picoseconds. + Weight::from_parts(8_745_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -1092,8 +1094,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_504_000 picoseconds. - Weight::from_parts(8_774_000, 0) + // Minimum execution time: 7_999_000 picoseconds. + Weight::from_parts(8_624_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Staking::ForceEra` (r:0 w:1) @@ -1102,8 +1104,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_474_000 picoseconds. - Weight::from_parts(8_740_000, 0) + // Minimum execution time: 8_131_000 picoseconds. + Weight::from_parts(8_467_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Staking::Invulnerables` (r:0 w:1) @@ -1113,10 +1115,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_732_000 picoseconds. - Weight::from_parts(3_360_048, 0) - // Standard Error: 34 - .saturating_add(Weight::from_parts(9_964, 0).saturating_mul(v.into())) + // Minimum execution time: 2_731_000 picoseconds. + Weight::from_parts(3_298_421, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(10_075, 0).saturating_mul(v.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Staking::SlashingSpans` (r:1 w:1) @@ -1152,10 +1154,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 87_495_000 picoseconds. - Weight::from_parts(95_710_388, 6248) - // Standard Error: 5_849 - .saturating_add(Weight::from_parts(1_339_335, 0).saturating_mul(s.into())) + // Minimum execution time: 86_305_000 picoseconds. + Weight::from_parts(94_494_401, 6248) + // Standard Error: 3_602 + .saturating_add(Weight::from_parts(1_339_477, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(12_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -1168,10 +1170,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `66672` // Estimated: `70137` - // Minimum execution time: 98_255_000 picoseconds. - Weight::from_parts(892_807_378, 70137) - // Standard Error: 57_735 - .saturating_add(Weight::from_parts(4_876_449, 0).saturating_mul(s.into())) + // Minimum execution time: 100_007_000 picoseconds. + Weight::from_parts(894_033_025, 70137) + // Standard Error: 57_584 + .saturating_add(Weight::from_parts(4_870_504, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1207,11 +1209,11 @@ impl WeightInfo for () { fn payout_stakers_alive_staked(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `33297 + n * (377 ±0)` - // Estimated: `30944 + n * (3774 ±3)` - // Minimum execution time: 144_258_000 picoseconds. - Weight::from_parts(175_256_796, 30944) - // Standard Error: 24_339 - .saturating_add(Weight::from_parts(46_011_700, 0).saturating_mul(n.into())) + // Estimated: `30944 + n * (3774 ±0)` + // Minimum execution time: 142_575_000 picoseconds. + Weight::from_parts(196_320_577, 30944) + // Standard Error: 29_330 + .saturating_add(Weight::from_parts(45_325_062, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().reads((6_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) @@ -1235,10 +1237,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1991 + l * (7 ±0)` // Estimated: `8877` - // Minimum execution time: 83_532_000 picoseconds. - Weight::from_parts(86_757_943, 8877) - // Standard Error: 6_379 - .saturating_add(Weight::from_parts(57_566, 0).saturating_mul(l.into())) + // Minimum execution time: 81_113_000 picoseconds. + Weight::from_parts(84_470_927, 8877) + // Standard Error: 5_588 + .saturating_add(Weight::from_parts(97_606, 0).saturating_mul(l.into())) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -1273,10 +1275,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2196 + s * (4 ±0)` // Estimated: `6248 + s * (4 ±0)` - // Minimum execution time: 96_776_000 picoseconds. - Weight::from_parts(100_950_027, 6248) - // Standard Error: 4_719 - .saturating_add(Weight::from_parts(1_432_091, 0).saturating_mul(s.into())) + // Minimum execution time: 94_810_000 picoseconds. + Weight::from_parts(99_292_156, 6248) + // Standard Error: 3_677 + .saturating_add(Weight::from_parts(1_345_598, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -1321,13 +1323,13 @@ impl WeightInfo for () { fn new_era(v: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + n * (720 ±0) + v * (3598 ±0)` - // Estimated: `512390 + n * (3566 ±0) + v * (3566 ±0)` - // Minimum execution time: 577_699_000 picoseconds. - Weight::from_parts(582_827_000, 512390) - // Standard Error: 2_000_851 - .saturating_add(Weight::from_parts(67_316_744, 0).saturating_mul(v.into())) - // Standard Error: 199_373 - .saturating_add(Weight::from_parts(18_503_387, 0).saturating_mul(n.into())) + // Estimated: `512390 + n * (3566 ±4) + v * (3566 ±40)` + // Minimum execution time: 583_230_000 picoseconds. + Weight::from_parts(585_794_000, 512390) + // Standard Error: 1_984_644 + .saturating_add(Weight::from_parts(65_914_551, 0).saturating_mul(v.into())) + // Standard Error: 197_758 + .saturating_add(Weight::from_parts(18_105_424, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(206_u64)) .saturating_add(RocksDbWeight::get().reads((5_u64).saturating_mul(v.into()))) .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(n.into()))) @@ -1358,12 +1360,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `3175 + n * (911 ±0) + v * (395 ±0)` // Estimated: `512390 + n * (3566 ±0) + v * (3566 ±0)` - // Minimum execution time: 34_048_778_000 picoseconds. - Weight::from_parts(34_397_777_000, 512390) - // Standard Error: 346_115 - .saturating_add(Weight::from_parts(3_704_941, 0).saturating_mul(v.into())) - // Standard Error: 346_115 - .saturating_add(Weight::from_parts(4_064_819, 0).saturating_mul(n.into())) + // Minimum execution time: 33_312_958_000 picoseconds. + Weight::from_parts(4_949_866_209, 512390) + // Standard Error: 402_931 + .saturating_add(Weight::from_parts(16_448_367, 0).saturating_mul(v.into())) + // Standard Error: 402_931 + .saturating_add(Weight::from_parts(25_361_503, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(201_u64)) .saturating_add(RocksDbWeight::get().reads((5_u64).saturating_mul(v.into()))) .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(n.into()))) @@ -1380,10 +1382,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `979 + v * (50 ±0)` // Estimated: `3510 + v * (2520 ±0)` - // Minimum execution time: 2_473_149_000 picoseconds. - Weight::from_parts(84_721_859, 3510) - // Standard Error: 8_690 - .saturating_add(Weight::from_parts(4_870_439, 0).saturating_mul(v.into())) + // Minimum execution time: 2_474_646_000 picoseconds. + Weight::from_parts(2_512_113_000, 3510) + // Standard Error: 33_996 + .saturating_add(Weight::from_parts(1_992_173, 0).saturating_mul(v.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(v.into()))) .saturating_add(Weight::from_parts(0, 2520).saturating_mul(v.into())) @@ -1404,8 +1406,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_312_000 picoseconds. - Weight::from_parts(5_897_000, 0) + // Minimum execution time: 5_466_000 picoseconds. + Weight::from_parts(5_861_000, 0) .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `Staking::MinCommission` (r:0 w:1) @@ -1424,10 +1426,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_676_000 picoseconds. - Weight::from_parts(4_913_000, 0) + // Minimum execution time: 4_780_000 picoseconds. + Weight::from_parts(4_998_000, 0) .saturating_add(RocksDbWeight::get().writes(6_u64)) } + /// Storage: `Staking::Bonded` (r:1 w:0) + /// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// Storage: `Staking::Ledger` (r:1 w:0) /// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`) /// Storage: `Staking::Nominators` (r:1 w:1) @@ -1450,11 +1454,11 @@ impl WeightInfo for () { /// 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: `1773` + // Measured: `1939` // Estimated: `6248` - // Minimum execution time: 67_286_000 picoseconds. - Weight::from_parts(69_081_000, 6248) - .saturating_add(RocksDbWeight::get().reads(11_u64)) + // Minimum execution time: 71_261_000 picoseconds. + Weight::from_parts(72_778_000, 6248) + .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `Staking::MinCommission` (r:1 w:0) @@ -1465,8 +1469,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `691` // Estimated: `3510` - // Minimum execution time: 12_749_000 picoseconds. - Weight::from_parts(13_275_000, 3510) + // Minimum execution time: 12_497_000 picoseconds. + Weight::from_parts(13_049_000, 3510) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1476,8 +1480,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_155_000 picoseconds. - Weight::from_parts(3_319_000, 0) + // Minimum execution time: 3_044_000 picoseconds. + Weight::from_parts(3_278_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } From 3e5a30f0c2f3a4d70ea1f97d6329d91835888fab Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Mon, 27 Nov 2023 20:29:10 +0700 Subject: [PATCH 4/6] Update substrate/frame/staking/src/pallet/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gonçalo Pestana --- substrate/frame/staking/src/pallet/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 7a6fc88dc7af..1e2882f8f80a 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1771,7 +1771,7 @@ pub mod pallet { let controller = ledger .controller() .defensive_proof( - "ledger was fetched using StakingLedger, so controller field must exist; qed.", + "Ledger's controller field didn't exist. The ledger should fetched using StakingLedger.", ) .ok_or(Error::::NotController)?; From 93369d4b3aaaf5f4bc05299b71946b84b41031c1 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Mon, 27 Nov 2023 20:33:25 +0700 Subject: [PATCH 5/6] amend defensive_proof error messages --- substrate/frame/staking/src/pallet/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 1e2882f8f80a..7773acadabad 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1299,7 +1299,7 @@ pub mod pallet { let _ = ledger .set_payee(payee) - .defensive_proof("ledger was retrieved from storage, thus its bonded; qed.")?; + .defensive_proof("ledger was retrieved from storage, thus its bonded.")?; Ok(()) } @@ -1327,7 +1327,7 @@ pub mod pallet { // (temporary) passive migration. Self::ledger(StakingAccount::Stash(stash.clone())).map(|ledger| { let controller = ledger.controller() - .defensive_proof("ledger was fetched using StakingLedger, so controller field must exist; qed.") + .defensive_proof("Ledger's controller field didn't exist. The controller should have been fetched using StakingLedger.") .ok_or(Error::::NotController)?; if controller == stash { @@ -1771,7 +1771,7 @@ pub mod pallet { let controller = ledger .controller() .defensive_proof( - "Ledger's controller field didn't exist. The ledger should fetched using StakingLedger.", + "Ledger's controller field didn't exist. The controller should have been fetched using StakingLedger.", ) .ok_or(Error::::NotController)?; From 1471fd7bf80a17313e35711e65ee4e38afa5b2f7 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Mon, 27 Nov 2023 20:41:24 +0700 Subject: [PATCH 6/6] revert change --- substrate/frame/staking/src/pallet/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 7773acadabad..ce80f22c2bbf 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1299,7 +1299,7 @@ pub mod pallet { let _ = ledger .set_payee(payee) - .defensive_proof("ledger was retrieved from storage, thus its bonded.")?; + .defensive_proof("ledger was retrieved from storage, thus its bonded; qed.")?; Ok(()) }