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

Conversation

@hirschenberger
Copy link
Contributor

@hirschenberger hirschenberger commented Mar 1, 2022

fixes #10938

polkadot companion: paritytech/polkadot#5018

polkadot address: 1ZApdbwrNnT1Hey4xeTAH6SZPDgbA9ZVftNuu9jTRbkc2Bg

@hirschenberger
Copy link
Contributor Author

We assume the worst case weight here but it may actually be much more lightweight.
So it would be possible to refund some weight afterwards.

Copy link
Member

@shawntabrizi shawntabrizi left a comment

Choose a reason for hiding this comment

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

lgtm. needs to run weights again after merge

@shawntabrizi shawntabrizi 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. E5-breaksapi D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Mar 1, 2022
@shawntabrizi shawntabrizi self-requested a review March 2, 2022 00:02
Copy link
Member

@shawntabrizi shawntabrizi left a comment

Choose a reason for hiding this comment

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

On closer review, actually a few things needs to be patched up:

  • You need to make sure all tests pass: cargo test -p pallet-staking --features runtime-benchmarks
  • Having ConfigOp<Option<...>> does not make sense, since ConfigOp has all of Set, Remove, and Noop. In the case of ConfigOp::set(None), you probably want to actually do ConfigOp::Remove, so really there should be no Options.
  • Storages which are an option will complain about using set, so you can use the put api.
  • Add a test that the put behavior is working as expected with the underlying storage.
  • Look at the tests that you fixed up, and introduce the usage of ConfigOp::Noop or ConfigOp::Remove where appropriate. For example, if the value does not change from one point to the next.

But the general idea is good, and the way you did weights is good enough imo.

@hirschenberger
Copy link
Contributor Author

@shawntabrizi Sorry, I left out the tests to discuss the implementation with @kianenigma . I should have marked the PR as draft.

But thanks for the review and the good remarks.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

With @shawntabrizi's feedback now it looks good to me! Thanks 💯

hirschenberger and others added 3 commits March 2, 2022 10:09
Co-authored-by: Kian Paimani <[email protected]>
@shawntabrizi
Copy link
Member

/tip small

@substrate-tip-bot
Copy link

Please fix the following problems before calling the tip bot again:

  • Contributor did not properly post their Polkadot or Kusama address. Make sure the pull request has: "{network} address: {address}".

@shawntabrizi
Copy link
Member

@hirschenberger are you able to make a companion PR, or do you need help with that?

I would just copy and paste set_staking_configs benchmarks, and paste it twice with the appropriate names.

@hirschenberger
Copy link
Contributor Author

@hirschenberger are you able to make a companion PR, or do you need help with that?

I would just copy and paste set_staking_configs benchmarks, and paste it twice with the appropriate names.

I can do a companion

hirschenberger added a commit to hirschenberger/polkadot that referenced this pull request Mar 2, 2022
@hirschenberger
Copy link
Contributor Author

/benchmark runtime dev pallet_staking

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 2, 2022

Error running benchmark: issue-10938

stdoutCaught exception in benchmarkRuntime: TypeError: Cannot read property 'benchCommand' of undefined

@shawntabrizi
Copy link
Member

/tip small

@substrate-tip-bot
Copy link

A small tip was successfully submitted for hirschenberger (1ZApdbwrNnT1Hey4xeTAH6SZPDgbA9ZVftNuu9jTRbkc2Bg on polkadot).

https://polkadot.js.org/apps/#/treasury/tips

@shawntabrizi
Copy link
Member

/benchmark runtime pallet pallet_staking

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 2, 2022

Benchmark Runtime Pallet for branch "issue-10938" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/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
Pallet: "pallet_staking", Extrinsic: "bond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Bonded (r:1 w:1)
Storage: Staking Ledger (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: Staking Payee (r:0 w:1)

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

Model:
Time ~=    37.23
              µs

Reads = 5
Writes = 4

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

Model:
Time ~=    37.23
              µs

Reads = 5
Writes = 4

Pallet: "pallet_staking", Extrinsic: "bond_extra", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Bonded (r:1 w:0)
Storage: Staking Ledger (r:1 w:1)
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 ~=    64.06
              µs

Reads = 8
Writes = 7

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

Model:
Time ~=    64.06
              µs

Reads = 8
Writes = 7

Pallet: "pallet_staking", Extrinsic: "unbond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:1)
Storage: Staking Nominators (r:1 w:0)
Storage: Staking MinNominatorBond (r:1 w:0)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: System Account (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)

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

Model:
Time ~=    70.06
              µs

Reads = 12
Writes = 8

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

Model:
Time ~=    70.06
              µs

Reads = 12
Writes = 8

Pallet: "pallet_staking", Extrinsic: "withdraw_unbonded_update", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
Storage: Balances Locks (r:1 w:1)
Storage: System Account (r:1 w:1)

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

Model:
Time ~=    29.94
    + s    0.052
              µs

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

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

Data points distribution:
    s   mean µs  sigma µs       %
    0     28.59     0.084    0.2%
    2     29.16      0.27    0.9%
    4     30.02     0.103    0.3%
    6     30.37     0.132    0.4%
    8     30.32     0.119    0.3%
   10     30.66     0.087    0.2%
   12     30.54     0.213    0.6%
   14     30.78     0.161    0.5%
   16     30.49     0.214    0.7%
   18      30.5     0.133    0.4%
   20     31.18     0.134    0.4%
   22     30.92     0.109    0.3%
   24     30.66     0.086    0.2%
   26     31.17     0.175    0.5%
   28     31.74     0.167    0.5%
   30      31.9     0.181    0.5%
   32     32.24     0.206    0.6%
   34     31.97     0.144    0.4%
   36     32.13     0.146    0.4%
   38     31.77     0.137    0.4%
   40     32.19     0.139    0.4%
   42     32.65     0.171    0.5%
   44     32.43     0.168    0.5%
   46     32.58     0.196    0.6%
   48     32.42     0.155    0.4%
   50     32.27     0.156    0.4%
   52     32.43     0.082    0.2%
   54     32.62     0.124    0.3%
   56     33.04     0.064    0.1%
   58     32.88     0.097    0.2%
   60     32.43     0.265    0.8%
   62     33.37     0.102    0.3%
   64      34.1     0.127    0.3%
   66     33.25     0.184    0.5%
   68     33.36     0.191    0.5%
   70     33.52      0.09    0.2%
   72     33.86     0.216    0.6%
   74     33.78      0.12    0.3%
   76     33.64     0.145    0.4%
   78     34.64     0.174    0.5%
   80     34.12     0.089    0.2%
   82     34.19     0.097    0.2%
   84     34.64     0.151    0.4%
   86      34.1     0.149    0.4%
   88     34.46     0.203    0.5%
   90      34.3     0.071    0.2%
   92     34.63     0.163    0.4%
   94     35.11      0.18    0.5%
   96     33.55     0.483    1.4%
   98     35.18     0.326    0.9%
  100     35.17     0.201    0.5%

Quality and confidence:
param     error
s             0

Model:
Time ~=    29.85
    + s    0.053
              µs

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

Pallet: "pallet_staking", Extrinsic: "withdraw_unbonded_kill", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:1)
Storage: Staking CurrentEra (r:1 w:0)
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:1)
Storage: Staking CounterForNominators (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: Balances Locks (r:1 w:1)
Storage: Staking Payee (r:0 w:1)

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

Model:
Time ~=    57.29
    + s        0
              µs

Reads = 13 + (0 * s)
Writes = 11 + (0 * s)

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

Data points distribution:
    s   mean µs  sigma µs       %
    0     57.93     0.382    0.6%
    2     57.55     0.165    0.2%
    4     57.72     0.204    0.3%
    6     57.41     0.185    0.3%
    8     57.32     0.233    0.4%
   10      57.4     0.208    0.3%
   12     57.25     0.238    0.4%
   14     57.08     0.124    0.2%
   16     56.97     0.278    0.4%
   18     57.15     0.175    0.3%
   20     56.98     0.249    0.4%
   22     57.01     0.237    0.4%
   24     57.37     0.171    0.2%
   26     57.15     0.207    0.3%
   28     56.63     0.128    0.2%
   30     58.29     0.315    0.5%
   32     57.31     0.282    0.4%
   34     57.43     0.245    0.4%
   36     57.07     0.191    0.3%
   38     57.46      0.16    0.2%
   40     57.07      0.19    0.3%
   42     56.99     0.143    0.2%
   44     56.79     0.212    0.3%
   46     57.31     0.267    0.4%
   48     57.14     0.231    0.4%
   50     58.26      0.35    0.6%
   52     57.08     0.152    0.2%
   54     57.54      0.11    0.1%
   56     57.23     0.192    0.3%
   58     58.39     0.191    0.3%
   60     57.19     0.274    0.4%
   62     57.19     0.188    0.3%
   64     58.22     0.481    0.8%
   66     57.25     0.185    0.3%
   68     56.86     0.333    0.5%
   70     56.88     0.219    0.3%
   72      57.4     0.153    0.2%
   74     57.15     0.123    0.2%
   76     57.04     0.173    0.3%
   78     56.98     0.173    0.3%
   80     57.11     0.126    0.2%
   82      57.2     0.187    0.3%
   84     57.03     0.179    0.3%
   86     57.47     0.562    0.9%
   88     57.26     0.201    0.3%
   90     57.51      0.17    0.2%
   92      57.9     0.386    0.6%
   94     57.22     0.201    0.3%
   96     58.35     0.441    0.7%
   98     57.11     0.352    0.6%
  100     57.44     0.217    0.3%

Quality and confidence:
param     error
s             0

Model:
Time ~=    57.31
    + s    0.001
              µs

Reads = 13 + (0 * s)
Writes = 11 + (0 * s)

Pallet: "pallet_staking", Extrinsic: "validate", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:0)
Storage: Staking MinValidatorBond (r:1 w:0)
Storage: Staking MinCommission (r:1 w:0)
Storage: Staking Validators (r:1 w:1)
Storage: Staking MaxValidatorsCount (r:1 w:0)
Storage: Staking Nominators (r:1 w:1)
Storage: Staking CounterForNominators (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)
Storage: Staking CounterForValidators (r:1 w:1)

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

Model:
Time ~=    44.44
              µs

Reads = 12
Writes = 8

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

Model:
Time ~=    44.44
              µs

Reads = 12
Writes = 8

Pallet: "pallet_staking", Extrinsic: "kick", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:0)
Storage: Staking Nominators (r:1 w:1)

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

Model:
Time ~=    16.61
    + k    7.357
              µs

Reads = 1 + (1 * k)
Writes = 0 + (1 * k)

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

Data points distribution:
    k   mean µs  sigma µs       %
    1     27.71     1.634    5.8%
    3      42.3     0.164    0.3%
    5     55.52     0.191    0.3%
    7     69.19     0.194    0.2%
    9     82.92     0.431    0.5%
   11      98.2     0.323    0.3%
   13     118.8      1.17    0.9%
   15     126.8     0.578    0.4%
   17     141.8     0.369    0.2%
   19       165     4.194    2.5%
   21     167.7     0.323    0.1%
   23     185.8     4.305    2.3%
   25       199       0.6    0.3%
   27     212.3     0.719    0.3%
   29     229.3     3.801    1.6%
   31     240.9     1.332    0.5%
   33     259.7     4.768    1.8%
   35     267.5     1.416    0.5%
   37     283.2     1.551    0.5%
   39       302      2.49    0.8%
   41     321.2     1.125    0.3%
   43     330.1      1.85    0.5%
   45     340.4     1.133    0.3%
   47     355.4     1.483    0.4%
   49     367.9     1.804    0.4%
   51     382.1     1.061    0.2%
   53     399.1     1.181    0.2%
   55     413.8     2.543    0.6%
   57     444.7     2.124    0.4%
   59       440     1.658    0.3%
   61     453.2     1.306    0.2%
   63     468.2     2.264    0.4%
   65     486.5         2    0.4%
   67     531.1     3.931    0.7%
   69       526     6.503    1.2%
   71     551.3     2.231    0.4%
   73     567.6     1.584    0.2%
   75     592.2     2.579    0.4%
   77     570.3     2.287    0.4%
   79     585.1     2.414    0.4%
   81     624.5     9.634    1.5%
   83       617     2.134    0.3%
   85     654.4     3.229    0.4%
   87     645.7     4.792    0.7%
   89     659.6     2.803    0.4%
   91     673.2      1.97    0.2%
   93     720.7     2.532    0.3%
   95     713.1     2.585    0.3%
   97     751.4     4.072    0.5%
   99     750.1     9.735    1.2%
  101     781.7     3.558    0.4%
  103     800.5     7.731    0.9%
  105       789     3.703    0.4%
  107     802.5     5.647    0.7%
  109     828.6     11.17    1.3%
  111     838.8     4.182    0.4%
  113     848.1     2.471    0.2%
  115     858.5     3.542    0.4%
  117     875.3     5.546    0.6%
  119     895.6     9.217    1.0%
  121     915.6     13.18    1.4%
  123     957.2     3.647    0.3%
  125     931.1     3.034    0.3%
  127     948.2     9.949    1.0%

