Staking Payout Creates Controller (#6496)

* payout creates controller

* update benchmarks

* oops

* fix session benchmarks

* Update weights

* fix line width
This commit is contained in:
Shawn Tabrizi
2020-06-25 11:27:37 +02:00
committed by GitHub
parent 2cbefce35b
commit 95ad2d1001
5 changed files with 81 additions and 8 deletions
+5 -3
View File
@@ -1978,7 +1978,9 @@ decl_module! {
/// - Contains a limited number of reads and writes.
/// -----------
/// N is the Number of payouts for the validator (including the validator)
/// Base Weight: 110 + 54.2 * N µs (Median Slopes)
/// Base Weight:
/// - Reward Destination Staked: 110 + 54.2 * N µs (Median Slopes)
/// - Reward Destination Controller (Creating): 120 + 41.95 * N µs (Median Slopes)
/// DB Weight:
/// - Read: EraElectionStatus, CurrentEra, HistoryDepth, ErasValidatorReward,
/// ErasStakersClipped, ErasRewardPoints, ErasValidatorPrefs (8 items)
@@ -1986,7 +1988,7 @@ decl_module! {
/// - Write Each: System Account, Locks, Ledger (3 items)
/// # </weight>
#[weight =
110 * WEIGHT_PER_MICROS
120 * WEIGHT_PER_MICROS
+ 54 * WEIGHT_PER_MICROS * Weight::from(T::MaxNominatorRewardedPerValidator::get())
+ T::DbWeight::get().reads(7)
+ T::DbWeight::get().reads(5) * Weight::from(T::MaxNominatorRewardedPerValidator::get() + 1)
@@ -2395,7 +2397,7 @@ impl<T: Trait> Module<T> {
match dest {
RewardDestination::Controller => Self::bonded(stash)
.and_then(|controller|
T::Currency::deposit_into_existing(&controller, amount).ok()
Some(T::Currency::deposit_creating(&controller, amount))
),
RewardDestination::Stash =>
T::Currency::deposit_into_existing(stash, amount).ok(),