Pools: Add ability to configure commission claiming permissions (#2474)

Addresses #409.

This request has been raised by multiple community members - the ability
for the nomination pool root role to configure permissionless commission
claiming:

> Would it be possible to have a claim_commission_other extrinsic for
claiming commission of nomination pools permissionless?

This PR does not quite introduce this additional call, but amends
`do_claim_commission` to check a new `claim_permission` field in the
`Commission` struct, configured by an enum:

```
enum CommissionClaimPermission {
   Permissionless,
   Account(AccountId),
}
```
This can be optionally set in a bonded pool's
`commission.claim_permission` field:

```
struct BondedPool {
   commission: {
      <snip>
      claim_permission: Option<CommissionClaimPermission<T::AccountId>>,
   },
   <snip>
}
```

This is a new field and requires a migration to add it to existing
pools. This will be `None` on pool creation, falling back to the `root`
role having sole access to claim commission if it is not set; this is
the behaviour as it is today. Once set, the field _can_ be set to `None`
again.

#### Changes
- [x] Add `commision.claim_permission` field.
- [x] Add `can_claim_commission` and amend `do_claim_commission`.
- [x] Add `set_commission_claim_permission` call.
- [x] Test to cover new configs and call.
- [x] Add and amend benchmarks.
- [x] Generate new weights + slot into call
`set_commission_claim_permission`.
- [x] Add migration to introduce `commission.claim_permission`, bump
storage version.
- [x] Update Westend weights.
- [x] Migration working.

---------

Co-authored-by: command-bot <>
This commit is contained in:
Ross Bulat
2023-11-28 14:19:49 +07:00
committed by GitHub
parent 2ac23d247d
commit 75062717de
7 changed files with 796 additions and 393 deletions
+1 -2
View File
@@ -1533,11 +1533,10 @@ pub mod migrations {
parachains_configuration::migration::v8::MigrateToV8<Runtime>,
parachains_configuration::migration::v9::MigrateToV9<Runtime>,
paras_registrar::migration::MigrateToV1<Runtime, ()>,
pallet_nomination_pools::migration::versioned::V5toV6<Runtime>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, ()>,
pallet_nomination_pools::migration::versioned::V6ToV7<Runtime>,
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
pallet_nomination_pools::migration::versioned::V7ToV8<Runtime>,
);
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_nomination_pools`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-nbnwcyh-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-yprdrvc7-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024
// Executed Command:
@@ -53,7 +53,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// 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:1)
@@ -78,20 +78,22 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `VoterList::ListNodes` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `MaxEncodedLen`)
/// Storage: `VoterList::ListBags` (r:2 w:2)
/// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn join() -> Weight {
// Proof Size summary in bytes:
// Measured: `3318`
// Measured: `3355`
// Estimated: `8877`
// Minimum execution time: 187_795_000 picoseconds.
Weight::from_parts(193_857_000, 0)
// Minimum execution time: 173_707_000 picoseconds.
Weight::from_parts(179_920_000, 0)
.saturating_add(Weight::from_parts(0, 8877))
.saturating_add(T::DbWeight::get().reads(19))
.saturating_add(T::DbWeight::get().writes(12))
.saturating_add(T::DbWeight::get().reads(20))
.saturating_add(T::DbWeight::get().writes(13))
}
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
@@ -110,22 +112,24 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `VoterList::ListNodes` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `MaxEncodedLen`)
/// Storage: `VoterList::ListBags` (r:2 w:2)
/// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn bond_extra_transfer() -> Weight {
// Proof Size summary in bytes:
// Measured: `3328`
// Measured: `3365`
// Estimated: `8877`
// Minimum execution time: 186_245_000 picoseconds.
Weight::from_parts(190_916_000, 0)
// Minimum execution time: 174_414_000 picoseconds.
Weight::from_parts(178_068_000, 0)
.saturating_add(Weight::from_parts(0, 8877))
.saturating_add(T::DbWeight::get().reads(16))
.saturating_add(T::DbWeight::get().writes(12))
.saturating_add(T::DbWeight::get().reads(17))
.saturating_add(T::DbWeight::get().writes(13))
}
/// Storage: `NominationPools::ClaimPermissions` (r:1 w:0)
/// Proof: `NominationPools::ClaimPermissions` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
@@ -144,22 +148,24 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `VoterList::ListNodes` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `MaxEncodedLen`)
/// Storage: `VoterList::ListBags` (r:2 w:2)
/// Proof: `VoterList::ListBags` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn bond_extra_other() -> Weight {
// Proof Size summary in bytes:
// Measured: `3274`
// Measured: `3312`
// Estimated: `8799`
// Minimum execution time: 217_918_000 picoseconds.
Weight::from_parts(224_772_000, 0)
// Minimum execution time: 198_864_000 picoseconds.
Weight::from_parts(203_783_000, 0)
.saturating_add(Weight::from_parts(0, 8799))
.saturating_add(T::DbWeight::get().reads(16))
.saturating_add(T::DbWeight::get().writes(12))
.saturating_add(T::DbWeight::get().reads(17))
.saturating_add(T::DbWeight::get().writes(13))
}
/// Storage: `NominationPools::ClaimPermissions` (r:1 w:0)
/// Proof: `NominationPools::ClaimPermissions` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
@@ -168,10 +174,10 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn claim_payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `1137`
// Measured: `1138`
// Estimated: `4182`
// Minimum execution time: 76_958_000 picoseconds.
Weight::from_parts(78_278_000, 0)
// Minimum execution time: 70_250_000 picoseconds.
Weight::from_parts(72_231_000, 0)
.saturating_add(Weight::from_parts(0, 4182))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
@@ -179,7 +185,7 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:1 w:0)
@@ -210,16 +216,16 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `NominationPools::CounterForSubPoolsStorage` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn unbond() -> Weight {
// Proof Size summary in bytes:
// Measured: `3597`
// Measured: `3545`
// Estimated: `8877`
// Minimum execution time: 170_992_000 picoseconds.
Weight::from_parts(179_987_000, 0)
// Minimum execution time: 155_853_000 picoseconds.
Weight::from_parts(161_032_000, 0)
.saturating_add(Weight::from_parts(0, 8877))
.saturating_add(T::DbWeight::get().reads(20))
.saturating_add(T::DbWeight::get().writes(13))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// 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:1)
@@ -230,25 +236,27 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 100]`.
fn pool_withdraw_unbonded(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `1670`
// Measured: `1744`
// Estimated: `4764`
// Minimum execution time: 60_740_000 picoseconds.
Weight::from_parts(64_502_831, 0)
// Minimum execution time: 62_933_000 picoseconds.
Weight::from_parts(65_847_171, 0)
.saturating_add(Weight::from_parts(0, 4764))
// Standard Error: 2_724
.saturating_add(Weight::from_parts(37_725, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Standard Error: 1_476
.saturating_add(Weight::from_parts(59_648, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `Staking::CurrentEra` (r:1 w:0)
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::SubPoolsStorage` (r:1 w:1)
/// Proof: `NominationPools::SubPoolsStorage` (`max_values`: None, `max_size`: Some(261), added: 2736, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:1 w:0)
@@ -261,6 +269,8 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::CounterForPoolMembers` (r:1 w:1)
/// Proof: `NominationPools::CounterForPoolMembers` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::ClaimPermissions` (r:0 w:1)
@@ -268,22 +278,22 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// The range of component `s` is `[0, 100]`.
fn withdraw_unbonded_update(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `2098`
// Measured: `2134`
// Estimated: `4764`
// Minimum execution time: 127_322_000 picoseconds.
Weight::from_parts(132_064_603, 0)
// Minimum execution time: 123_641_000 picoseconds.
Weight::from_parts(127_222_589, 0)
.saturating_add(Weight::from_parts(0, 4764))
// Standard Error: 3_424
.saturating_add(Weight::from_parts(64_590, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(8))
// Standard Error: 2_493
.saturating_add(Weight::from_parts(83_361, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(9))
}
/// Storage: `NominationPools::PoolMembers` (r:1 w:1)
/// Proof: `NominationPools::PoolMembers` (`max_values`: None, `max_size`: Some(717), added: 3192, mode: `MaxEncodedLen`)
/// Storage: `Staking::CurrentEra` (r:1 w:0)
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::SubPoolsStorage` (r:1 w:1)
/// Proof: `NominationPools::SubPoolsStorage` (`max_values`: None, `max_size`: Some(261), added: 2736, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:1 w:1)
@@ -292,16 +302,18 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
/// Storage: `Staking::SlashingSpans` (r:1 w:0)
/// Proof: `Staking::SlashingSpans` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::Validators` (r:1 w:0)
/// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)
/// Storage: `Staking::Nominators` (r:1 w:0)
/// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:2 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:2 w:1)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Staking::Validators` (r:1 w:0)
/// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)
/// Storage: `Staking::Nominators` (r:1 w:0)
/// Proof: `Staking::Nominators` (`max_values`: None, `max_size`: Some(558), added: 3033, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::CounterForPoolMembers` (r:1 w:1)
/// Proof: `NominationPools::CounterForPoolMembers` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::ReversePoolIdLookup` (r:1 w:1)
@@ -323,17 +335,15 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Storage: `NominationPools::ClaimPermissions` (r:0 w:1)
/// Proof: `NominationPools::ClaimPermissions` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 100]`.
fn withdraw_unbonded_kill(s: u32, ) -> Weight {
fn withdraw_unbonded_kill(_s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `2454`
// Measured: `2453`
// Estimated: `8538`
// Minimum execution time: 236_510_000 picoseconds.
Weight::from_parts(243_943_334, 0)
// Minimum execution time: 219_469_000 picoseconds.
Weight::from_parts(227_526_000, 0)
.saturating_add(Weight::from_parts(0, 8538))
// Standard Error: 4_864
.saturating_add(Weight::from_parts(14_974, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(23))
.saturating_add(T::DbWeight::get().writes(19))
.saturating_add(T::DbWeight::get().reads(24))
.saturating_add(T::DbWeight::get().writes(20))
}
/// Storage: `NominationPools::LastPoolId` (r:1 w:1)
/// Proof: `NominationPools::LastPoolId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
@@ -359,14 +369,12 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Staking::Bonded` (r:1 w:1)
/// 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::CurrentEra` (r:1 w:0)
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:2 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:2 w:1)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::TotalValueLocked` (r:1 w:1)
/// Proof: `NominationPools::TotalValueLocked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::CounterForRewardPools` (r:1 w:1)
@@ -376,21 +384,23 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Storage: `NominationPools::CounterForReversePoolIdLookup` (r:1 w:1)
/// Proof: `NominationPools::CounterForReversePoolIdLookup` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `Staking::Ledger` (r:0 w:1)
/// 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`)
fn create() -> Weight {
// Proof Size summary in bytes:
// Measured: `1222`
// Measured: `1102`
// Estimated: `8538`
// Minimum execution time: 197_883_000 picoseconds.
Weight::from_parts(201_750_000, 0)
// Minimum execution time: 166_466_000 picoseconds.
Weight::from_parts(171_425_000, 0)
.saturating_add(Weight::from_parts(0, 8538))
.saturating_add(T::DbWeight::get().reads(24))
.saturating_add(T::DbWeight::get().writes(16))
.saturating_add(T::DbWeight::get().reads(23))
.saturating_add(T::DbWeight::get().writes(17))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// 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)
@@ -416,36 +426,36 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// The range of component `n` is `[1, 16]`.
fn nominate(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `1779`
// Measured: `1738`
// Estimated: `4556 + n * (2520 ±0)`
// Minimum execution time: 65_505_000 picoseconds.
Weight::from_parts(67_148_657, 0)
// Minimum execution time: 59_650_000 picoseconds.
Weight::from_parts(60_620_077, 0)
.saturating_add(Weight::from_parts(0, 4556))
// Standard Error: 9_115
.saturating_add(Weight::from_parts(1_421_198, 0).saturating_mul(n.into()))
// Standard Error: 7_316
.saturating_add(Weight::from_parts(1_467_406, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(12))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes(5))
.saturating_add(Weight::from_parts(0, 2520).saturating_mul(n.into()))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// 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`)
fn set_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `1367`
// Measured: `1363`
// Estimated: `4556`
// Minimum execution time: 34_157_000 picoseconds.
Weight::from_parts(35_557_000, 0)
// Minimum execution time: 31_170_000 picoseconds.
Weight::from_parts(32_217_000, 0)
.saturating_add(Weight::from_parts(0, 4556))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::Metadata` (r:1 w:1)
/// Proof: `NominationPools::Metadata` (`max_values`: None, `max_size`: Some(270), added: 2745, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::CounterForMetadata` (r:1 w:1)
@@ -453,13 +463,13 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// The range of component `n` is `[1, 256]`.
fn set_metadata(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `497`
// Measured: `498`
// Estimated: `3735`
// Minimum execution time: 13_806_000 picoseconds.
Weight::from_parts(14_540_018, 0)
// Minimum execution time: 12_603_000 picoseconds.
Weight::from_parts(13_241_702, 0)
.saturating_add(Weight::from_parts(0, 3735))
// Standard Error: 123
.saturating_add(Weight::from_parts(644, 0).saturating_mul(n.into()))
// Standard Error: 116
.saturating_add(Weight::from_parts(1_428, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
@@ -479,25 +489,25 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_870_000 picoseconds.
Weight::from_parts(6_253_000, 0)
// Minimum execution time: 3_608_000 picoseconds.
Weight::from_parts(3_801_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
fn update_roles() -> Weight {
// Proof Size summary in bytes:
// Measured: `497`
// Estimated: `3685`
// Minimum execution time: 18_290_000 picoseconds.
Weight::from_parts(18_961_000, 0)
.saturating_add(Weight::from_parts(0, 3685))
// Measured: `498`
// Estimated: `3719`
// Minimum execution time: 16_053_000 picoseconds.
Weight::from_parts(16_473_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// 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)
@@ -516,16 +526,16 @@ impl<T: frame_system::Config> pallet_nomination_pools::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: `1942`
// Measured: `1901`
// Estimated: `4556`
// Minimum execution time: 63_708_000 picoseconds.
Weight::from_parts(65_570_000, 0)
// Minimum execution time: 57_251_000 picoseconds.
Weight::from_parts(59_390_000, 0)
.saturating_add(Weight::from_parts(0, 4556))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
@@ -534,37 +544,49 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn set_commission() -> Weight {
// Proof Size summary in bytes:
// Measured: `736`
// Estimated: `3685`
// Minimum execution time: 34_291_000 picoseconds.
Weight::from_parts(34_767_000, 0)
.saturating_add(Weight::from_parts(0, 3685))
// Measured: `770`
// Estimated: `3719`
// Minimum execution time: 29_888_000 picoseconds.
Weight::from_parts(31_056_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
/// Proof: `NominationPools::GlobalMaxCommission` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn set_commission_max() -> Weight {
// Proof Size summary in bytes:
// Measured: `537`
// Estimated: `3685`
// Minimum execution time: 18_406_000 picoseconds.
Weight::from_parts(18_999_000, 0)
.saturating_add(Weight::from_parts(0, 3685))
// Measured: `538`
// Estimated: `3719`
// Minimum execution time: 15_769_000 picoseconds.
Weight::from_parts(16_579_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
fn set_commission_change_rate() -> Weight {
// Proof Size summary in bytes:
// Measured: `497`
// Estimated: `3685`
// Minimum execution time: 18_440_000 picoseconds.
Weight::from_parts(19_230_000, 0)
.saturating_add(Weight::from_parts(0, 3685))
// Measured: `498`
// Estimated: `3719`
// Minimum execution time: 15_385_000 picoseconds.
Weight::from_parts(16_402_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:1)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
fn set_commission_claim_permission() -> Weight {
// Proof Size summary in bytes:
// Measured: `498`
// Estimated: `3719`
// Minimum execution time: 14_965_000 picoseconds.
Weight::from_parts(15_548_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -576,14 +598,14 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
// Proof Size summary in bytes:
// Measured: `508`
// Estimated: `4182`
// Minimum execution time: 14_310_000 picoseconds.
Weight::from_parts(14_681_000, 0)
// Minimum execution time: 13_549_000 picoseconds.
Weight::from_parts(14_307_000, 0)
.saturating_add(Weight::from_parts(0, 4182))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::RewardPools` (r:1 w:1)
/// Proof: `NominationPools::RewardPools` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `NominationPools::GlobalMaxCommission` (r:1 w:0)
@@ -592,16 +614,16 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn claim_commission() -> Weight {
// Proof Size summary in bytes:
// Measured: `934`
// Estimated: `3685`
// Minimum execution time: 64_526_000 picoseconds.
Weight::from_parts(66_800_000, 0)
.saturating_add(Weight::from_parts(0, 3685))
// Measured: `968`
// Estimated: `3719`
// Minimum execution time: 60_153_000 picoseconds.
Weight::from_parts(61_369_000, 0)
.saturating_add(Weight::from_parts(0, 3719))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `NominationPools::BondedPools` (r:1 w:0)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`)
/// Proof: `NominationPools::BondedPools` (`max_values`: None, `max_size`: Some(254), added: 2729, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:1)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
@@ -610,10 +632,10 @@ impl<T: frame_system::Config> pallet_nomination_pools::WeightInfo for WeightInfo
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
fn adjust_pool_deposit() -> Weight {
// Proof Size summary in bytes:
// Measured: `866`
// Measured: `867`
// Estimated: `4764`
// Minimum execution time: 73_472_000 picoseconds.
Weight::from_parts(74_698_000, 0)
// Minimum execution time: 64_985_000 picoseconds.
Weight::from_parts(66_616_000, 0)
.saturating_add(Weight::from_parts(0, 4764))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))