Quality and confidence:
param     error
k         0.012

Model:
Time ~=     13.9
    + k    7.421
              µs

Reads = 1 + (1 * k)
Writes = 0 + (1 * k)

Pallet: "pallet_staking", Extrinsic: "nominate", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
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:2 w:2)
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 ~=    49.56
    + n    3.367
              µs

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

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

Data points distribution:
    n   mean µs  sigma µs       %
    1     52.12     0.127    0.2%
    2     56.92      0.14    0.2%
    3     59.84     0.242    0.4%
    4     62.82      0.24    0.3%
    5     66.41     0.296    0.4%
    6     69.65     0.238    0.3%
    7     72.96     0.268    0.3%
    8     76.29     0.152    0.1%
    9     80.36     0.265    0.3%
   10     83.56     0.309    0.3%
   11     86.92     0.357    0.4%
   12     90.68      0.21    0.2%
   13     92.35     0.229    0.2%
   14      96.7     0.267    0.2%
   15     99.25     0.336    0.3%
   16     103.6     0.443    0.4%

Quality and confidence:
param     error
n         0.009

Model:
Time ~=    49.58
    + n    3.362
              µs

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

Pallet: "pallet_staking", Extrinsic: "chill", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:0)
Storage: Staking Validators (r:1 w:0)
Storage: Staking Nominators (r:1 w:1)
Storage: Staking CounterForNominators (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)

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

Model:
Time ~=    44.18
              µs

Reads = 8
Writes = 6

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

Model:
Time ~=    44.18
              µs

Reads = 8
Writes = 6

Pallet: "pallet_staking", Extrinsic: "set_payee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:0)
Storage: Staking Payee (r:0 w:1)

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

Model:
Time ~=    7.922
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    7.922
              µs

Reads = 1
Writes = 1

Pallet: "pallet_staking", Extrinsic: "set_controller", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Bonded (r:1 w:1)
Storage: Staking Ledger (r:2 w:2)

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

Model:
Time ~=    15.43
              µs

Reads = 3
Writes = 3

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

Model:
Time ~=    15.43
              µs

Reads = 3
Writes = 3

Pallet: "pallet_staking", Extrinsic: "set_validator_count", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking ValidatorCount (r:0 w:1)

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

Model:
Time ~=    1.091
              µs

Reads = 0
Writes = 1

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

Model:
Time ~=    1.091
              µs

Reads = 0
Writes = 1

Pallet: "pallet_staking", Extrinsic: "force_no_eras", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking ForceEra (r:0 w:1)

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

Model:
Time ~=    1.204
              µs

Reads = 0
Writes = 1

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

Model:
Time ~=    1.204
              µs

Reads = 0
Writes = 1

Pallet: "pallet_staking", Extrinsic: "force_new_era", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking ForceEra (r:0 w:1)

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

Model:
Time ~=    1.208
              µs

Reads = 0
Writes = 1

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

Model:
Time ~=    1.208
              µs

Reads = 0
Writes = 1

Pallet: "pallet_staking", Extrinsic: "force_new_era_always", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking ForceEra (r:0 w:1)

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

Model:
Time ~=     1.22
              µs

Reads = 0
Writes = 1

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

Model:
Time ~=     1.22
              µs

Reads = 0
Writes = 1

Pallet: "pallet_staking", Extrinsic: "set_invulnerables", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Invulnerables (r:0 w:1)

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

Model:
Time ~=    1.476
    + v    0.009
              µs

Reads = 0 + (0 * v)
Writes = 1 + (0 * v)

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

Data points distribution:
    v   mean µs  sigma µs       %
    0      1.27     0.021    1.6%
   20     1.675     0.028    1.6%
   40     1.919     0.035    1.8%
   60     1.993     0.022    1.1%
   80     2.217     0.033    1.4%
  100     2.462     0.036    1.4%
  120     2.743     0.043    1.5%
  140     2.825     0.043    1.5%
  160     2.993     0.065    2.1%
  180     3.372      0.04    1.1%
  200     3.392     0.047    1.3%
  220     3.609     0.029    0.8%
  240     3.666     0.043    1.1%
  260     3.936     0.044    1.1%
  280     4.103     0.024    0.5%
  300     4.267     0.036    0.8%
  320     4.413     0.049    1.1%
  340     4.713     0.114    2.4%
  360     4.758     0.063    1.3%
  380     4.903     0.053    1.0%
  400     5.176      0.06    1.1%
  420     5.301      0.03    0.5%
  440     5.533     0.035    0.6%
  460     5.776     0.081    1.4%
  480     5.961     0.041    0.6%
  500     6.189     0.046    0.7%
  520     6.266     0.062    0.9%
  540     6.501     0.134    2.0%
  560     6.704     0.046    0.6%
  580     6.853     0.021    0.3%
  600     7.044      0.02    0.2%
  620     7.359     0.054    0.7%
  640     7.522     0.029    0.3%
  660     7.794     0.063    0.8%
  680     7.833      0.05    0.6%
  700     8.164     0.035    0.4%
  720      8.35     0.097    1.1%
  740     8.373      0.07    0.8%
  760     8.596     0.052    0.6%
  780     8.909     0.053    0.5%
  800     9.092     0.087    0.9%
  820     9.268     0.033    0.3%
  840     9.402     0.026    0.2%
  860     9.831     0.027    0.2%
  880     9.689     0.036    0.3%
  900      9.95     0.089    0.8%
  920      10.1     0.092    0.9%
  940     10.22     0.076    0.7%
  960     10.39     0.039    0.3%
  980     10.58     0.026    0.2%
 1000     10.75     0.032    0.2%

Quality and confidence:
param     error
v             0

Model:
Time ~=    1.473
    + v    0.009
              µs

Reads = 0 + (0 * v)
Writes = 1 + (0 * v)

