Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

update_roles for nomination pools #11373

Merged
merged 12 commits into from
May 10, 2022

Conversation

kianenigma
Copy link
Contributor

@kianenigma kianenigma commented May 6, 2022

  • add the missing update_roles transaction
  • add some tests about automatic reward claims per-unbond call.
  • fix some docs and namings.

polkadot companion: paritytech/polkadot#5488

@github-actions github-actions bot added the A3-in_progress Pull request is in progress. No review needed at this stage. label May 6, 2022
@kianenigma kianenigma marked this pull request as ready for review May 9, 2022 19:55
@github-actions github-actions bot added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels May 9, 2022
@kianenigma kianenigma added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels May 9, 2022
@kianenigma
Copy link
Contributor Author

/benchmark runtime pallet pallet-nomination-pools

@parity-benchapp
Copy link

parity-benchapp bot commented May 9, 2022

Benchmark Runtime Pallet for branch "kiz-fix-unbond-reward-payout" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet-nomination-pools --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame//src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
error[E0658]: default values for const generic parameters are experimental
   --> frame/contracts/src/lib.rs:203:75
    |
203 | pub struct DefaultContractAccessWeight<B: Get<BlockWeights>, const P: u32 = 5_242_880>(
    |                                                                           ^^^^^^^^^^^
    |
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `pallet-contracts` due to previous error
error: build failed

ERROR: Unable to commit file ./frame//src/weights.rs

@kianenigma
Copy link
Contributor Author

/benchmark runtime pallet pallet-nomination-pools

@parity-benchapp
Copy link

parity-benchapp bot commented May 9, 2022

Benchmark Runtime Pallet for branch "kiz-fix-unbond-reward-payout" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet-nomination-pools --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame//src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
error[E0658]: default values for const generic parameters are experimental
   --> frame/contracts/src/lib.rs:203:75
    |
203 | pub struct DefaultContractAccessWeight<B: Get<BlockWeights>, const P: u32 = 5_242_880>(
    |                                                                           ^^^^^^^^^^^
    |
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `pallet-contracts` due to previous error
error: build failed

ERROR: Unable to commit file ./frame//src/weights.rs

@kianenigma
Copy link
Contributor Author

kianenigma commented May 9, 2022

@athei do you know why this is failing? #11373 (comment)

update: seems rust-verison related.

@athei
Copy link
Member

athei commented May 9, 2022

@athei do you know why this is failing? #11373 (comment)

update: seems rust-verison related.

Yes. Rust versions needs to be updated.

@shawntabrizi
Copy link
Member

/benchmark runtime pallet pallet-nomination-pools

@parity-benchapp
Copy link

parity-benchapp bot commented May 9, 2022

Benchmark Runtime Pallet for branch "kiz-fix-unbond-reward-payout" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet-nomination-pools --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame//src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.60.0 (7737e0b5c 2022-04-04)

Results
2022-05-09 21:54:09 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-05-09 21:54:15 Running Benchmark: pallet_nomination_pools.withdraw_unbonded_kill 39/50 1/1    
Error: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })

ERROR: Unable to commit file ./frame//src/weights.rs

Comment on lines 1855 to 1857
let who = ensure_signed(origin)?;
let mut bonded_pool = BondedPool::<T>::get(pool_id).ok_or(Error::<T>::PoolNotFound)?;
ensure!(bonded_pool.roles.root == who, Error::<T>::DoesNotHavePermission);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can forsee it being useful, could also make this callable by ROOT origin too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, yeah I think it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggwpez
Copy link
Member

ggwpez commented May 10, 2022

/bench runtime pallet pallet_nomination_pools

Somehow it uses the wrong output path: --output=./frame//src/weights.rs. instead of --output=./frame/pallet_nomination_pools/src/weights.rs.
Lets try with underscores.

@KiChjang
Copy link
Contributor

/benchmark runtime pallet pallet_nomination_pools

@parity-benchapp
Copy link

parity-benchapp bot commented May 10, 2022

Benchmark Runtime Pallet for branch "kiz-fix-unbond-reward-payout" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools

