Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payees lazy migration to PayoutDestination, Split variant for payouts, remove Controller #1196

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8b4e270
payout destination
Aug 28, 2023
41c57b5
update polkadot weights
Aug 28, 2023
41a878d
Merge branch 'master' into rb-payout-destination
Sep 14, 2023
5b24718
Merge branch 'master' into rb-payout-destination
Sep 14, 2023
a74e362
Merge branch 'master' into rb-payout-destination
Sep 15, 2023
e444ddf
fix CHANGELOG
Sep 15, 2023
63b70d2
update mod
Sep 15, 2023
a9b699a
fmt
Sep 15, 2023
4a3158e
fix bounded_vec
Sep 15, 2023
10fa587
rm
Sep 15, 2023
4733027
fmt fixes
Sep 15, 2023
13b2cd7
style guide
Sep 15, 2023
3f9a64a
zetper format
Sep 15, 2023
a2e9b53
fix import
Sep 15, 2023
ada2c54
Merge branch 'master' into rb-payout-destination
Sep 15, 2023
e2606ab
Merge branch 'master' into rb-payout-destination
Sep 17, 2023
be3a745
Merge branch 'master' into rb-payout-destination
Sep 18, 2023
03773a2
Merge branch 'master' into rb-payout-destination
Sep 20, 2023
12d1d8a
make_payout fixes
Sep 20, 2023
2146243
Merge branch 'rb-payout-destination' of https://github.com/paritytech…
Sep 20, 2023
64a64d6
fmt
Sep 20, 2023
af40ebb
Merge branch 'master' into rb-payout-destination
Sep 20, 2023
8ca57cb
Merge branch 'master' into rb-payout-destination
Sep 21, 2023
9035119
Merge branch 'master' into rb-payout-destination
Sep 22, 2023
62b15e4
Merge branch 'master' into rb-payout-destination
Sep 25, 2023
9607e25
Merge branch 'master' into rb-payout-destination
Sep 28, 2023
a7b19af
add tracking issue
Sep 28, 2023
60c2f01
from_call to handle undesired Splits
Sep 28, 2023
f50ef44
comment
Sep 28, 2023
f629511
add tracking url
Sep 28, 2023
4bd3f6a
rm clone
Sep 28, 2023
2347b25
from_route for test & benches only
Sep 29, 2023
240677f
remove complexity notes
Sep 29, 2023
e757600
Payee storage_prefix, use DeprecatedPayee
Sep 29, 2023
070d219
use CheckedPayoutDestination
Sep 29, 2023
93e033f
fmt
Sep 29, 2023
6742524
fix
Sep 29, 2023
723d2a3
Merge branch 'master' into rb-payout-destination
Sep 29, 2023
2941e0f
rm conflicts
Sep 29, 2023
544d81f
Merge branch 'rb-payout-destination' of https://github.com/paritytech…
Sep 29, 2023
74bf531
Merge branch 'master' into rb-payout-destination
Sep 29, 2023
8886d83
Merge branch 'master' into rb-payout-destination
Sep 30, 2023
27039f1
Merge branch 'master' into rb-payout-destination
Oct 1, 2023
29e7b4d
Merge branch 'master' into rb-payout-destination
Oct 2, 2023
0edcfb7
Merge branch 'master' into rb-payout-destination
Oct 3, 2023
8668680
Merge branch 'master' into rb-payout-destination
Oct 4, 2023
1a15ce8
Merge branch 'master' into rb-payout-destination
Oct 5, 2023
24cc6cb
Merge branch 'master' into rb-payout-destination
Oct 6, 2023
926234c
Merge branch 'master' into rb-payout-destination
Oct 8, 2023
f6c7a25
Merge branch 'master' into rb-payout-destination
Oct 10, 2023
d443635
Merge branch 'master' into rb-payout-destination
Oct 12, 2023
42fbd04
Merge branch 'master' into rb-payout-destination
Oct 13, 2023
0122d6f
Merge branch 'master' into rb-payout-destination
Oct 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