Pallet: "pallet_staking", Extrinsic: "force_unstake", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
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:1)
Storage: Staking CounterForNominators (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: Balances Locks (r:1 w:1)
Storage: Staking Ledger (r:0 w:1)
Storage: Staking Payee (r:0 w:1)
Storage: Staking SpanSlash (r:0 w:2)

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

Model:
Time ~=    55.82
    + s    0.809
              µs

Reads = 11 + (0 * s)
Writes = 12 + (1 * s)

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

Data points distribution:
    s   mean µs  sigma µs       %
    0     52.26     0.157    0.3%
    2     56.54     0.186    0.3%
    4     58.53     0.137    0.2%
    6     60.04     0.136    0.2%
    8     62.02     0.162    0.2%
   10     63.81     0.211    0.3%
   12     65.25     0.184    0.2%
   14     66.88     0.139    0.2%
   16      68.6     0.301    0.4%
   18     69.96     0.078    0.1%
   20     72.33     0.237    0.3%
   22     74.09     0.213    0.2%
   24     75.67     0.265    0.3%
   26     76.67     0.186    0.2%
   28     78.52     0.374    0.4%
   30     81.42     0.174    0.2%
   32     82.22     0.274    0.3%
   34     83.31     0.247    0.2%
   36     86.34     0.534    0.6%
   38     88.06     0.329    0.3%
   40     89.78     0.135    0.1%
   42     90.77     0.361    0.3%
   44     90.96     0.279    0.3%
   46     92.98     0.155    0.1%
   48     94.52     0.256    0.2%
   50     95.38     0.524    0.5%
   52     98.25     0.157    0.1%
   54     100.5      0.21    0.2%
   56     101.7     0.335    0.3%
   58     103.4     0.171    0.1%
   60       105     0.284    0.2%
   62     106.1     0.309    0.2%
   64       107     0.167    0.1%
   66       109     0.302    0.2%
   68     111.3     0.204    0.1%
   70     112.2     0.171    0.1%
   72     113.9     0.278    0.2%
   74     116.7     0.201    0.1%
   76     117.8     0.195    0.1%
   78     118.4     0.298    0.2%
   80     120.4     0.452    0.3%
   82     121.4     0.111    0.0%
   84     123.9     0.338    0.2%
   86     126.1     0.376    0.2%
   88     125.8     0.157    0.1%
   90       129     0.113    0.0%
   92     129.7     0.338    0.2%
   94     129.7     1.163    0.8%
   96     131.8     1.054    0.7%
   98     133.8     1.164    0.8%
  100     136.4     0.164    0.1%

Quality and confidence:
param     error
s         0.001

Model:
Time ~=    55.81
    + s    0.808
              µs

Reads = 11 + (0 * s)
Writes = 12 + (1 * s)

Pallet: "pallet_staking", Extrinsic: "cancel_deferred_slash", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking UnappliedSlashes (r:1 w:1)

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

Model:
Time ~=    964.6
    + s    4.487
              µs

Reads = 1 + (0 * s)
Writes = 1 + (0 * s)

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

Data points distribution:
    s   mean µs  sigma µs       %
    1     111.9     0.247    0.2%
   20     284.6     3.223    1.1%
   39     451.5     12.36    2.7%
   58       606     3.901    0.6%
   77     827.6     3.461    0.4%
   96     997.2     3.267    0.3%
  115      1157     16.56    1.4%
  134      1324     10.28    0.7%
  153      1474     21.82    1.4%
  172      1603     43.83    2.7%
  191      1778     38.19    2.1%
  210      1876     70.69    3.7%
  229      1956     46.15    2.3%
  248      2144      74.8    3.4%
  267      2285     42.18    1.8%
  286      2384     59.52    2.4%
  305      2508     66.63    2.6%
  324      2583      59.9    2.3%
  343      2754     75.64    2.7%
  362      2827     77.95    2.7%
  381      2876     38.71    1.3%
  400      3010     29.23    0.9%
  419      3115      80.2    2.5%
  438      3281     46.62    1.4%
  457      3328     103.6    3.1%
  476      3369     56.24    1.6%
  495      3419      44.8    1.3%
  514      3598     58.27    1.6%
  533      3685      31.2    0.8%
  552      3676      47.2    1.2%
  571      3874     66.64    1.7%
  590      3874     38.68    0.9%
  609      3919     76.06    1.9%
  628      3916     68.11    1.7%
  647      4077       134    3.2%
  666      4098     46.14    1.1%
  685      4123      45.5    1.1%
  704      4184     89.72    2.1%
  723      4218     52.93    1.2%
  742      4260      74.9    1.7%
  761      4346     82.14    1.8%
  780      4386     69.74    1.5%
  799      4391     63.62    1.4%
  818      4443     51.48    1.1%
  837      4443      38.3    0.8%
  856      4444     41.12    0.9%
  875      4564     67.39    1.4%
  894      4518     63.27    1.4%
  913      4475     73.89    1.6%
  932      4592     60.77    1.3%
  951      4581     80.07    1.7%
  970      4553     45.11    0.9%
  989      4605     78.85    1.7%

Quality and confidence:
param     error
s         0.053

Model:
Time ~=      903
    + s    4.434
              µs

Reads = 1 + (0 * s)
Writes = 1 + (0 * s)

Pallet: "pallet_staking", Extrinsic: "payout_stakers_dead_controller", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking HistoryDepth (r:1 w:0)
Storage: Staking ErasValidatorReward (r:1 w:0)
Storage: Staking Bonded (r:2 w:0)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking ErasStakersClipped (r:1 w:0)
Storage: Staking ErasRewardPoints (r:1 w:0)
Storage: Staking ErasValidatorPrefs (r:1 w:0)
Storage: Staking Payee (r:2 w:0)
Storage: System Account (r:2 w:2)

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

Model:
Time ~=     79.5
    + n    23.98
              µs

Reads = 10 + (3 * n)
Writes = 2 + (1 * n)

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

Data points distribution:
    n   mean µs  sigma µs       %
    1     113.1     19.68   17.3%
    6     264.4     0.672    0.2%
   11     338.7     1.004    0.2%
   16     463.6     2.752    0.5%
   21     582.6      1.15    0.1%
   26     700.4     3.948    0.5%
   31     819.3     1.239    0.1%
   36     945.9     3.961    0.4%
   41      1062     5.914    0.5%
   46      1180     11.81    1.0%
   51      1308     6.162    0.4%
   56      1407     9.347    0.6%
   61      1545     9.387    0.6%
   66      1648     6.961    0.4%
   71      1789     8.562    0.4%
   76      1933     11.65    0.6%
   81      2009     8.807    0.4%
   86      2156     13.38    0.6%
   91      2264     9.656    0.4%
   96      2373     16.95    0.7%
  101      2491     10.89    0.4%
  106      2610      16.2    0.6%
  111      2745     16.28    0.5%
  116      2839     10.32    0.3%
  121      2957     20.57    0.6%
  126      3108     14.05    0.4%
  131      3207     17.36    0.5%
  136      3331     11.21    0.3%
  141      3457     19.71    0.5%
  146      3597     10.67    0.2%
  151      3728      17.5    0.4%
  156      3849     11.03    0.2%
  161      3959     11.01    0.2%
  166      4045     11.46    0.2%
  171      4192     18.18    0.4%
  176      4297     17.26    0.4%
  181      4392     26.38    0.6%
  186      4553     9.289    0.2%
  191      4678     18.07    0.3%
  196      4749     13.71    0.2%
  201      4946     11.28    0.2%
  206      5034     22.81    0.4%
  211      5127     30.84    0.6%
  216      5250     33.43    0.6%
  221      5355     32.09    0.5%
  226      5540     36.09    0.6%
  231      5641     34.41    0.6%
  236      5717     26.56    0.4%
  241      5870     20.41    0.3%
  246      6034     21.71    0.3%
  251      6092     14.02    0.2%
  256      6215     22.75    0.3%

Quality and confidence:
param     error
n         0.014

Model:
Time ~=    79.44
    + n       24
              µs

Reads = 10 + (3 * n)
Writes = 2 + (1 * n)

Pallet: "pallet_staking", Extrinsic: "payout_stakers_alive_staked", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking HistoryDepth (r:1 w:0)
Storage: Staking ErasValidatorReward (r:1 w:0)
Storage: Staking Bonded (r:2 w:0)
Storage: Staking Ledger (r:2 w:2)
Storage: Staking ErasStakersClipped (r:1 w:0)
Storage: Staking ErasRewardPoints (r:1 w:0)
Storage: Staking ErasValidatorPrefs (r:1 w:0)
Storage: Staking Payee (r:2 w:0)
Storage: System Account (r:2 w:2)
Storage: Balances Locks (r:2 w:2)

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

Model:
Time ~=     99.3
    + n    33.23
              µs

Reads = 11 + (5 * n)
Writes = 3 + (3 * n)

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

Data points distribution:
    n   mean µs  sigma µs       %
    1     128.8     0.608    0.4%
    6     295.4     2.275    0.7%
   11     461.7     1.436    0.3%
   16     628.7     2.892    0.4%
   21     805.1       8.2    1.0%
   26     959.8     2.813    0.2%
   31      1129     4.642    0.4%
   36      1317     14.02    1.0%
   41      1467     8.657    0.5%
   46      1634     12.83    0.7%
   51      1809     12.52    0.6%
   56      1977     9.025    0.4%
   61      2117     14.34    0.6%
   66      2294     10.83    0.4%
   71      2457     21.35    0.8%
   76      2609     12.65    0.4%
   81      2790     19.33    0.6%
   86      2940     18.31    0.6%
   91      3129      19.2    0.6%
   96      3341     13.53    0.4%
  101      3469     11.96    0.3%
  106      3651     18.01    0.4%
  111      3829     27.62    0.7%
  116      3971     20.58    0.5%
  121      4076     18.44    0.4%
  126      4288     20.19    0.4%
  131      4476     24.04    0.5%
  136      4615        22    0.4%
  141      4754     22.86    0.4%
  146      4952      14.1    0.2%
  151      5093     19.36    0.3%
  156      5257     14.65    0.2%
  161      5432     20.56    0.3%
  166      5592     18.06    0.3%
  171      5771     16.55    0.2%
  176      5926     12.63    0.2%
  181      6138     33.07    0.5%
  186      6296     24.02    0.3%
  191      6452     39.29    0.6%
  196      6650     43.24    0.6%
  201      6826      32.2    0.4%
  206      6930     33.18    0.4%
  211      7108     34.77    0.4%
  216      7279     39.62    0.5%
  221      7443     23.05    0.3%
  226      7696     31.47    0.4%
  231      7816     40.15    0.5%
  236      7929     29.78    0.3%
  241      8131     52.46    0.6%
  246      8277     34.45    0.4%
  251      8374     34.14    0.4%
  256      8678      15.2    0.1%

Quality and confidence:
param     error
n          0.02

Model:
Time ~=    99.11
    + n    33.27
              µs

Reads = 11 + (5 * n)
Writes = 3 + (3 * n)

Pallet: "pallet_staking", Extrinsic: "rebond", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Ledger (r:1 w:1)
Storage: Balances Locks (r:1 w:1)
Storage: System Account (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)

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

Model:
Time ~=    63.29
    + l    0.054
              µs

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

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

Data points distribution:
    l   mean µs  sigma µs       %
    1     63.17     0.272    0.4%
    2     63.03     0.204    0.3%
    3     63.29     0.243    0.3%
    4     62.84     0.162    0.2%
    5     64.33     0.476    0.7%
    6     64.24     0.112    0.1%
    7     63.57     0.166    0.2%
    8     64.64     0.238    0.3%
    9     63.94     0.201    0.3%
   10     64.03     0.219    0.3%
   11     64.07     0.302    0.4%
   12     63.38     0.263    0.4%
   13     64.17     0.237    0.3%
   14     64.06     0.149    0.2%
   15     64.15     0.243    0.3%
   16     64.18     0.075    0.1%
   17     64.06     0.195    0.3%
   18     63.93     0.198    0.3%
   19     64.35      0.19    0.2%
   20     64.43     0.276    0.4%
   21     63.94       0.1    0.1%
   22     64.29     0.229    0.3%
   23     64.35     0.312    0.4%
   24     65.03     0.221    0.3%
   25      64.6     0.264    0.4%
   26     64.69     0.162    0.2%
   27     65.14     0.254    0.3%
   28     64.87     0.298    0.4%
   29     64.78     0.308    0.4%
   30     64.84     0.162    0.2%
   31     64.95      0.27    0.4%
   32     65.06     0.257    0.3%

Quality and confidence:
param     error
l         0.002

Model:
Time ~=    63.33
    + l    0.053
              µs

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

Pallet: "pallet_staking", Extrinsic: "set_history_depth", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking HistoryDepth (r:1 w:1)
Storage: Staking ErasStakersClipped (r:0 w:2)
Storage: Staking ErasValidatorPrefs (r:0 w:2)
Storage: Staking ErasValidatorReward (r:0 w:1)
Storage: Staking ErasRewardPoints (r:0 w:1)
Storage: Staking ErasStakers (r:0 w:2)
Storage: Staking ErasTotalStake (r:0 w:1)
Storage: Staking ErasStartSessionIndex (r:0 w:1)

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

Model:
Time ~=        0
    + e    20.29
              µs

Reads = 2 + (0 * e)
Writes = 4 + (7 * e)

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

Data points distribution:
    e   mean µs  sigma µs       %
    1     23.75     0.109    0.4%
    2     38.96     0.161    0.4%
    3     50.62     0.192    0.3%
    4     67.58     0.208    0.3%
    5     81.33     0.293    0.3%
    6     93.62     1.087    1.1%
    7     104.7     0.259    0.2%
    8       119     0.251    0.2%
    9     131.6     0.268    0.2%
   10     147.2     0.444    0.3%
   11     162.9     0.442    0.2%
   12     175.7     0.293    0.1%
   13     190.6     0.488    0.2%
   14     206.4      0.64    0.3%
   15     220.5     0.604    0.2%
   16     237.4     0.345    0.1%
   17     251.9     0.645    0.2%
   18     265.7     0.854    0.3%
   19       286     0.677    0.2%
   20       294     0.948    0.3%
   21     318.3      1.18    0.3%
   22     326.2      0.62    0.1%
   23     346.4     0.481    0.1%
   24     362.5     1.073    0.2%
   25     383.3     1.143    0.2%
   26     404.1     1.159    0.2%
   27     416.8     0.734    0.1%
   28       440      0.98    0.2%
   29     457.9     1.076    0.2%
   30     471.2     1.595    0.3%
   31     483.6     1.404    0.2%
   32     508.2     2.475    0.4%
   33     523.2     0.578    0.1%
   34     539.8     1.702    0.3%
   35     559.7     1.664    0.2%
   36     573.8     1.219    0.2%
   37     590.1     4.027    0.6%
   38     604.5     1.472    0.2%
   39     617.6     1.651    0.2%
   40     659.6     14.68    2.2%
   41     666.5     1.888    0.2%
   42     679.2     1.373    0.2%
   43     706.8     7.758    1.0%
   44     722.9     2.265    0.3%
   45       748     3.718    0.4%
   46     763.6      11.9    1.5%
   47     786.4     4.679    0.5%
   48     808.5     6.781    0.8%
   49     813.4     2.435    0.2%
   50     841.5     1.723    0.2%
   51     873.2     10.96    1.2%
   52     888.5     2.363    0.2%
   53     913.2     7.224    0.7%
   54     928.4     7.005    0.7%
   55     967.1     10.11    1.0%
   56     983.5     10.68    1.0%
   57       996     10.94    1.0%
   58      1030      8.97    0.8%
   59      1032     6.822    0.6%
   60      1075      13.2    1.2%
   61      1082     10.16    0.9%
   62      1098     9.381    0.8%
   63      1123     5.164    0.4%
   64      1146     15.41    1.3%
   65      1167     6.124    0.5%
   66      1199     11.84    0.9%
   67      1218     10.18    0.8%
   68      1240     6.782    0.5%
   69      1256     9.043    0.7%
   70      1275     5.487    0.4%
   71      1322     13.07    0.9%
   72      1353     11.44    0.8%
   73      1351     6.021    0.4%
   74      1374     16.26    1.1%
   75      1412     7.105    0.5%
   76      1428     9.819    0.6%
   77      1466     4.638    0.3%
   78      1473      7.17    0.4%
   79      1498     10.05    0.6%
   80      1506     5.955    0.3%
   81      1513     9.414    0.6%
   82      1563     12.47    0.7%
   83      1593     6.481    0.4%
   84      1597     9.949    0.6%
   85      1675     10.11    0.6%
   86      1679     10.74    0.6%
   87      1682     19.25    1.1%
   88      1704     11.54    0.6%
   89      1762     11.41    0.6%
   90      1799     10.79    0.5%
   91      1809     23.78    1.3%
   92      1802     11.78    0.6%
   93      1825     10.95    0.6%
   94      1900     12.45    0.6%
   95      1923     13.52    0.7%
   96      1894     7.132    0.3%
   97      1939     10.88    0.5%
   98      1968     10.28    0.5%
   99      2013     11.81    0.5%
  100      2055      8.47    0.4%

Quality and confidence:
param     error
e         0.058

Model:
Time ~=        0
    + e    20.38
              µs

Reads = 2 + (0 * e)
Writes = 4 + (7 * e)

Pallet: "pallet_staking", Extrinsic: "reap_stash", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: Staking Bonded (r:1 w:1)
Storage: Staking Ledger (r:1 w:1)
Storage: Staking SlashingSpans (r:1 w:1)
Storage: Staking Validators (r:1 w:0)
Storage: Staking Nominators (r:1 w:1)
Storage: Staking CounterForNominators (r:1 w:1)
Storage: BagsList ListNodes (r:2 w:2)
Storage: BagsList ListBags (r:1 w:1)
Storage: BagsList CounterForListNodes (r:1 w:1)
Storage: Balances Locks (r:1 w:1)
Storage: Staking Payee (r:0 w:1)
Storage: Staking SpanSlash (r:0 w:1)

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

Model:
Time ~=    61.43
    + s     0.81
              µs

Reads = 12 + (0 * s)
Writes = 12 + (1 * s)

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

Data points distribution:
    s   mean µs  sigma µs       %
    1        62     0.165    0.2%
    2     63.35     0.107    0.1%
    3     63.82     0.149    0.2%
    4     64.31     0.186    0.2%
    5     65.21      0.18    0.2%
    6     66.11     0.216    0.3%
    7     66.98     0.169    0.2%
    8     68.25     0.125    0.1%
    9     69.02     0.217    0.3%
   10     69.18     0.215    0.3%
   11     70.39     0.239    0.3%
   12     71.36     0.182    0.2%
   13     72.24     0.176    0.2%
   14     72.78      0.19    0.2%
   15     73.32     0.192    0.2%
   16     74.61     0.283    0.3%
   17     74.97     0.191    0.2%
   18     75.74     0.198    0.2%
   19      76.3     0.273    0.3%
   20     76.71       0.2    0.2%
   21     78.32     0.288    0.3%
   22     78.84     0.193    0.2%
   23     80.29     0.333    0.4%
   24     81.31     0.414    0.5%
   25     81.12     0.226    0.2%
   26      81.9     0.309    0.3%
   27     83.42     0.252    0.3%
   28     83.84     0.326    0.3%
   29     84.82     0.233    0.2%
   30     87.16     0.555    0.6%
   31      86.5     0.595    0.6%
   32     86.86      0.19    0.2%
   33     87.77     0.382    0.4%
   34     88.83     0.326    0.3%
   35     90.43     0.156    0.1%
   36     90.49     0.259    0.2%
   37     91.68     0.261    0.2%
   38     92.08     0.179    0.1%
   39     92.85     0.741    0.7%
   40     93.78     0.356    0.3%
   41     94.87     0.301    0.3%
   42     96.03      0.47    0.4%
   43      96.1     0.338    0.3%
   44     96.58     0.453    0.4%
   45     98.32      0.23    0.2%
   46     98.84     0.524    0.5%
   47     99.28     0.295    0.2%
   48     99.42     0.364    0.3%
   49     102.3     0.244    0.2%
   50     101.9     0.275    0.2%
   51     101.8     0.186    0.1%
   52     103.8     0.297    0.2%
   53     105.1     0.219    0.2%
   54     106.6     0.554    0.5%
   55     106.5     0.267    0.2%
   56     107.6     0.292    0.2%
   57     108.8     0.407    0.3%
   58     108.2     0.281    0.2%
   59     109.8     0.394    0.3%
   60     110.3     0.351    0.3%
   61     111.1     0.151    0.1%
   62     111.9     0.266    0.2%
   63     112.6      0.22    0.1%
   64       114     0.889    0.7%
   65     112.8      0.23    0.2%
   66     114.4     0.179    0.1%
   67     115.3     0.234    0.2%
   68     117.2     0.137    0.1%
   69       117     0.274    0.2%
   70     118.1      0.12    0.1%
   71     117.8     1.169    0.9%
   72       120     0.205    0.1%
   73     121.2     0.159    0.1%
   74     122.3     0.296    0.2%
   75     123.7     0.773    0.6%
   76     123.8     0.214    0.1%
   77     124.5     0.312    0.2%
   78     125.3     0.269    0.2%
   79     125.5     0.202    0.1%
   80     125.6     0.369    0.2%
   81     127.3     0.305    0.2%
   82     126.3     0.186    0.1%
   83       129     0.918    0.7%
   84     128.9     0.365    0.2%
   85     131.2     0.336    0.2%
   86     132.3     0.362    0.2%
   87     131.9     0.255    0.1%
   88       131     0.861    0.6%
   89     134.1      0.42    0.3%
   90     134.3     0.239    0.1%
   91     134.7     0.595    0.4%
   92     134.9     0.472    0.3%
   93     134.3     0.984    0.7%
   94     134.9      1.03    0.7%
   95     140.3     1.699    1.2%
   96     139.4     0.304    0.2%
   97     140.6     0.251    0.1%
   98       140     1.013    0.7%
   99     141.7     0.324    0.2%
  100     140.6     0.311    0.2%

Quality and confidence:
param     error
s             0

Model:
Time ~=    61.48
    + s    0.809
              µs

Reads = 12 + (0 * s)
Writes = 12 + (1 * s)

Pallet: "pallet_staking", Extrinsic: "new_era", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CounterForNominators (r:1 w:0)
Storage: Staking CounterForValidators (r:1 w:0)
Storage: Staking Validators (r:2 w:0)
Storage: Staking Bonded (r:101 w:0)
Storage: Staking Ledger (r:101 w:0)
Storage: Staking SlashingSpans (r:1 w:0)
Storage: BagsList ListBags (r:200 w:0)
Storage: BagsList ListNodes (r:100 w:0)
Storage: Staking Nominators (r:100 w:0)
Storage: Staking ValidatorCount (r:1 w:0)
Storage: Staking MinimumValidatorCount (r:1 w:0)
Storage: Staking CurrentEra (r:1 w:1)
Storage: Staking HistoryDepth (r:1 w:0)
Storage: Staking ErasStakersClipped (r:0 w:1)
Storage: Staking ErasValidatorPrefs (r:0 w:1)
Storage: Staking ErasStakers (r:0 w:1)
Storage: Staking ErasTotalStake (r:0 w:1)
Storage: Staking ErasStartSessionIndex (r:0 w:1)

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

Model:
Time ~=        0
    + v    198.2
    + n    30.57
              µs

Reads = 208 + (3 * v) + (4 * n)
Writes = 3 + (3 * v) + (0 * n)

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

Data points distribution:
    v     n   mean µs  sigma µs       %
    1   100      1944     11.59    0.5%
    2   100      2066     19.47    0.9%
    3   100      2205      9.85    0.4%
    4   100      2277     8.941    0.3%
    5   100      2502     10.93    0.4%
    6   100      2676      10.6    0.3%
    7   100      2927     13.08    0.4%
    8   100      3162     8.309    0.2%
    9   100      3385     17.77    0.5%
   10     1     641.2     10.07    1.5%
   10     2     677.3     3.827    0.5%
   10     3     707.4     2.409    0.3%
   10     4     760.6     2.482    0.3%
   10     5     783.5      7.39    0.9%
   10     6     815.6      10.2    1.2%
   10     7     852.2     10.85    1.2%
   10     8     879.7     13.89    1.5%
   10     9       884      5.61    0.6%
   10    10     931.5     6.934    0.7%
   10    11       962     12.06    1.2%
   10    12     993.4     13.11    1.3%
   10    13      1038     8.676    0.8%
   10    14      1058     8.569    0.8%
   10    15      1103     14.68    1.3%
   10    16      1129     12.18    1.0%
   10    17      1140      12.5    1.0%
   10    18      1200     5.204    0.4%
   10    19      1229     12.29    0.9%
   10    20      1217     6.195    0.5%
   10    21      1260      9.27    0.7%
   10    22      1297     11.52    0.8%
   10    23      1356     16.46    1.2%
   10    24      1357      13.2    0.9%
   10    25      1384     13.97    1.0%
   10    26      1410     14.76    1.0%
   10    27      1463     21.32    1.4%
   10    28      1520     9.868    0.6%
   10    29      1507     10.67    0.7%
   10    30      1552     10.14    0.6%
   10    31      1560     17.25    1.1%
   10    32      1596     11.67    0.7%
   10    33      1641     13.14    0.8%
   10    34      1672     15.07    0.9%
   10    35      1694     11.24    0.6%
   10    36      1731     15.52    0.8%
   10    37      1744     14.69    0.8%
   10    38      1783     14.78    0.8%
   10    39      1817      12.5    0.6%
   10    40      1836     9.175    0.4%
   10    41      1880     12.45    0.6%
   10    42      1902     11.75    0.6%
   10    43      1908     10.59    0.5%
   10    44      1979     25.83    1.3%
   10    45      2018     12.85    0.6%
   10    46      2044     15.48    0.7%
   10    47      2070     18.59    0.8%
   10    48      2075     11.02    0.5%
   10    49      2096     12.62    0.6%
   10    50      2170     8.287    0.3%
   10    51      2167     11.57    0.5%
   10    52      2224     21.03    0.9%
   10    53      2256     5.812    0.2%
   10    54      2308     12.78    0.5%
   10    55      2335     10.44    0.4%
   10    56      2358     17.51    0.7%
   10    57      2404     17.58    0.7%
   10    58      2405     16.54    0.6%
   10    59      2478     21.01    0.8%
   10    60      2462     15.14    0.6%
   10    61      2505     19.63    0.7%
   10    62      2551     9.922    0.3%
   10    63      2583     12.57    0.4%
   10    64      2616      17.6    0.6%
   10    65      2653     13.17    0.4%
   10    66      2711     15.47    0.5%
   10    67      2701      11.7    0.4%
   10    68      2731     14.67    0.5%
   10    69      2712     13.62    0.5%
   10    70      2766     9.827    0.3%
   10    71      2763     10.49    0.3%
   10    72      2842     15.46    0.5%
   10    73      2867      18.9    0.6%
   10    74      2890      11.9    0.4%
   10    75      2939     17.18    0.5%
   10    76      2953     24.57    0.8%
   10    77      2999     10.64    0.3%
   10    78      3008     18.14    0.6%
   10    79      3039     23.67    0.7%
   10    80      3081     9.686    0.3%
   10    81      3093     15.33    0.4%
   10    82      3158      21.5    0.6%
   10    83      3194     32.83    1.0%
   10    84      3164     18.45    0.5%
   10    85      3236     16.97    0.5%
   10    86      3219     15.56    0.4%
   10    87      3307     22.48    0.6%
   10    88      3325     26.05    0.7%
   10    89      3331     16.33    0.4%
   10    90      3341     8.041    0.2%
   10    91      3368     20.24    0.6%
   10    92      3473     16.52    0.4%
   10    93      3465     10.61    0.3%
   10    94      3487     15.34    0.4%
   10    95      3501     16.11    0.4%
   10    96      3579     12.56    0.3%
   10    97      3645      12.9    0.3%
   10    98      3655     19.59    0.5%
   10    99      3668     22.52    0.6%
   10   100      3632     19.29    0.5%

Quality and confidence:
param     error
v         0.878
n         0.044

Model:
Time ~=        0
    + v    212.2
    + n    30.36
              µs

Reads = 208 + (3 * v) + (4 * n)
Writes = 3 + (3 * v) + (0 * n)

Pallet: "pallet_staking", Extrinsic: "get_npos_voters", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CounterForNominators (r:1 w:0)
Storage: Staking CounterForValidators (r:1 w:0)
Storage: Staking Validators (r:501 w:0)
Storage: Staking Bonded (r:1500 w:0)
Storage: Staking Ledger (r:1500 w:0)
Storage: Staking SlashingSpans (r:21 w:0)
Storage: BagsList ListBags (r:200 w:0)
Storage: BagsList ListNodes (r:1000 w:0)
Storage: Staking Nominators (r:1000 w:0)

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

Model:
Time ~=        0
    + v    18.22
    + n    20.76
    + s    56.77
              µs

Reads = 204 + (3 * v) + (4 * n) + (1 * s)
Writes = 0 + (0 * v) + (0 * n) + (0 * s)

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

Data points distribution:
    v     n     s   mean µs  sigma µs       %
  500  1000    20     27170       152    0.5%
  510  1000    20     27130     122.9    0.4%
  520  1000    20     27040     142.6    0.5%
  530  1000    20     27230     135.6    0.4%
  540  1000    20     27270     140.4    0.5%
  550  1000    20     27330     81.06    0.2%
  560  1000    20     27000       114    0.4%
  570  1000    20     27600     166.7    0.6%
  580  1000    20     27920     85.34    0.3%
  590  1000    20     28220     159.7    0.5%
  600  1000    20     28850     114.1    0.3%
  610  1000    20     28690     122.8    0.4%
  620  1000    20     28770     199.5    0.6%
  630  1000    20     28880     163.7    0.5%
  640  1000    20     28750     282.1    0.9%
  650  1000    20     29090        72    0.2%
  660  1000    20     29080     144.6    0.4%
  670  1000    20     30180     203.7    0.6%
  680  1000    20     29790     107.3    0.3%
  690  1000    20     29640     85.51    0.2%
  700  1000    20     30090       172    0.5%
  710  1000    20     30170     98.57    0.3%
  720  1000    20     30960     132.7    0.4%
  730  1000    20     31320     138.7    0.4%
  740  1000    20     30580     178.4    0.5%
  750  1000    20     30720      83.7    0.2%
  760  1000    20     31210     126.3    0.4%
  770  1000    20     31320     196.3    0.6%
  780  1000    20     31460     134.9    0.4%
  790  1000    20     31940     104.4    0.3%
  800  1000    20     31570     183.6    0.5%
  810  1000    20     32370     96.97    0.2%
  820  1000    20     31950     294.9    0.9%
  830  1000    20     32490     200.1    0.6%
  840  1000    20     33220     185.8    0.5%
  850  1000    20     32930     143.3    0.4%
  860  1000    20     32700     130.5    0.3%
  870  1000    20     33290     223.9    0.6%
  880  1000    20     32920     383.8    1.1%
  890  1000    20     33570     189.1    0.5%
  900  1000    20     33250     297.6    0.8%
  910  1000    20     33830     181.9    0.5%
  920  1000    20     34270     192.3    0.5%
  930  1000    20     33850     277.9    0.8%
  940  1000    20     34240     190.9    0.5%
  950  1000    20     34050     152.5    0.4%
  960  1000    20     34730     117.4    0.3%
  970  1000    20     34960     264.7    0.7%
  980  1000    20     35650     230.1    0.6%
  990  1000    20     35250     248.8    0.7%
 1000   500    20     25990     78.59    0.3%
 1000   510    20     25880     116.1    0.4%
 1000   520    20     26060     142.7    0.5%
 1000   530    20     26290     173.6    0.6%
 1000   540    20     26200     134.9    0.5%
 1000   550    20     26120     78.85    0.3%
 1000   560    20     26870     138.9    0.5%
 1000   570    20     26920     157.7    0.5%
 1000   580    20     27160     101.4    0.3%
 1000   590    20     27660     156.4    0.5%
 1000   600    20     27130     161.1    0.5%
 1000   610    20     27620       110    0.3%
 1000   620    20     28720     136.6    0.4%
 1000   630    20     28190     179.7    0.6%
 1000   640    20     28280     142.1    0.5%
 1000   650    20     28180     121.9    0.4%
 1000   660    20     28480     164.7    0.5%
 1000   670    20     28910     282.7    0.9%
 1000   680    20     29270     152.8    0.5%
 1000   690    20     29270     135.1    0.4%
 1000   700    20     29560     127.6    0.4%
 1000   710    20     29810     125.7    0.4%
 1000   720    20     30380     144.8    0.4%
 1000   730    20     29380     135.5    0.4%
 1000   740    20     30640     237.9    0.7%
 1000   750    20     30300       213    0.7%
 1000   760    20     30760     149.2    0.4%
 1000   770    20     31400     194.9    0.6%
 1000   780    20     31240     132.5    0.4%
 1000   790    20     31230     164.8    0.5%
 1000   800    20     31970     154.2    0.4%
 1000   810    20     32140     222.6    0.6%
 1000   820    20     32000     262.8    0.8%
 1000   830    20     32040     261.2    0.8%
 1000   840    20     32230     216.5    0.6%
 1000   850    20     32770     141.5    0.4%
 1000   860    20     32830     190.7    0.5%
 1000   870    20     32640     122.9    0.3%
 1000   880    20     33900     121.5    0.3%
 1000   890    20     32550     212.9    0.6%
 1000   900    20     33710     123.9    0.3%
 1000   910    20     34000     201.8    0.5%
 1000   920    20     34240     233.3    0.6%
 1000   930    20     34210     119.5    0.3%
 1000   940    20     33790     143.9    0.4%
 1000   950    20     34760     124.9    0.3%
 1000   960    20     35060     117.2    0.3%
 1000   970    20     34800     211.6    0.6%
 1000   980    20     34980     175.6    0.5%
 1000   990    20     35980     212.4    0.5%
 1000  1000     1     35290     162.7    0.4%
 1000  1000     2     35530     207.7    0.5%
 1000  1000     3     35260     330.1    0.9%
 1000  1000     4     35940       196    0.5%
 1000  1000     5     36180     173.8    0.4%
 1000  1000     6     35420     158.5    0.4%
 1000  1000     7     35190     110.7    0.3%
 1000  1000     8     35560     179.5    0.5%
 1000  1000     9     35660     162.1    0.4%
 1000  1000    10     35960       130    0.3%
 1000  1000    11     35370     180.9    0.5%
 1000  1000    12     35680     233.5    0.6%
 1000  1000    13     35860     271.8    0.7%
 1000  1000    14     36720     161.5    0.4%
 1000  1000    15     35910     223.9    0.6%
 1000  1000    16     35730     256.8    0.7%
 1000  1000    17     35720     175.1    0.4%
 1000  1000    18     36200       165    0.4%
 1000  1000    19     35950     254.1    0.7%
 1000  1000    20     36800     153.2    0.4%

Quality and confidence:
param     error
v         0.095
n         0.095
s         3.232

Model:
Time ~=        0
    + v    18.43
    + n    20.38
    + s     4.87
              µs

Reads = 204 + (3 * v) + (4 * n) + (1 * s)
Writes = 0 + (0 * v) + (0 * n) + (0 * s)

Pallet: "pallet_staking", Extrinsic: "get_npos_targets", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking Validators (r:501 w:0)

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

Model:
Time ~=        0
    + v    7.568
              µs

Reads = 1 + (1 * v)
Writes = 0 + (0 * v)

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

Data points distribution:
    v   mean µs  sigma µs       %
  500      3674     24.63    0.6%
  510      3603     24.73    0.6%
  520      3855     50.18    1.3%
  530      3934      26.8    0.6%
  540      3931     42.88    1.0%
  550      4072     24.31    0.5%
  560      4146     16.72    0.4%
  570      4208     37.31    0.8%
  580      4255     41.02    0.9%
  590      4266     15.47    0.3%
  600      4452     40.22    0.9%
  610      4503     43.48    0.9%
  620      4702     29.69    0.6%
  630      4747     53.05    1.1%
  640      4899     62.89    1.2%
  650      4835     58.29    1.2%
  660      4743     39.46    0.8%
  670      4941     44.74    0.9%
  680      5156     42.12    0.8%
  690      5014     39.26    0.7%
  700      5313     52.19    0.9%
  710      5284     34.77    0.6%
  720      5335     31.65    0.5%
  730      5479     33.83    0.6%
  740      5494     59.87    1.0%
  750      5605      76.2    1.3%
  760      5637     43.08    0.7%
  770      5733     67.25    1.1%
  780      5986     66.93    1.1%
  790      5792     57.63    0.9%
  800      5884     24.92    0.4%
  810      6101     64.72    1.0%
  820      6112     52.66    0.8%
  830      6180     38.97    0.6%
  840      6184     48.04    0.7%
  850      6265     39.58    0.6%
  860      6432     66.41    1.0%
  870      6276     51.32    0.8%
  880      6509     47.08    0.7%
  890      6633     48.03    0.7%
  900      6734     28.08    0.4%
  910      6909     79.59    1.1%
  920      6872     65.09    0.9%
  930      7047     61.75    0.8%
  940      6907     45.74    0.6%
  950      6988     62.95    0.9%
  960      7141      64.5    0.9%
  970      7079     34.14    0.4%
  980      7336     47.38    0.6%
  990      7548     52.06    0.6%
 1000      7427     42.39    0.5%

Quality and confidence:
param     error
v         0.029

Model:
Time ~=        0
    + v    7.552
              µs

Reads = 1 + (1 * v)
Writes = 0 + (0 * v)

Pallet: "pallet_staking", Extrinsic: "set_staking_configs_all_set", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking MinCommission (r:0 w:1)
Storage: Staking MinValidatorBond (r:0 w:1)
Storage: Staking MaxValidatorsCount (r:0 w:1)
Storage: Staking ChillThreshold (r:0 w:1)
Storage: Staking MaxNominatorsCount (r:0 w:1)
Storage: Staking MinNominatorBond (r:0 w:1)

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

Model:
Time ~=    3.597
              µs

Reads = 0
Writes = 6

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

Model:
Time ~=    3.597
              µs

Reads = 0
Writes = 6

Pallet: "pallet_staking", Extrinsic: "set_staking_configs_all_remove", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking MinCommission (r:0 w:1)
Storage: Staking MinValidatorBond (r:0 w:1)
Storage: Staking MaxValidatorsCount (r:0 w:1)
Storage: Staking ChillThreshold (r:0 w:1)
Storage: Staking MaxNominatorsCount (r:0 w:1)
Storage: Staking MinNominatorBond (r:0 w:1)

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

Model:
Time ~=    3.198
              µs

Reads = 0
Writes = 6

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

Model:
Time ~=    3.198
              µs

Reads = 0
Writes = 6

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

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

Model:
Time ~=    55.72
              µs

Reads = 11
Writes = 6

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

Model:
Time ~=    55.72
              µs

Reads = 11
Writes = 6

Pallet: "pallet_staking", Extrinsic: "force_apply_min_commission", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking MinCommission (r:1 w:0)
Storage: Staking Validators (r:1 w:1)

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

Model:
Time ~=    8.946
              µs

Reads = 2
Writes = 1

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

Model:
Time ~=    8.946
              µs

Reads = 2
Writes = 1


…--manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
@kianenigma
Copy link
Contributor

bot merge

@paritytech-processbot
Copy link

Error: Approval criteria was not satisfied in paritytech/polkadot#5018.

The following errors might have affected the outcome of this attempt:

Merge failed. Check out the criteria for merge. If you're not meeting the approval count, check if the approvers are team members of substrateteamleads or core-devs.

@kianenigma
Copy link
Contributor

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 21cadf1 into paritytech:master Mar 3, 2022
arkpar pushed a commit to paritytech/polkadot that referenced this pull request Mar 3, 2022
* Revise how staking configurations are set

companion PR to paritytech/substrate#10955

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Revise how staking configurations are set

fixes paritytech#10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <[email protected]>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <[email protected]>

* Format

* Fix build

* Update weights.rs

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

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Revise how staking configurations are set

fixes paritytech#10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <[email protected]>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <[email protected]>

* Format

* Fix build

* Update weights.rs

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

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Revise how staking configurations are set

fixes paritytech#10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <[email protected]>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <[email protected]>

* Format

* Fix build

* Update weights.rs

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

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
driemworks added a commit to ideal-lab5/substrate-offchain-ipfs that referenced this pull request May 9, 2022
* Make some UI test expectations crisper (#10791)

* Make some UI test expectations crisper

* Update frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs

* Update UI test expectations

* Missing newlines

* More whitespace issues

* contracts: `is_contract(address)` and `caller_is_origin()` are added to API (#10789)

* is_contract() and caller_is_origin() added to Ext API

* is_contract() exposed in wasm runtime.rs

* + test for is_contract()

* + seal_is_contract benchmark

* caller_is_origin() exposed to wasm/runtime.rs and covered by a test

* + seal_caller_is_origin benchmark

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <[email protected]>

* identation fix for benchmark macroses; test cosmetic improvement

* benchmark fix

* + is_contract() wasm test

* + caller_is_origin() wasm test

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <[email protected]>

* is_contract() to borrow param instead of taking ownership

* phrasing improved

Co-authored-by: Hernando Castano <[email protected]>

* fixed wasm tests according to @athei feedback

* dead code warnings suppressed by unstable-interface attributes

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

Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>
Co-authored-by: Parity Bot <[email protected]>

* maybe_total_supply in pallet-assets (#10799)

* maybe_total_supply in pallet-assets

* Update frame/assets/src/functions.rs

Co-authored-by: Bastian Köcher <[email protected]>

* Referenda and Conviction Voting pallets (#10195)

* Initial draft of new referendum state machine.

* Docs

* Fixes

* Fixes

* Add conviction-voting pallet

* Basic build

* Building

* Some TODOs

* Tests building

* Add missing file

* Basic lifecycle test

* Add couple of tests

* Another test

* More tests

* Fixes

* Fixes

* Formatting

* Fixes

* Tests

* Fixes

* Fixes

* More tests

* Formatting

* First few benchmarks

* First few benchmarks

* Defered queue servicing

* More testing

* Benchmarks

* Fiddly benchmark

* Final nudge benchmarks

* Formatting

* Formatting

* Finished up benchmarks

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

* Events finished

* Missing file

* No GenesisConfig for Referenda

* Formatting

* Docs

* Docs

* Docs

* Per-class conviction voting

* New test & mock utils

* More tests

* Tests

* Tests finished 🎉

* Benchmarking stuff

* Fixes

* Test harness

* Test harness

* Benchmarks for Conviction=Voting

* Benchmarking pipeline complete

* Docs

* Formatting

* Remove unneeded warning

* Fix UI tests

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

* Docs

* Update frame/conviction-voting/src/vote.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

* update sp-runtime version

* MEL Fixes for Referenda and Conviction Voting (#10725)

* free maxencodedlen

* more maxencodedlen

* more MEL

* more mel

* disable storage info

* More Referenda Patches (#10760)

* basic fixes

* fix benchmarking

* fix license

* prevent panic in curve math

* fmt

* bump crate versions

* Update mock.rs

Co-authored-by: Parity Bot <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>

* More efficient WASM instance memory decommit on macos (#10801)

* More efficient WASM instance memory decommit on macos

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <[email protected]>

* Updated error message

Co-authored-by: Alexander Theißen <[email protected]>

* make inner field of IdentityFields pub (#10773)

* Corrected description of clear_attribute extrinsic (#10729)

* block validators after X sessions, update mock runtime for test

* sp-maybe-compressed-blob: reduce boilerplate code (#10814)

Signed-off-by: koushiro <[email protected]>

* `seal_delegate_call` api function (support for library contracts)  (#10617)

* seal_call_code implementation

- tests
- benchmark

* Addressing @xgreenx's comments

* Fix test-linux-stable-int

* Rename seal_call_code to seal_delegate_call

* Pass value unchanged into lib contract

* Address @athei's comments

- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call

* Do not pass CallFlags::ALLOWS_REENTRY for delegate_call

* Update comment for seal_delegate_call and CallFlags

* Addressing @athei's comments (minor)

* Allow reentry for a new frame after delegate_call (revert)

* Same seal_caller and seal_value_transferred for lib contract

- test
- refactor frame args due to review
- logic for seal_caller (please review)

* Put caller on frame for delegate_call, minor fixes

* Update comment for delegate_call

* Addressing @athei's comments

* Update weights generated by benchmark

* Improve comments

* Address @HCastano's comments

* Update weights, thanks @joao-paulo-parity

* Improve InvalidCallFlags error comment

* Add Storage Info to Various Pallets (#10810)

* atomic swap

* bounties

* bounties fmt

* gilt

* indices

* nicks

* randomness-collective-flip

* recovery

* reuse maxapprovals

* Update tests.rs

* Update frame/randomness-collective-flip/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* use the correct bound

* complete recovery

* use `bounded_vec` macro

* Update tests.rs

* transaction payment

* uniques

* mmr

* example offchain worker

* beefy-mmr

* Update frame/recovery/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Use BoundedVec instead of a type-parameterized BoundedString

* cargo fmt

* Update frame/atomic-swap/src/lib.rs

* use config const

* Update lib.rs

* update mel_bound

* fmt

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Keith Yeung <[email protected]>

* fixed regression in inline docs (#10819)

* try-runtime-cli: Add to docs (#10822)

* try-runtime-cli: Add to docs of pre/post hooks

* Add note about --ws-max-out-buffer-capacity 1000

* Bump serde from 1.0.132 to 1.0.136 (#10816)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.132 to 1.0.136.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.132...v1.0.136)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* uodate tests, ipfs tests failing

* --dev implies --tmp (#10828)

* Add a new host function for reporting fatal errors; make WASM backtraces readable when printing out errors (#10741)

* Add a new host function for reporting fatal errors

* Fix one of the wasmtime executor tests

* Have `#[runtime_interface(wasm_only)]` actually mean WASM-only, and not no_std-only

* Print out errors through `Display` instead of `Debug`

* Switch one more trait to require `Error` for its error instead of only `Debug`

* Align to review comments

* specify ipfs version, update tests

* Add db params for export-state CLI command (#10830)

* update tests, cleanup

* Allow `SetBalance` to handle error when trying to kill acount with reference counter. (#10826)

* bug found

* fix logic

* a little simpler

* add test

* UncheckedExtrinsic: Harden decode and clarify `EXTRINSIC_FORMAT_VERSION` (#10829)

* UncheckedExtrinsic: Harden decode and clarify `EXTRINSIC_FORMAT_VERSION`

* Apply suggestions from code review

* fix typo

* pallet-staking: Add extrinsic `force_apply_min_commission` (#10786)

* pallet-staking: Add extrinsic `force_apply_min_commission`

* Add benchmarks

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

* Bound iteration by  max_validator_count

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

* Only apply to 1 validator

* Update doc comments

* Uncomment tests

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

* Accept signed origins

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

* Remove contains_key check

* Add test for try_mutate_exists

* Impove try_mutate_exists docs

* Delete redundant try_mutate_exists tests;

* Delete residual from removed test

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

* Return an error when the stash does not exist

* Update try_mutate_exist doc wording

* Update frame/staking/src/pallet/mod.rs

* Apply suggestions from code review

Co-authored-by: Parity Bot <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>

* Upgradable contracts using `set_code` function (#10690)

* poc logic

* set_code_hash impl, tests, benchmark

* Address @xgreenx's comments

* Move func defs closer to set_storage

* Check if code exists

- increment/decrement codehash refcount

* Document error for non-existing code hash

* Revert unrelated change

* Changes due to @athei's review

* Fix error handling

- comment errors: ReturnCodes
- update mock ext implementation
- return Error::CodeNotFound when no code for such hash

* Emit ContractCodeUpdated when setting new code_hash

* Address @athei's comments

* Move related defs to the bottom

* Minor comment update

Co-authored-by: Alexander Theißen <[email protected]>

* Improve docs

* Improve docs

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <[email protected]>

* Refactor set_code_hash test

* Minor change to benchmark

Co-authored-by: Alexander Theißen <[email protected]>

* Minor change to benchmark

Co-authored-by: Alexander Theißen <[email protected]>

* Minor comment refactor

Co-authored-by: Alexander Theißen <[email protected]>

* Address @HCastano's comments

* Update seal_set_code_hash comment

Co-authored-by: Hernando Castano <[email protected]>

* Move set_code_hash after delegate_call

* Move function to the bottom

* Moved and changed banchmark, added verify block

* Bring back previous benchmark

* Remove skip_meta for seal_set_code_hash

* Bring back skip_meta for seal_set_storage_per_new_kb

* Apply weights

Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>

* Separate wasmi and wasmer sandbox implementations into their own modules (#10563)

* Moves wasmi specific `ImportResolver` and `MemoryTransfer` impls to submodule

* Splits context store environmental, moves impl `Externals` to wasmi backend

* Adds wasmer sandbox backend stub module

* Move sandbox impl code to backend specific modules

* Moves wasmi stuff

* Fixes value conversion

* Makes it all compile

* Remove `with_context_store`

* Moves `WasmerBackend` to the impl

* Reformat the source

* Moves wasmer MemoryWrapper

* Reformats the source

* Fixes mutability

* Moves backend impls to a submodule

* Fix visibility

* Reformat the source

* Feature gate wasmer backend module

* Moves wasmi memory allocation to backend module

* Rename WasmerBackend to Backend

* Refactor dispatch result decoding, get rid of Wasmi types in common sandbox code

* Reformat the source

* Remove redundant prefixes in backend functions

* Remove wasmer-sandbox from default features

* Post-review changes

* Add conversion soundness proof

* Remove redundant prefix

* Removes now redundant clone_inner

* Add `Error::SandboxBackend`, refactor invoke result

* Fix comments

* Rename `Error::SandboxBackend` to `Sandbox`

* Simplifies logic in `wasmer_backend::invoke`

* Fixes memory management

* Show Network ID when creating and inspecting (#10838)

Signed-off-by: Antonio Yang <[email protected]>

* Reduce overhead of generating network event metrics (#10839)

* Fix reentrancy of FrozenBalance::died hook (#10473)

* assets: execute `died` hook outside of mutate

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: extend tests for `died` hook

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: update doc of FrozenBalance::died

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: review fixes

- fix cases where `died` should not have been called
- use `Option<DeadConsequence>` instead of `DeadConsequence`

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: update comment in mock.rs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: return `Remove` in dead_account

The return value is ignored in the only case that it is produced
by a call, but having it this way makes it more understandable.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* allow trailing comma (#10841)

* build-script-utils: allow reading the git commit hash from env var (#10845)

* build-script-utils: allow reading the git commit hash from env var

* build-script-utils: make the env var name substrate specific

* Don't create DB leaves when syncing historic blocks (#10844)

* Don't create DB leaves when syncing historic blocks

* Changed leaves check and added test

* fmt

* cleanup, use unsigned tx when appropriate

* add weights

* fix broken link (#10846)

* subkey: Support `--version` cli command (#10853)

* subkey: Support `--version` cli command

* FMT :facepalm:

* Remove `u32_trait` (#10850)

* Remove `u32_trait`

This trait only existed because there wasn't any const generic support at time of creation. However,
we now have support for it :)

* FMT

* wasm-builder: Support latest nightly (#10837)

* wasm-builder: Support latest nightly

With latest nightly, aka rust version 1.60+ namespaced features are added. This changes the handling
of optional dependencies. We currently have features that enable optional dependencies when `std` is
enabled. This was before no problem, but now the wasm-builder detects them as enabled. To support
the transition period until 1.60 is released as stable, this pr adds an heuristic to not enable these
optional crates in the wasm build when they are enabled in the `std` feature. This heuristic fails
when someones enables these optional dependencies from the outside as well as via the `std` feature,
however we hope that no one is doing this at the moment. When namespaced features are enabled, these
dependencies needs to be enabled using `dep:dependency-name` to solve this properly.

https://doc.rust-lang.org/cargo/reference/unstable.html#namespaced-features

* Remove accidentally added features

* update tests, remove unneeded params

* min authorities check before removal

* contracts: Fix `seal_call` weights (#10796)

* Fix call weights

* Fix instantiate benchmark

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

* Remove stale and superflous comments

* `decrement_refcount` should be infallible

* Don't hardcode increment_refcount, decrement_refcount

* Rename CopyIn/CopyOut

* Fix warning in tests

Co-authored-by: Parity Bot <[email protected]>

* Enable the `parking_lot` feature for `tokio` (#10855)

* [ci] fix publish-rustdocs (#10858)

* Fix beefy mock ecdsa keys (#10854)

Compressed ECDSA keys requires to have 0x02 or 0x03 as their first byte
in order to allow public key recovery.

Nevertheless the test was working because of the `unwrap_or_default()`
at the end of the conversion routine (i.e. the invalid keys were
converted to an empty vector).

* Mark sync_state_genSyncSpec JSON-RPC as safe (#10832)

* Mark sync_state_genSyncSpec JSON-RPC as safe

* Note that parameter is unused

* Ideally I'd wait for compilation to be finished before pushing, but it's really taking a long time

* Remove deny_unsafe parameter

* Remove unused dependency

* Reduce CPU overhead of gossip (#10859)

* sp-core-hashing: use the `digest::Digest` trait to handle the hashing function uniformly (#10835)

* sp-core-hashing: use sha3 instead of tiny-keccak

Signed-off-by: koushiro <[email protected]>

* use blake2 instead of blake2-rfc

Signed-off-by: koushiro <[email protected]>

* improve som hashing of sp-core and sp-api-proc-macro

Signed-off-by: koushiro <[email protected]>

* Some nits

Signed-off-by: koushiro <[email protected]>

* cargo fmt

Signed-off-by: koushiro <[email protected]>

* Use fully qualified sytnax for `retain_mut` (#10865)

* add llvm (#10864)

* refactor election score (#10834)

* refactor election score

* Test for ord

* remove reference

* vec -> slice

* change iter to iter_by_significance

* improve doc

* fix typo

* add explanation about [u128; 3]

* consolidate threshold and epsilon

* random fixes

* rename

* remove Into

* make iter_by_sig private

* remove vec

* Fix tests

* Measure per byte and not kb for certain benchmarks (#10863)

* Tidy Democracy (#10867)

* add test

* Assorted refactorings

* complete test

* saturating math

* final check

* use `default`

Co-authored-by: Gav Wood <[email protected]>

* cleanup storage maps, cleanup unused imports

* sc-executor: Improve logging (#10869)

Improves the logging by switching to `tracing` for a better log output. Besides that, it also adds a
trace for the function being executed.

* fix test issues

* Track allowed requests for state/warp sync (#10843)

* Track allowed requests for state/warp sync

* Added missing allowed_requests resets

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <[email protected]>

* fmt

Co-authored-by: Bastian Köcher <[email protected]>

* Slots: Ensure that a race betwen finalized and best number is taken care off (#10876)

* Remove old lock file (#10879)

* Further reduce the CPU overhead of networking metrics (#10875)

* Simplify `num_connected_peers`

* Track requested peer counts

* Revert "Track requested peer counts"

This reverts commit 9f1c8704353df6afc17ed7e9f4ab8d8e29466ae4.

* Remove `substrate_sub_libp2p_peerset_num_requested` metric

* Remove two unused functions that I forgot to get rid of in previous commit

* Introduce `BoundedVec::iter_mut` (#10884)

* Introduce iters into BoundedVec

* Fix

* Remove unneeded funcs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <[email protected]>

* Slots: Log total proposing duration as milliseconds (#10886)

Parachains have currently a total proposing time of 500ms, so it this
currently always prints `0`. While actually the value is not `0` ;)

* staking: Clarify reward calc docs (#10890)

* tracing: Adds `init_for_tests` (#10893)

This function is useful for tests. It will enable `TRACE` logging and also uses the libtest aware writer.

* make submissions pub (#10899)

* contracts: Allow stack height metering to be disabled (#10877)

* Allow stack height metering to be disabled

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

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

Co-authored-by: Parity Bot <[email protected]>

* Rename Uniques Error::Unknown to something more sensible (#10895)

* Rename Uniques Error::Unknown to something more sensible

* Typos

* Typos

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* state-machine: Move all functionality from trie backend to the essence (#10904)

* state-machine: Move all functionality from trie backend to the essence

This is required for some future changes of me and it also makes more sense to have all the
functionality inside the essence. Besides that it changes the child root cache to directly
cache the hash.

* Update primitives/state-machine/src/trie_backend_essence.rs

Co-authored-by: cheme <[email protected]>

* FMT

Co-authored-by: cheme <[email protected]>

* staking: Remove `SessionInterface` supertrait (#10901)

* consensus-slots: cleanup SlotDuration config (#10878)

* consensus-slots: cleanup the SlotDuration config

* fix tests

* address review comments

* add contracts pallet + rpc to runtime

* Replace libsecp256k1 with k256 in FRAME related code (#10883)

* Replace libsecp256k1 with k256 in beefy-mmr

* Port of FRAME `contracts` benchmarking from `libsecp256k1` to `k256`

* Newtype to allow `Pcg32` rng usage with `k256` in contracts benchmarks

* Use `sp-io::crypto` to generate dummy keys in `contracts` bechmarks

* More compact code

* Cargo fmt

* Build `sp-keystore` only for dev profile

* Move public key generation back to the `map`

* Clean obsolete BABE's weight data (#10748)

* Clean obsolete BABE weight data
* Take out test assertion from check closure
* Optimize metadata access using `HeaderMetadata` trait
* Apply suggestions from code review
* Introduce finalize and import pre-commit synchronous actions
* Do not hold locks between internal methods calls
* Remove unused generic bound
* Apply suggestions from code review
* Register BABE's pre-commit actions on `block_import` instead of `start_babe`
* PreCommit actions should be `Fn` instead of `FnMut`
* More robust safenet in case of malformed finality notifications

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: André Silva <[email protected]>

* Factor DB weights out into their own files (#10908)

* Factor DB weights out into their own files

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Weights in own mod

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Get rid of unnecessary use of `async-std` in non-test code (#10891)

* No longer generate specs with consensus_engine field (#10346)

* No longer generate specs with consensus_engine field

* #[allow(unused)]

* Upgrading parity-scale-codec to v3 (#10825)

* Upgraded dependencies

* Adapting code to scale v3

* Empty commit to trigger CI

* Triggering CI

* Fixing UI test

* Remove superfluous dev-dep added by #9228

* Cryout for CI

* sc-cli: Fix bugs after switching to clap3 (#10920)

* sc-cli: Fix bugs after switching to clap3

Before switching to clap3 we support cli options like `--reserved-nodes A B` and after you needed to
pass `--reserved-nodes` cli option multiple times `--reserved-nodes A --reserved-nodes B`. This is
fixed by setting `multiple_occurrences(true)` option. This also done for all the other `Vec` cli
options in `sc-cli`. Besides that `--sync` wasn't supporting case insensitive parsing of the value.
This is now also supported. For both regressions a test is added. Besides that the pr removes all
the `rename_all = PascalCase` attributes, because they are not needed. All other `ArgEnum`s were
checked and all are already using `ignore_case(true)`.

* Bring back `PascalCase`, because otherwise it falls back to `kebab-case`...

* Storage benchmarking (#10897)

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* WIP: DB benchmarking

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Simplify code

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove old files

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove old files

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Minimize changes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add license

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove dependencies

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Extend template

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Linter

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Linter

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Beauty fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove default

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add feature

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove seed

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* CI wakeup

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Adding doc

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Adding doc

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Improve template

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Do not expose columns

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix ColumnId

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Nicer template prints

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix json path

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Simplify `bench_write` logic

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Invert tx before the second commit

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* add transfer assets extrinsic

* add chain ext

* Minor improvements to `bounded_vec` and `defensive`.  (#10873)

* Fix a few things in bounded_vec

* add test for try_extend

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <[email protected]>

* some review comments

* use swap

* remove clone

* use pop instead of truncate

* remove warn

* review comments

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <[email protected]>

* fix rustdoc

* fix links

* undo link

Co-authored-by: Bastian Köcher <[email protected]>

* Replace libsecp256k1 with secp256k1 (#10798)

* Replace libsecp256k1 with secp256k1

* Wipe ecdsa secret key from memory on drop

* Some comments for a known issue

* Safer core crypto primitives `from_slice` constructor

Previous version panics if slice lenght is not the expected one.

* Unit test fix

* Enable use of global secp256k1 context

* Better comments for ecdsa `Pair` drop

* Replace `libsecp256k1` with `seco256k1` in `beefy-mmr`

Used to convert ecdsa public key to ETH address

* Replace `libsecp256k1` with `secp256k1` in FRAME `contracts`benchmarks

* Temporary rollback of `beefy-mmr` to libsecp256k1

Check for detected build issues

* Cargo fmt

* Rollback of FRAME `contracts` benchmarks to `libsecp256k1`

* Rollback for unrelated changes

* Typo fix

* Add comments for deprecated `ecdsa_verify` and `secp256k1_ecdsa_recover`

* Integrate try-runtime into substrate node template (#10909)

* [10892-integrate-try-runtime-into-node-template] - Integrated try-runtime into node template

* [10892-integrate-try-runtime-into-node-template] Added match arms for try-runtime in command.rs

* [10892-integrate-try-runtime-into-node-template] Added match arms for try-runtime in command.rs

* Added feature flag for try-runtime in node-template/node and enabled try-runtime for node-template/runtime

* Added missing type annotations for try-runtime SubCommand in node-template

* Added missing type annotations for try-runtime SubCommand in node-template

* Implemented frame_try_runtime::TryRuntime<Block> for the node-template Runtime

* doc corrections (#10936)

* #10576: generic utility to unsubscribe from broadcast upon drop of the rx-side. (#10708)

* #10576: refactor `sc-utils::notification` and `sc-client-api::notifications`, so that they use common subscribe/unsubscribe routines

* Add some docs. Reorganise `sc-utils::notification`

* `sc-clent-api::notifications` and `sc-utils::notification` — ensure the SubscriptionGuard is dropped before the Rx-channel

* `sc-utils::pubsub::SubscriptionGuard` make it a bit more ergonomic.

Let the `Rx` to be put inside of the `SubscriptionGuard`, so that the latter shall guarantee the order:
- first unsubscribe;
- then drop the `Rx`.

* Being less zealous with splitting the modules into little pieces

* rework pubsub: the concrete usage should only define a good registry type

* sc-client-api::notifications: make it comply with the reworked pubsub

* cargo fmt

* make sc-client-api tests work

* Address the review notes

* cargo fmt

* Describe the behaviour of pubsub registry

* Doc-comments for module `sc-utils::pubsub`

* Fix: it used to send notifications regardless of the filter setup during subscription

* `sc-client-api::StorageNotifications` the API does not have to require mut-self-reference.

As a result `sc-service::Client` does not have to wrap its `storage_notifications` into a Mutex.

* cargo fmt

* Several changes addressing the notes by @bckhr.

- Remove the `impl Default for StorageNotifications<Block>`;
- no need for groupping the `remove_from` and `listen_from` into a separate `helpers` module;
- remove unnecessary import `use registry::SubscribeOp`.

* Add a doc-comment to the `sc-client::notifications::SubscribeOp`

* As per @bkchr note on the unproven assertion: behave gracefully upon receiving a duplicate subscription-ID.

* sc-utils::pubsub: log when a registry yields an ID that does point to an existing sink

* `sc-utils::notifications`: payload materialized lazily

* Update Cargo.lock (after adding `log` as a dependency to the `sc-utils`)

* `sc-client-api::notifications`: introduce a struct (instead of a type def) for the notification message

* Get rid of `sc-utils::pubsub::Channel` trait (instead just use the `sc-utils::mpsc`)

* The SubsID is no more generic: the fact it is a `Copy` is known — no need to pass it by ref

* sc-utils::pubsub internals do not have to be generic over the channel type

* Rename Hub::dispatch into Hub::send

* That method was unnecessary (`SubscriberSink::render_notification`)

* cargo fmt

* No need for a separate UnsubscribeGuard type

* Ditch the type-def of SubsID in the sc-utils::pubsub, instead — just use the crate::id_sequence::SeqID

* Return the <Registry as Dispatch>::Ret when sending an item

* Make the `Hub<M, R>::lock_registry(...)` method more ergonomic

* cargo doc links

* cargo doc links

* Use a simpler name for the type

* cargo doc links

* Derive `Default` rather than implement it

* Derive `Default` rather than implement it

* Remove an unnecessary usage of type_name

* Define a more cautious order between sinks.remove->registry.unsubscribe and registry.subscribe->sinks.insert

* Hub: lock_registry_for_tests->map_registry_for_tests — a safer choice for a public API

* Replace Mutex over the shared Registry with a ReentrableMutex+RefCell

* sc-utils::pubsub: add tests for a panicking registry

* Add the missing copyright headers

* Arc<Vec<_>> -> Arc<[_]>

* Bring back MaxNominations as a metadata constant (#10947)

* chain ext: parse params and call transfer func

* Bump futures from 0.3.16 to 0.3.19 (#10930)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.16 to 0.3.19.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.16...0.3.19)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Clean up extra_constant renaming. (#10935)

Co-authored-by: Xiankun Cheng <[email protected]>

* Bump smallvec from 1.7.0 to 1.8.0 (#10949)

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* new pallet: whitelist pallet (#10159)

* pallet whitelist

* refactor a bit

* fmt

* address audit

* improve tests

* return Ok + refund

* add test for dispatching failing

* add dispatch_whitelisted_call_with_preimage

* fmt

* better name

* Consume all data on decode

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add error docs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove phantom data

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use rust 2021

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update crate features

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

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

* Bump Preimage max size

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

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

* Fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Parity Bot <[email protected]>

* Release primitive crates (#10937)

* cargo set-version --bump major -p pallet-contracts-primitives

* cargo set-version --bump major -p sp-core

* cargo set-version --bump major -p sp-runtime-interface

* cargo set-version --bump major -p sp-wasm-interface

* cargo set-version --bump major -p sp-runtime

* cargo set-version --bump major -p sp-storage

* cargo set-version --bump major -p sp-rpc

* cargo set-version --bump major -p sp-io

* cargo set-version --bump major -p sp-trie

* cargo set-version -p sp-state-machine  -- 0.12.0

* cargo set-version -p sp-externalities  -- 0.12.0

* cargo set-version -p sp-keystore -- 0.12.0

* cargo set-version --bump major -p sp-keyring

* cargo set-version --bump major -p sp-version

* cargo set-version --bump major -p sp-tracing

* cargo set-version --bump major -p sp-application-crypto

* cargo set-version --bump major -p sp-arithmetic

* cargo unleash version bump-major -p sp-runtime-interface-proc-macro

* Add codec max-encoded-len feature to sp-arithmetic

* cargo unleash version bump-major -p sp-core-hashing-proc-macro

* Update new whitelist pallet to new primitive versions (#10953)

* sp-trie: Switch to thiserror and some other small cleanups (#10954)

* sp-trie: Switch to thiserror and some other small cleanups

* Add some extra method for converting a compact proof to a memory db

* Only maintain at most 1 `UnlockChunk` per era (#10670)

* Only maintain at most 1 `UnlockChunk` per era

* Bound `unlocking`

* Run cargo +nightly-2021-10-29 fmt

* Make benchmarks stuff compile

* Update frame/staking/src/lib.rs

Co-authored-by: Kian Paimani <[email protected]>

* Remove DerefMut; Implement neccesary methods directly

* Doc comments for new BoundedVec methods

* Fix benchmarks

* wip bonded_vec macro

* Correct rust doc

* Apply suggestions from code review

Co-authored-by: Kian Paimani <[email protected]>

* Update staking::Config impls

* Add MaxUnlockingChunks to more places

* Use defensive saturating add

* FMT

Co-authored-by: Kian Paimani <[email protected]>

* staking: Expose `MaxUnlockingChunks` in metadata as a const (#10958)

* Allow trailing commas for `bounded_vec!` (#10959)

* SimpleSlotWorker: Do not implement `SlotWorker` for all types implementing `SimpleSlotWorker` (#10934)

Because Rust currently doesn't support specialization, it prevents users from implementing
`SlotWorker` for their own types. This pr solves this by removing the generic implementation of
`SlotWorker` for `SimpleSlotWorker` and providing some wrapper type for that.

* Bump digest from 0.10.2 to 0.10.3 (#10960)

Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.2...digest-v0.10.3)

---
updated-dependencies:
- dependency-name: digest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump scale-info from 2.0.0 to 2.0.1 (#10965)

Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/paritytech/scale-info/releases)
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/scale-info/commits)

---
updated-dependencies:
- dependency-name: scale-info
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add pr-custom-review config (#10968)

* Revise how staking configurations are set (#10955)

* Revise how staking configurations are set

fixes #10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <[email protected]>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <[email protected]>

* Format

* Fix build

* Update weights.rs

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

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Parity Bot <[email protected]>

* Bump libc from 0.2.112 to 0.2.119 (#10967)

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.112 to 0.2.119.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.112...0.2.119)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump parity-db from 0.3.5 to 0.3.8 (#10970)

Bumps [parity-db](https://github.com/paritytech/parity-db) from 0.3.5 to 0.3.8.
- [Release notes](https://github.com/paritytech/parity-db/releases)
- [Commits](https://github.com/paritytech/parity-db/commits/v0.3.8)

---
updated-dependencies:
- dependency-name: parity-db
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [EPM pallet]: remove `number of signed submissions` (#10945)

* [EPM pallet]: remove `number of signed submissions`

Closing #9229

* fix tests

* remove needless assert

* Update frame/election-provider-multi-phase/src/lib.rs

* cargo fmt

Signed-off-by: Niklas <[email protected]>

* fix grumbles

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

* drop `num_signed_submissions` in WeightInfo too

* fix build

Co-authored-by: Parity Bot <[email protected]>

* Refactored block body database scheme (#10779)

* Refactored tx storage database scheme

* Bump parity-db

* fmt

* Fix handling invalid index size + test

* Removed superflous result

* Minor changes

* fmt

* Deprecate "paritydb-experimental" CLI in favour or "paritydb" (#10975)

* Deprecate paritydb-experimental

* Updated comment

* [contracts] Stabilize "seal0" `is_contract` and `caller_is_origin`  (#10971)

* stabilize `seal_is_contract`

* stabilize `seal_caller_is_origin`

* Trie version migration pallet  (#10073)

* starting

* Updated from other branch.

* setting flag

* flag in storage struct

* fix flagging to access and insert.

* added todo to fix

* also missing serialize meta to storage proof

* extract meta.

* Isolate old trie layout.

* failing test that requires storing in meta when old hash scheme is used.

* old hash compatibility

* Db migrate.

* runing tests with both states when interesting.

* fix chain spec test with serde default.

* export state (missing trie function).

* Pending using new branch, lacking genericity on layout resolution.

* extract and set global meta

* Update to branch 4

* fix iterator with root flag (no longer insert node).

* fix trie root hashing of root

* complete basic backend.

* Remove old_hash meta from proof that do not use inner_hashing.

* fix trie test for empty (force layout on empty deltas).

* Root update fix.

* debug on meta

* Use trie key iteration that do not include value in proofs.

* switch default test ext to use inner hash.

* small integration test, and fix tx cache mgmt in ext.
test  failing

* Proof scenario at state-machine level.

* trace for db upgrade

* try different param

* act more like iter_from.

* Bigger batches.

* Update trie dependency.

* drafting codec changes and refact

* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.

* alt hashing only for branch with value.

* fix trie tests

* Hash of value include the encoded size.

* removing fields(broken)

* fix trie_stream to also include value length in inner hash.

* triedbmut only using alt type if inner hashing.

* trie_stream to also only use alt hashing type when actually alt hashing.

* Refactor meta state, logic should work with change of trie treshold.

* Remove NoMeta variant.

* Remove state_hashed trigger specific functions.

* pending switching to using threshold, new storage root api does not
make much sense.

* refactoring to use state from backend (not possible payload changes).

* Applying from previous state

* Remove default from storage, genesis need a special build.

* rem empty space

* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
changing state.

* fix compilation

* Right logic to avoid switch on reencode when default layout.

* Clean up some todos

* remove trie meta from root upstream

* update upstream and fix benches.

* split some long lines.

* UPdate trie crate to work with new design.

* Finish update to refactored upstream.

* update to latest triedb changes.

* Clean up.

* fix executor test.

* rust fmt from master.

* rust format.

* rustfmt

* fix

* start host function driven versioning

* update state-machine part

* still need access to state version from runtime

* state hash in mem: wrong

* direction likely correct, but passing call to code exec for genesis
init seem awkward.

* state version serialize in runtime, wrong approach, just initialize it
with no threshold for core api < 4 seems more proper.

* stateversion from runtime version (core api >= 4).

* update trie, fix tests

* unused import

* clean some TODOs

* Require RuntimeVersionOf for executor

* use RuntimeVersionOf to resolve genesis state version.

* update runtime version test

* fix state-machine tests

* TODO

* Use runtime version from storage wasm with fast sync.

* rustfmt

* fmt

* fix test

* revert useless changes.

* clean some unused changes

* fmt

* removing useless trait function.

* remove remaining reference to state_hash

* fix some imports

* Follow chain state version management.

* trie update, fix and constant threshold for trie layouts.

* update deps

* Update to latest trie pr changes.

* fix benches

* Verify proof requires right layout.

* update trie_root

* Update trie deps to  latest

* Update to latest trie versioning

* Removing patch

* update lock

* extrinsic for sc-service-test using layout v0.

* Adding RuntimeVersionOf to CallExecutor works.

* fmt

* error when resolving version and no wasm in storage.

* use existing utils to instantiate runtime code.

* migration pallet

* Patch to delay runtime switch.

* Revert "Patch to delay runtime switch."

This reverts commit d35f273b7d67b1b85a9e72973cab13c5c156c1d3.

* fix test

* fix child migration calls.

* useless closure

* remove remaining state_hash variables.

* Fix and add more tests

* Remove outdated comment

* useless inner hash

* fmt

* remote tests

* finally ksm works

* batches are broken

* clean the benchmarks

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Joshy Orndorff <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

* brand new version

* fix build

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Guillaume Thiolliere <[email protected]>

* Update primitives/storage/src/lib.rs

Co-authored-by: cheme <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <[email protected]>

* fmt and opt-in feature to apply state change.

* feature gate core version, use new test feature for node and test node

* Use a 'State' api version instead of Core one.

* fix merge of test function

* use blake macro.

* Fix state api (require declaring the api in runtime).

* Opt out feature, fix macro for io to select a given version
instead of latest.

* run test nodes on new state.

* fix

* new test structure

* new testing stuff from emeric

* Add commit_all, still not working

* Fix all tests

* add comment

* we have PoV tracking baby

* document stuff, but proof size is still wrong

* FUCK YEAH

* a big batch of review comments

* add more tests

* tweak test

* update config

* some remote-ext stuff

* delete some of the old stuff

* sync more files with master to minimize the diff

* Fix all tests

* make signed migration a bit more relaxed

* add witness check to signed submissions

* allow custom migration to also go above limit

* Fix these pesky tests

* ==== removal of the unsigned stuff ====

* Make all tests work again

* separate the tests from the logic so it can be reused easier

* fix overall build

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <[email protected]>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <[email protected]>

* Slightly better termination

* some final tweaks

* Fix tests

* Restrict access to signed migrations

* address most of the review comments

* fix defensive

* New simplified code

* Fix weights

* fmt

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Bastian Köcher <[email protected]>

* make the tests correctly fail

* Fix build

* Fix build

* try and fix the benchmarks

* fix build

* Fix cargo file

* Fix runtime deposit

* make rustdoc happy

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

Co-authored-by: cheme <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Joshy Orndorff <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Parity Bot <[email protected]>

* BEEFY and GRANDPA protocol names should use full genesis hash (#10974)

std::fmt::Display shows formats as reduced hash (e.g. 0xb0a8…dafe)

Use hex::encode to format full hash.

Signed-off-by: acatangiu <[email protected]>

* Move weight constants to own mod (#10980)

* Move block+ext weights to own mod

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Unused import

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* add block usage logs to system pallet (#10940)

* add block usage logs to system pallet

* add Debug

* use % instead of default Debug impl

* change formatting

* revert

* update runtime storage, update chain extension

* cleanup chain ext

* Fix the undeterministic storage proof recorded for the same execution (#10915)

* Add a test case for the determinism of recorded proof

* Replace HashMap with BTreeMap for the actual proof records

* cargo +nightly fmt --all

* Store the trie nodes in BTreeSet for StorageProof

* Nit

* Revert the BTreeMap changes and sort when converting to storage proof

* Remove PartialEq from StorageProof

* Remove unnecessary change

* Add `compare` method to StorageProof

* FMT

* Dummy change to trigger CI

* Use `BTreeSet` for StorageProof and keep using `Vec` for CompactProof

* Update comment on `iter_nodes`

* Revert `PartialEq` removal

* create iris ledger pallet

* ledger funcs in chain ext

* rename Iris -> IrisAssets, update readmes

* Minor Uniques pallet improvements and XCM v3 preparations (#10896)

* Introduce Helper to Uniques for benchmark stuff

* Fixes

* Formatting

* Featuregate the Helper, include ContainsPair

* Introduce & use EnsureOriginWithArg

* Benchmarking

* Docs

* More ContainsBoth helpers

* Formatting

* Formatting

* Fixes

Co-authored-by: Shawn Tabrizi <[email protected]>

* election provider support: Update some test only types (#10983)

* Feedback from @XLC for Referenda Pallet (#10991)

* feedback from @xlc

* english

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Make bags-list generic over node value and instantiable (#10997)

* make instantiable

* update

* cargo fmt

* Clean up

* bags-list: Make it generic over node value

* Respond to some feedback

* Apply suggestions from code review

Co-authored-by: Kian Paimani <[email protected]>

* Add back default impl for weight update worst case

* Update to Score in more places'

* Use VoteWeight, not u64 to reduce test diff

* FMT

* FullCodec implies Codec

* formatting

* Fixup bags list remote test

Co-authored-by: doordashcon <[email protected]>
Co-authored-by: Doordashcon <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>

* sc-finality-grandpa: use the #[from] attriute to remove boilerplate code (#11003)

Signed-off-by: koushiro <[email protected]>

* contracts: Add test to verify unique trie ids (#10914)

* Add test to verify unique trie ids

* Rename trie_seed to nonce

* Rename AccountCounter -> Nonce

* fmt

* sp-core: `full_crypto` doesn't imply `std` (#11006)

* sp-core: `full_crypto` doesn't imply `std`

This pr changes the feature set of `secp256k1` to not use `global-context` when only the
`full_crypto` is enabled. It will be slower when the `std` feature is not enabled as the context
always needs to be recreated, but that is fine.

* Update client/cli/src/arg_enums.rs

Co-authored-by: Davide Galassi <[email protected]>

Co-authored-by: Davide Galassi <[email protected]>

* Remove unused `parent_hash` in `OverlayedChanges::into_storage_changes` (#11011)

Ref https://github.com/paritytech/substrate/pull/10922#issuecomment-1064258443

CC @cheme

* iris ledger pallet -> transfer not yet functioning

* sp-api: Don't be dirty (#11015)

Ensure that the sp api macros don't use functions without providing the full path to the function.
This hygiene ensures that we don't actually try to call a method of an imported trait for example.

* unlock and transfer works

* Update clap to the latest version (#11017)

* Update clap to the latest version

Besides that it also removes some `structopt` leftovers from some docs.

* Fix compile errors

* More fixes

* Move scripts used in CI to the new location (#11008)

Move scripts used in CI to the new location - **./scripts/ci/**

* Move github scripts

* Move more files

* Move ci scripts and fix dependencies

* Update docs/node-template-release.md

Co-authored-by: João Paulo Silva de Souza <[email protected]>

* Remove Cargo.lock

* Apply suggestions from code review

Co-authored-by: Denis Pisarev <[email protected]>

* Make more paths uniform

Co-authored-by: João Paulo Silva de Souza <[email protected]>
Co-authored-by: Denis Pisarev <[email protected]>

* Move `sp-npos-elections-solution-type` to `frame-election-provider-support` (#11016)

* Move `sp-npos-elections-solution-type`
to `frame-election-provider-support`
First stab at it, will need to amend some more stuff

* Fixing tests

* Fixing tests

* Fixing cargo.toml for std configuration

* fmt

* Committing suggested changes
renaming, and re exporting macro.

* Removing unneeded imports

* shell.nix: Update to a newer nightly (#11028)

* update chain ext

* update naming, formatting, start tests

* Update lockfile (#11035)

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Additional `benchmark-storage` flags (#11004)

* Fix typos

* Enable overwriting handlebars template

* Optionally name json output or disable json altogether

* Don't write to json by default

* Include block id in handlebars output

* Include warmups for write benchmarks

* PR comments

* Drop unnecessary file extension

* Use more appropriate types

* Use more appropriate error message

* More use of more appropriate types

* Rework write benchmark warmups

* Run same benchmark for both read and write

* SharedData: Update locks to mention possible deadlocks (#11034)

* SharedData: Update locks to mention possible deadlocks

* Update `Cargo.lock`

* Stabilize `seal_delegate_call` (#11037)

* add tests

* re-enumerate chain ext func ids

* Bump names from 0.12.0 to 0.13.0 (#11047)

Bumps [names](https://github.com/fnichol/names) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/fnichol/names/releases)
- [Changelog](https://github.com/fnichol/names/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnichol/names/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: names
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* State migration rpc (#10981)

* setting flag

* flag in storage struct

* fix flagging to access and insert.

* added todo to fix

* also missing serialize meta to storage proof

* extract meta.

* Isolate old trie layout.

* failing test that requires storing in meta when old hash scheme is used.

* old hash compatibility

* Db migrate.

* runing tests with both states when interesting.

* fix chain spec test with serde default.

* export state (missing trie function).

* Pending using new branch, lacking genericity on layout resolution.

* extract and set global meta

* Update to branch 4

* fix iterator with root flag (no longer insert node).

* fix trie root hashing of root

* complete basic backend.

* Remove old_hash meta from proof that do not use inner_hashing.

* fix trie test for empty (force layout on empty deltas).

* Root update fix.

* debug on meta

* Use trie key iteration that do not include value in proofs.

* switch default test ext to use inner hash.

* small integration test, and fix tx cache mgmt in ext.
test  failing

* Proof scenario at state-machine level.

* trace for db upgrade

* try different param

* act more like iter_from.

* Bigger batches.

* Update trie dependency.

* drafting codec changes and refact

* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.

* alt hashing only for branch with value.

* fix trie tests

* Hash of value include the encoded size.

* removing fields(broken)

* fix trie_stream to also include value length in inner hash.

* triedbmut only using alt type if inner hashing.

* trie_stream to also only use alt hashing type when actually alt hashing.

* Refactor meta state, logic should work with change of trie treshold.

* Remove NoMeta variant.

* Remove state_hashed trigger specific functions.

* pending switching to using threshold, new storage root api does not
make much sense.

* refactoring to use state from backend (not possible payload changes).

* Applying from previous state

* Remove default from storage, genesis need a special build.

* rem empty space

* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
chan…
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Revise how staking configurations are set

fixes paritytech#10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <[email protected]>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <[email protected]>

* Format

* Fix build

* Update weights.rs

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

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
ggwpez pushed a commit to ggwpez/runtimes that referenced this pull request Mar 10, 2023
* Revise how staking configurations are set

companion PR to paritytech/substrate#10955

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
ggwpez pushed a commit to ggwpez/runtimes that referenced this pull request Jul 13, 2023
* Revise how staking configurations are set

companion PR to paritytech/substrate#10955

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revised how staking configurations are set

3 participants