Somehow it uses the wrong output path: --output=./frame//src/weights.rs. instead of --output=./frame/pallet_nomination_pools/src/weights.rs.
Lets try with underscores. --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools

Somehow it uses the wrong output path: --output=./frame//src/weights.rs. instead of --output=./frame/pallet-nomination-pools/src/weights.rs.
Lets try with underscores./src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.60.0 (7737e0b5c 2022-04-04)

Results
error: The following required arguments were not provided:
    --extrinsic <EXTRINSIC>

USAGE:
    substrate benchmark pallet --chain <CHAIN_SPEC> --steps <STEPS> --repeat <REPEAT> --pallet <PALLET> --extrinsic <EXTRINSIC>

For more information try --help
/bin/sh: 2: 
: not found
/bin/sh: 1: --output=./frame//src/weights.rs: not found
/bin/sh: 1: --output=./frame/pallet_nomination_pools/src/weights.rs: not found
/bin/sh: 3: Somehow: not found
/bin/sh: 4: Lets: not found
/bin/sh: 5: 
: not found
/bin/sh: 1: --output=./frame//src/weights.rs: not found
/bin/sh: 1: --output=./frame/pallet-nomination-pools/src/weights.rs: not found
/bin/sh: 6: Somehow: not found
/bin/sh: 7: Lets: not found

ERROR: Unable to commit file ./frame//src/weights.rs`.

@parity-benchapp
Copy link

parity-benchapp bot commented May 10, 2022

Benchmark Runtime Pallet for branch "kiz-fix-unbond-reward-payout" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.60.0 (7737e0b5c 2022-04-04)