168 changes: 94 additions & 74 deletions polkadot/runtime/westend/src/weights/pallet_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,37 @@ impl<T: frame_system::Config> pallet_staking::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: Staking Ledger (r:1 w:0)
/// Proof: Staking Ledger (max_values: None, max_size: Some(1091), added: 3566, mode: MaxEncodedLen)
/// Storage: Staking Payee (r:0 w:1)
/// Proof: Staking Payee (max_values: None, max_size: Some(73), added: 2548, 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::Payees` (r:1 w:1)
/// Proof: `Staking::Payees` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `Staking::Payee` (r:1 w:1)
/// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn set_payee() -> Weight {
// Proof Size summary in bytes:
// Measured: `771`
// Measured: `1011`
// Estimated: `4556`
// Minimum execution time: 13_943_000 picoseconds.
Weight::from_parts(14_384_000, 0)
.saturating_add(Weight::from_parts(0, 4556))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
// Minimum execution time: 26_163_000 picoseconds.
Weight::from_parts(26_736_000, 4556)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
/// Storage: `Staking::Ledger` (r:1 w:0)
/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
/// Storage: `Staking::Payees` (r:1 w:1)
/// Proof: `Staking::Payees` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `Staking::Payee` (r:1 w:1)
/// Proof: `Staking::Payee` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Staking::CounterForPayees` (r:1 w:1)
/// Proof: `Staking::CounterForPayees` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn update_payee() -> Weight {
// Proof Size summary in bytes:
// Measured: `989`
// Estimated: `4556`
// Minimum execution time: 29_795_000 picoseconds.
Weight::from_parts(30_505_000, 4556)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
/// Storage: Staking Bonded (r:1 w:1)
/// Proof: Staking Bonded (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen)
Expand Down Expand Up @@ -442,75 +460,77 @@ impl<T: frame_system::Config> pallet_staking::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Staking CurrentEra (r:1 w:0)
/// Proof: Staking CurrentEra (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Staking ErasValidatorReward (r:1 w:0)
/// Proof: Staking ErasValidatorReward (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen)
/// Storage: Staking Bonded (r:65 w:0)
/// Proof: Staking Bonded (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen)
/// Storage: Staking Ledger (r:1 w:1)
/// Proof: Staking Ledger (max_values: None, max_size: Some(1091), added: 3566, mode: MaxEncodedLen)
/// Storage: Staking ErasStakersClipped (r:1 w:0)
/// Proof Skipped: Staking ErasStakersClipped (max_values: None, max_size: None, mode: Measured)
/// Storage: Staking ErasRewardPoints (r:1 w:0)
/// Proof Skipped: Staking ErasRewardPoints (max_values: None, max_size: None, mode: Measured)
/// Storage: Staking ErasValidatorPrefs (r:1 w:0)
/// Proof: Staking ErasValidatorPrefs (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
/// Storage: Staking Payee (r:65 w:0)
/// Proof: Staking Payee (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
/// Storage: System Account (r:65 w:65)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 64]`.
/// Storage: `Staking::CurrentEra` (r:1 w:0)
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasValidatorReward` (r:1 w:0)
/// Proof: `Staking::ErasValidatorReward` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:257 w:0)
/// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`)
/// Storage: `Staking::Ledger` (r:257 w:257)
/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStakersClipped` (r:1 w:0)
/// Proof: `Staking::ErasStakersClipped` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::ErasRewardPoints` (r:1 w:0)
/// Proof: `Staking::ErasRewardPoints` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::ErasValidatorPrefs` (r:1 w:0)
/// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`)
/// Storage: `Staking::Payees` (r:257 w:0)
/// Proof: `Staking::Payees` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:514 w:514)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:257 w:257)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:257 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 256]`.
fn payout_stakers_dead_controller(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `5773 + n * (151 ±0)`
// Estimated: `8579 + n * (2603 ±0)`
// Minimum execution time: 92_788_000 picoseconds.
Weight::from_parts(129_527_249, 0)
.saturating_add(Weight::from_parts(0, 8579))
// Standard Error: 73_346
.saturating_add(Weight::from_parts(33_413_624, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into()))
// Measured: `35615 + n * (408 ±0)`
// Estimated: `32897 + n * (5206 ±0)`
// Minimum execution time: 170_530_000 picoseconds.
Weight::from_parts(126_452_100, 32897)
// Standard Error: 83_193
.saturating_add(Weight::from_parts(81_128_879, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(12_u64))
.saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 5206).saturating_mul(n.into()))
}
/// Storage: Staking CurrentEra (r:1 w:0)
/// Proof: Staking CurrentEra (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Staking ErasValidatorReward (r:1 w:0)
/// Proof: Staking ErasValidatorReward (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen)
/// Storage: Staking Bonded (r:65 w:0)
/// Proof: Staking Bonded (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen)
/// Storage: Staking Ledger (r:65 w:65)
/// Proof: Staking Ledger (max_values: None, max_size: Some(1091), added: 3566, mode: MaxEncodedLen)
/// Storage: Staking ErasStakersClipped (r:1 w:0)
/// Proof Skipped: Staking ErasStakersClipped (max_values: None, max_size: None, mode: Measured)
/// Storage: Staking ErasRewardPoints (r:1 w:0)
/// Proof Skipped: Staking ErasRewardPoints (max_values: None, max_size: None, mode: Measured)
/// Storage: Staking ErasValidatorPrefs (r:1 w:0)
/// Proof: Staking ErasValidatorPrefs (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
/// Storage: Staking Payee (r:65 w:0)
/// Proof: Staking Payee (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
/// Storage: System Account (r:65 w:65)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:65 w:65)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:65 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 64]`.
/// Storage: `Staking::CurrentEra` (r:1 w:0)
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasValidatorReward` (r:1 w:0)
/// Proof: `Staking::ErasValidatorReward` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:257 w:0)
/// Proof: `Staking::Bonded` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`)
/// Storage: `Staking::Ledger` (r:257 w:257)
/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStakersClipped` (r:1 w:0)
/// Proof: `Staking::ErasStakersClipped` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::ErasRewardPoints` (r:1 w:0)
/// Proof: `Staking::ErasRewardPoints` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::ErasValidatorPrefs` (r:1 w:0)
/// Proof: `Staking::ErasValidatorPrefs` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`)
/// Storage: `Staking::Payees` (r:257 w:0)
/// Proof: `Staking::Payees` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:257 w:257)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:257 w:257)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:257 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 256]`.
fn payout_stakers_alive_staked(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `8056 + n * (396 ±0)`
// Estimated: `10634 + n * (3774 ±0)`
// Minimum execution time: 118_795_000 picoseconds.
Weight::from_parts(181_663_036, 0)
.saturating_add(Weight::from_parts(0, 10634))
// Standard Error: 132_894
.saturating_add(Weight::from_parts(51_369_596, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(11))
// Measured: `33254 + n * (415 ±0)`
// Estimated: `30909 + n * (3774 ±0)`
// Minimum execution time: 151_627_000 picoseconds.
Weight::from_parts(182_153_785, 30909)
// Standard Error: 65_276
.saturating_add(Weight::from_parts(68_254_025, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(11_u64))
.saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(T::DbWeight::get().writes(3_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 3774).saturating_mul(n.into()))
}
Expand Down Expand Up @@ -793,4 +813,4 @@ impl<T: frame_system::Config> pallet_staking::WeightInfo for WeightInfo<T> {
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
}
}
6 changes: 3 additions & 3 deletions substrate/frame/fast-unstake/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use frame_support::{
};
use sp_runtime::{
traits::{Convert, IdentityLookup},
BuildStorage,
BuildStorage, Perbill,
};

use pallet_staking::{Exposure, IndividualExposure, StakerStatus};
Expand Down Expand Up @@ -337,7 +337,7 @@ pub(crate) fn next_block(on_idle: bool) {

pub fn assert_unstaked(stash: &AccountId) {
assert!(!pallet_staking::Bonded::<T>::contains_key(stash));
assert!(!pallet_staking::Payee::<T>::contains_key(stash));
assert!(!pallet_staking::DeprecatedPayee::<T>::contains_key(stash));
assert!(!pallet_staking::Validators::<T>::contains_key(stash));
assert!(!pallet_staking::Nominators::<T>::contains_key(stash));
}
Expand All @@ -351,7 +351,7 @@ pub fn create_exposed_nominator(exposed: AccountId, era: u32) {
assert_ok!(Staking::bond(
RuntimeOrigin::signed(exposed),
10,
pallet_staking::RewardDestination::Staked
pallet_staking::PayoutDestination::Split((Perbill::from_percent(50), exposed))
));
assert_ok!(Staking::nominate(RuntimeOrigin::signed(exposed), vec![exposed]));
// register the exposed one.
Expand Down
10 changes: 7 additions & 3 deletions substrate/frame/fast-unstake/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
use super::*;
use crate::{mock::*, types::*, Event};
use frame_support::{pallet_prelude::*, testing_prelude::*, traits::Currency};
use pallet_staking::{CurrentEra, RewardDestination};
use pallet_staking::{CurrentEra, PayoutDestination};

use sp_runtime::traits::BadOrigin;
use sp_runtime::{traits::BadOrigin, Perbill};
use sp_staking::StakingInterface;

#[test]
Expand Down Expand Up @@ -815,7 +815,11 @@ mod on_idle {

// create a new validator that 100% not exposed.
Balances::make_free_balance_be(&42, 100 + Deposit::get());
assert_ok!(Staking::bond(RuntimeOrigin::signed(42), 10, RewardDestination::Staked));
assert_ok!(Staking::bond(
RuntimeOrigin::signed(42),
10,
PayoutDestination::Split((Perbill::from_percent(50), 42))
));
assert_ok!(Staking::validate(RuntimeOrigin::signed(42), Default::default()));

// let them register:
Expand Down
9 changes: 7 additions & 2 deletions substrate/frame/nomination-pools/test-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use pallet_nomination_pools::{
BondedPools, Error as PoolsError, Event as PoolsEvent, LastPoolId, PoolMember, PoolMembers,
PoolState,
};
use pallet_staking::{CurrentEra, Event as StakingEvent, Payee, RewardDestination};
use pallet_staking::{
CheckedPayoutDestination, CurrentEra, Event as StakingEvent, Payees, PayoutDestination,
};
use sp_runtime::{bounded_btree_map, traits::Zero};

#[test]
Expand Down Expand Up @@ -214,7 +216,10 @@ fn pool_slash_e2e() {
]
);

assert_eq!(Payee::<Runtime>::get(POOL1_BONDED), RewardDestination::Account(POOL1_REWARD));
assert_eq!(
Payees::<Runtime>::get(POOL1_BONDED),
CheckedPayoutDestination(PayoutDestination::Deposit(POOL1_REWARD))
);

// have two members join
assert_ok!(Pools::join(RuntimeOrigin::signed(20), 20, 1));
Expand Down
8 changes: 4 additions & 4 deletions substrate/frame/offences/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use pallet_session::{
use pallet_staking::Event as StakingEvent;
use pallet_staking::{
Config as StakingConfig, Exposure, IndividualExposure, MaxNominationsOf, Pallet as Staking,
RewardDestination, ValidatorPrefs,
PayoutDestination, ValidatorPrefs,
};

const SEED: u32 = 0;
Expand Down Expand Up @@ -108,15 +108,15 @@ fn bond_amount<T: Config>() -> BalanceOf<T> {
fn create_offender<T: Config>(n: u32, nominators: u32) -> Result<Offender<T>, &'static str> {
let stash: T::AccountId = account("stash", n, SEED);
let stash_lookup: LookupSourceOf<T> = T::Lookup::unlookup(stash.clone());
let reward_destination = RewardDestination::Staked;
let payout_destination = PayoutDestination::Stake;
let amount = bond_amount::<T>();
// add twice as much balance to prevent the account from being killed.
let free_amount = amount.saturating_mul(2u32.into());
T::Currency::make_free_balance_be(&stash, free_amount);
Staking::<T>::bond(
RawOrigin::Signed(stash.clone()).into(),
amount,
reward_destination.clone(),
payout_destination.clone(),
)?;

let validator_prefs =
Expand All @@ -134,7 +134,7 @@ fn create_offender<T: Config>(n: u32, nominators: u32) -> Result<Offender<T>, &'
Staking::<T>::bond(
RawOrigin::Signed(nominator_stash.clone()).into(),
amount,
reward_destination.clone(),
payout_destination.clone(),
)?;

let selected_validators: Vec<LookupSourceOf<T>> = vec![stash_lookup.clone()];
Expand Down
3 changes: 3 additions & 0 deletions substrate/frame/session/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ scale-info = "2.1.1"
frame-election-provider-support = { path = "../../election-provider-support" }
pallet-balances = { path = "../../balances" }
pallet-staking-reward-curve = { path = "../../staking/reward-curve" }
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking", features = ["serde"] }
pallet-timestamp = { path = "../../timestamp" }
sp-core = { path = "../../../primitives/core" }
sp-io = { path = "../../../primitives/io" }
Expand All @@ -50,6 +51,7 @@ std = [
"sp-io/std",
"sp-runtime/std",
"sp-session/std",
"sp-staking/std",
"sp-std/std",
]

Expand All @@ -62,4 +64,5 @@ runtime-benchmarks = [
"pallet-staking/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
]
8 changes: 4 additions & 4 deletions substrate/frame/session/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

mod mock;

use codec::Decode;
use sp_runtime::traits::{One, StaticLookup, TrailingZeroInput};
use sp_std::{prelude::*, vec};

use codec::Decode;
use frame_benchmarking::v1::benchmarks;
use frame_support::traits::{Get, KeyOwnerProofSystem, OnInitialize};
use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin};
use pallet_session::{historical::Pallet as Historical, Pallet as Session, *};
use pallet_staking::{
benchmarking::create_validator_with_nominators, testing_utils::create_validators,
MaxNominationsOf, RewardDestination,
MaxNominationsOf, PayoutDestination, PayoutRoute,
};

const MAX_VALIDATORS: u32 = 1000;
Expand All @@ -58,7 +58,7 @@ benchmarks! {
MaxNominationsOf::<T>::get(),
false,
true,
RewardDestination::Staked,
PayoutRoute::Direct(PayoutDestination::Stake),
)?;
let v_controller = pallet_staking::Pallet::<T>::bonded(&v_stash).ok_or("not stash")?;

Expand All @@ -76,7 +76,7 @@ benchmarks! {
MaxNominationsOf::<T>::get(),
false,
true,
RewardDestination::Staked,
PayoutRoute::Direct(PayoutDestination::Stake),
)?;
let v_controller = pallet_staking::Pallet::<T>::bonded(&v_stash).ok_or("not stash")?;
let keys = T::Keys::decode(&mut TrailingZeroInput::zeroes()).unwrap();
Expand Down
20 changes: 20 additions & 0 deletions substrate/frame/staking/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

All notable changes to this pallet will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this pallet
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

The semantic versioning guarantees cover the interface to the Substrate runtime which includes this
pallet as a dependency. This module will also add storage migrations whenever changes require it.
Stability with regard to offchain tooling is explicitly excluded from this guarantee: For example
adding a new field to an in-storage data structure will require changes to frontends to properly
display it. However, those changes will still be regarded as a minor version bump.

## [Unreleased]

### Added

- Introduce `Payees` and `PayoutDestination` with `Split` variant, which starts a lazy migration to
move existing `Payee` items to a new `Payees` storage item.
[#14451](https://github.com/paritytech/substrate/pull/14451)
Loading