Results
Pallet: "pallet_nomination_pools", Extrinsic: "join", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools MinJoinBond (r:1 w:0)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: Staking Ledger (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:0)
Storage: System Account (r:2 w:1)
Storage: NominationPools MaxPoolMembersPerPool (r:1 w:0)
Storage: NominationPools MaxPoolMembers (r:1 w:0)
Storage: NominationPools CounterForPoolMembers (r:1 w:1)
Storage: Staking Bonded (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: BagsList ListNodes (r:3 w:3)
Storage: BagsList ListBags (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    119.2
              µs

Reads = 18
Writes = 12

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    119.2
              µs

Reads = 18
Writes = 12

Pallet: "pallet_nomination_pools", Extrinsic: "bond_extra_transfer", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: System Account (r:2 w:2)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Bonded (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: BagsList ListNodes (r:3 w:3)
Storage: BagsList ListBags (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    110.1
              µs

Reads = 14
Writes = 13

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    110.1
              µs

Reads = 14
Writes = 13

Pallet: "pallet_nomination_pools", Extrinsic: "bond_extra_reward", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: System Account (r:3 w:3)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Bonded (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      124
              µs

Reads = 14
Writes = 13

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=      124
              µs

Reads = 14
Writes = 13

Pallet: "pallet_nomination_pools", Extrinsic: "claim_payout", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    51.76
              µs

Reads = 5
Writes = 5

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    51.76
              µs

Reads = 5
Writes = 5

Pallet: "pallet_nomination_pools", Extrinsic: "unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: System Account (r:2 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Nominators (r:1 w:0)
Storage: Staking MinNominatorBond (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: BagsList ListNodes (r:3 w:3)
Storage: Staking Bonded (r:1 w:0)
Storage: BagsList ListBags (r:2 w:2)
Storage: NominationPools SubPoolsStorage (r:1 w:1)
Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    116.9
              µs

Reads = 19
Writes = 14

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    116.9
              µs

Reads = 19
Writes = 14

Pallet: "pallet_nomination_pools", Extrinsic: "pool_withdraw_unbonded", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:0)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Balances Locks (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.12
    + s    0.051
              µs

Reads = 5 + (0 * s)
Writes = 3 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    0     40.41     0.189    0.4%
    2     41.88     0.083    0.1%
    4      41.1     0.124    0.3%
    6     41.41     0.137    0.3%
    8     41.42      0.12    0.2%
   10     41.45     0.166    0.4%
   12      41.4     0.147    0.3%
   14     41.59     0.222    0.5%
   16      41.6     0.139    0.3%
   18     42.07     0.097    0.2%
   20     42.23     0.109    0.2%
   22     41.83     0.165    0.3%
   24     42.24      0.18    0.4%
   26     42.63     0.183    0.4%
   28     42.18     0.128    0.3%
   30     42.62     0.189    0.4%
   32     43.26     0.201    0.4%
   34     42.81     0.111    0.2%
   36     43.02     0.148    0.3%
   38     43.08     0.178    0.4%
   40     42.77     0.084    0.1%
   42      43.8     0.107    0.2%
   44     43.28     0.269    0.6%
   46     43.99     0.163    0.3%
   48     43.87     0.214    0.4%
   50     44.21     0.151    0.3%
   52     43.81     0.106    0.2%
   54     44.18     0.272    0.6%
   56     44.58     0.112    0.2%
   58     44.49     0.263    0.5%
   60      44.6     0.235    0.5%
   62     44.83     0.106    0.2%
   64     44.63     0.131    0.2%
   66     44.93     0.157    0.3%
   68     45.61     0.221    0.4%
   70     45.01     0.189    0.4%
   72     44.59     0.129    0.2%
   74     44.84     0.127    0.2%
   76     44.59     0.214    0.4%
   78     44.33     0.109    0.2%
   80      45.2     0.251    0.5%
   82     45.22     0.239    0.5%
   84     45.06     0.164    0.3%
   86     45.25     0.152    0.3%
   88      45.6      0.29    0.6%
   90      45.8       0.5    1.0%
   92     45.62     0.174    0.3%
   94        46     0.242    0.5%
   96     45.91     0.183    0.3%
   98     46.32     0.155    0.3%
  100     45.57     0.194    0.4%

Quality and confidence:
param     error
s             0

Model:
Time ~=    41.12
    + s    0.052
              µs

Reads = 5 + (0 * s)
Writes = 3 + (0 * s)

Pallet: "pallet_nomination_pools", Extrinsic: "withdraw_unbonded_update", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools SubPoolsStorage (r:1 w:1)
Storage: Staking Ledger (r:1 w:1)
Storage: Balances Locks (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: NominationPools CounterForPoolMembers (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    80.66
    + s    0.049
              µs

Reads = 9 + (0 * s)
Writes = 8 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    0     79.95      0.14    0.1%
    2     81.22     0.173    0.2%
    4     80.94     0.669    0.8%
    6     80.77     0.236    0.2%
    8     80.94     0.178    0.2%
   10     80.88     0.223    0.2%
   12      80.8      0.34    0.4%
   14     81.07     0.254    0.3%
   16     81.04     0.146    0.1%
   18     81.47     0.152    0.1%
   20     81.69     0.238    0.2%
   22     81.03     0.219    0.2%
   24        82     0.327    0.3%
   26     82.18     0.227    0.2%
   28     81.49     0.184    0.2%
   30      82.1     0.189    0.2%
   32     82.55     0.292    0.3%
   34     82.39     0.168    0.2%
   36     82.68     0.187    0.2%
   38      82.7     0.246    0.2%
   40     82.36     0.369    0.4%
   42     83.23     0.211    0.2%
   44     82.71     0.137    0.1%
   46     83.64     0.216    0.2%
   48     83.85     0.399    0.4%
   50     83.86     0.216    0.2%
   52     83.46     0.175    0.2%
   54     83.26     0.152    0.1%
   56     83.82     0.331    0.3%
   58     83.94     0.125    0.1%
   60     83.98     0.231    0.2%
   62     84.03     0.191    0.2%
   64     83.92     0.315    0.3%
   66      83.9     0.154    0.1%
   68     84.47     0.121    0.1%
   70     83.75     0.255    0.3%
   72     84.14     0.165    0.1%
   74      84.9     0.366    0.4%
   76     84.17     0.097    0.1%
   78     84.06     0.208    0.2%
   80     84.64     0.127    0.1%
   82      85.3     0.621    0.7%
   84      84.5     0.177    0.2%
   86     85.19     0.161    0.1%
   88     85.03     0.177    0.2%
   90     84.91     0.288    0.3%
   92      84.6     0.371    0.4%
   94     84.93      0.23    0.2%
   96     85.07     0.208    0.2%
   98     85.75     0.319    0.3%
  100     84.77     0.284    0.3%

Quality and confidence:
param     error
s             0

Model:
Time ~=    80.65
    + s     0.05
              µs

Reads = 9 + (0 * s)
Writes = 8 + (0 * s)

Pallet: "pallet_nomination_pools", Extrinsic: "withdraw_unbonded_kill", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: NominationPools SubPoolsStorage (r:1 w:1)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Bonded (r:1 w:1)
Storage: Staking SlashingSpans (r:1 w:0)
Storage: Staking Validators (r:1 w:0)
Storage: Staking Nominators (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: Balances Locks (r:1 w:1)
Storage: NominationPools CounterForPoolMembers (r:1 w:1)
Storage: NominationPools ReversePoolIdLookup (r:1 w:1)
Storage: NominationPools CounterForReversePoolIdLookup (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: NominationPools CounterForRewardPools (r:1 w:1)
Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1)
Storage: NominationPools CounterForBondedPools (r:1 w:1)
Storage: Staking Payee (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      140
    + s        0
              µs

Reads = 20 + (0 * s)
Writes = 17 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    0     139.3     0.261    0.1%
    2     139.7      0.24    0.1%
    4     140.1     0.415    0.2%
    6     139.5     0.295    0.2%
    8     139.9     1.485    1.0%
   10     139.8     0.281    0.2%
   12     142.3     0.426    0.2%
   14       140     0.446    0.3%
   16     142.7     0.242    0.1%
   18     139.8     0.251    0.1%
   20     139.6     0.255    0.1%
   22     139.6     0.232    0.1%
   24       140     0.435    0.3%
   26     139.9     0.205    0.1%
   28     139.4     0.194    0.1%
   30     139.9     0.417    0.2%
   32     139.9     0.435    0.3%
   34     140.3     0.235    0.1%
   36     139.8     0.295    0.2%
   38     140.2     0.293    0.2%
   40     139.9     0.419    0.2%
   42       140     0.269    0.1%
   44     140.5     0.409    0.2%
   46     140.1     0.289    0.2%
   48     139.5     0.468    0.3%
   50     139.5     0.248    0.1%
   52     139.5      0.23    0.1%
   54     139.6     0.315    0.2%
   56     140.7      0.51    0.3%
   58     139.9     0.472    0.3%
   60     139.3     0.352    0.2%
   62     139.7     0.286    0.2%
   64     140.4     0.371    0.2%
   66     139.8     0.357    0.2%
   68     140.1     0.292    0.2%
   70     139.5     0.469    0.3%
   72     139.8     0.346    0.2%
   74     139.3     0.396    0.2%
   76     139.5     0.745    0.5%
   78     140.1     0.502    0.3%
   80     139.9     0.331    0.2%
   82     139.5     0.298    0.2%
   84     139.1     0.446    0.3%
   86     139.4     0.518    0.3%
   88     139.6     0.439    0.3%
   90     139.6     0.423    0.3%
   92     139.4     0.376    0.2%
   94     139.2       0.4    0.2%
   96     139.3     0.265    0.1%
   98       140     0.412    0.2%
  100     139.2     0.282    0.2%

Quality and confidence:
param     error
s         0.001

Model:
Time ~=    140.2
    + s        0
              µs

Reads = 20 + (0 * s)
Writes = 17 + (0 * s)

Pallet: "pallet_nomination_pools", Extrinsic: "create", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1)
Storage: Staking MinNominatorBond (r:1 w:0)
Storage: NominationPools MinCreateBond (r:1 w:0)
Storage: NominationPools MinJoinBond (r:1 w:0)
Storage: NominationPools MaxPools (r:1 w:0)
Storage: NominationPools CounterForBondedPools (r:1 w:1)
Storage: NominationPools PoolMembers (r:1 w:1)
Storage: NominationPools LastPoolId (r:1 w:1)
Storage: NominationPools MaxPoolMembersPerPool (r:1 w:0)
Storage: NominationPools MaxPoolMembers (r:1 w:0)
Storage: NominationPools CounterForPoolMembers (r:1 w:1)
Storage: System Account (r:2 w:2)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Bonded (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking HistoryDepth (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: NominationPools RewardPools (r:1 w:1)
Storage: NominationPools CounterForRewardPools (r:1 w:1)
Storage: NominationPools ReversePoolIdLookup (r:1 w:1)
Storage: NominationPools CounterForReversePoolIdLookup (r:1 w:1)
Storage: NominationPools BondedPools (r:1 w:1)
Storage: Staking Payee (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    130.5
              µs

Reads = 23
Writes = 16

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    130.5
              µs

Reads = 23
Writes = 16

Pallet: "pallet_nomination_pools", Extrinsic: "nominate", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: NominationPools BondedPools (r:1 w:0)
Storage: Staking Ledger (r:1 w:0)
Storage: Staking MinNominatorBond (r:1 w:0)
Storage: Staking Nominators (r:1 w:1)
Storage: Staking MaxNominatorsCount (r:1 w:0)
Storage: Staking Validators (r:2 w:0)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking Bonded (r:1 w:0)
Storage: BagsList ListNodes (r:1 w:1)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)
Storage: Staking CounterForNominators (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    46.37
    + n    2.098
              µs

Reads = 12 + (1 * n)
Writes = 5 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    1     47.96     0.321    0.6%
    2     50.64     0.317    0.6%
    3     53.28     0.223    0.4%
    4     54.16     0.307    0.5%
    5     56.08      0.09    0.1%
    6     59.69     0.169    0.2%
    7     60.12     0.078    0.1%
    8     63.56     0.157    0.2%
    9     65.78     0.208    0.3%
   10      67.1     0.482    0.7%
   11      68.6     0.517    0.7%
   12     72.26     0.175    0.2%
   13     72.33     0.101    0.1%
   14     76.19     0.299    0.3%
   15     76.58     0.155    0.2%
   16     81.55     1.236    1.5%

Quality and confidence:
param     error
n         0.015

Model:
Time ~=    46.15
    + n    2.114
              µs

Reads = 12 + (1 * n)
Writes = 5 + (0 * n)

Pallet: "pallet_nomination_pools", Extrinsic: "set_state", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: NominationPools BondedPools (r:1 w:1)
Storage: Staking Ledger (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    23.54
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    23.54
              µs

Reads = 2
Writes = 1

Pallet: "pallet_nomination_pools", Extrinsic: "set_metadata", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: NominationPools BondedPools (r:1 w:0)
Storage: NominationPools Metadata (r:1 w:1)
Storage: NominationPools CounterForMetadata (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    11.05
    + n    0.001
              µs

Reads = 3 + (0 * n)
Writes = 2 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    1      11.2     0.106    0.9%
    6     10.59      0.11    1.0%
   11     11.07     0.068    0.6%
   16     11.07     0.185    1.6%
   21     10.83     0.124    1.1%
   26     11.33     0.075    0.6%
   31      11.2     0.136    1.2%
   36     10.81     0.111    1.0%
   41     11.19     0.075    0.6%
   46     11.26     0.078    0.6%
   51     11.49     0.074    0.6%
   56      11.3     0.126    1.1%
   61     11.17     0.142    1.2%
   66     11.28     0.087    0.7%
   71     10.92     0.094    0.8%
   76     11.07      0.08    0.7%
   81     10.99     0.094    0.8%
   86     10.68     0.057    0.5%
   91     10.95     0.076    0.6%
   96     11.06     0.121    1.0%
  101     11.14     0.095    0.8%
  106     11.31     0.063    0.5%
  111     11.52     0.119    1.0%
  116     11.39     0.097    0.8%
  121     11.22     0.102    0.9%
  126     10.98     0.066    0.6%
  131     11.09     0.121    1.0%
  136     11.35     0.087    0.7%
  141     11.37     0.092    0.8%
  146     10.99     0.083    0.7%
  151     11.27     0.087    0.7%
  156     11.25     0.079    0.7%
  161     11.04     0.066    0.5%
  166     11.36     0.081    0.7%
  171     11.49     0.047    0.4%
  176     11.48     0.072    0.6%
  181     11.35     0.075    0.6%
  186      11.5     0.064    0.5%
  191     11.28     0.096    0.8%
  196     11.34     0.065    0.5%
  201     11.33     0.076    0.6%
  206     11.33     0.139    1.2%
  211     11.12     0.141    1.2%
  216     11.08      0.11    0.9%
  221     11.18     0.088    0.7%
  226      11.2     0.138    1.2%
  231     11.44     0.081    0.7%
  236     11.57     0.093    0.8%
  241     11.47     0.141    1.2%
  246     11.55     0.141    1.2%
  251     11.21      0.09    0.8%
  256     11.39     0.055    0.4%

Quality and confidence:
param     error
n             0

Model:
Time ~=    11.03
    + n    0.001
              µs

Reads = 3 + (0 * n)
Writes = 2 + (0 * n)

Pallet: "pallet_nomination_pools", Extrinsic: "set_configs", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: NominationPools MinJoinBond (r:0 w:1)
Storage: NominationPools MaxPoolMembers (r:0 w:1)
Storage: NominationPools MaxPoolMembersPerPool (r:0 w:1)
Storage: NominationPools MinCreateBond (r:0 w:1)
Storage: NominationPools MaxPools (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     2.91
              µs

Reads = 0
Writes = 5

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     2.91
              µs

Reads = 0
Writes = 5

Pallet: "pallet_nomination_pools", Extrinsic: "update_roles", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: NominationPools BondedPools (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     18.6
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     18.6
              µs

Reads = 1
Writes = 1


Parity Bot and others added 2 commits May 10, 2022 07:40
…--manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Outdated Show resolved Hide resolved
kianenigma and others added 5 commits May 10, 2022 12:34
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@kianenigma kianenigma requested a review from ggwpez May 10, 2022 11:48
) -> DispatchResult {
let o1 = origin;
let o2 = o1.clone();

let is_pool_root = || -> Result<BondedPool<T>, sp_runtime::DispatchError> {
let mut bonded_pool = BondedPool::<T>::get(pool_id).ok_or(Error::<T>::PoolNotFound)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh damn, I think unsigned extrinsics could now cause a DB-Read without paying for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they still pay for the full transaction, as if it set all values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an unsigned message though, since it wouldnt fail the extrinsic test until the origin check

Copy link
Member

@shawntabrizi shawntabrizi May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pick fix here #11391

frame/nomination-pools/src/lib.rs Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Show resolved Hide resolved
frame/nomination-pools/src/lib.rs Show resolved Hide resolved
@kianenigma
Copy link
Contributor Author

bot merge

@paritytech-processbot
Copy link

Error: "Check reviews" status is not passing for paritytech/polkadot#5488

@kianenigma
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 1a5ad4c into master May 10, 2022
@paritytech-processbot paritytech-processbot bot deleted the kiz-fix-unbond-reward-payout branch May 10, 2022 16:35
@kianenigma kianenigma changed the title fix a few more things with nomination pools update_roles for nomination pools May 16, 2022
godcodehunter pushed a commit to sensoriumxr/substrate that referenced this pull request Jun 22, 2022
* fix a few more things with nomination pools

* add bench

* use weight fn

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* allow real root to also set roles

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* move out of the closure

* fix a few more things

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
DaviRain-Su pushed a commit to octopus-network/substrate that referenced this pull request Aug 23, 2022
* fix a few more things with nomination pools

* add bench

* use weight fn

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* allow real root to also set roles

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* move out of the closure

* fix a few more things

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* fix a few more things with nomination pools

* add bench

* use weight fn

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* allow real root to also set roles

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* move out of the closure

* fix a few more things

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants