Commit 048a9c2
Staking: Add
Partially Addresses #2500
Adds a `deprecate_controller_batch` call to the staking pallet that is
callable by `Root` and `StakingAdmin`. To be used for controller account
deprecation and removed thereafter. Adds
`MaxControllersDeprecationBatch` pallet constant that defines max
possible deprecations per call.
- [x] Add `deprecate_controller_batch` call, and
`MaxControllersInDeprecationBatch` constant.
- [x] Add tests, benchmark, weights. Tests that weight is only consumed
if unique pair.
- [x] Adds `StakingAdmin` origin to staking's `AdminOrigin` type in
westend runtime.
- [x] Determined that worst case 5,900 deprecations does fit into
`maxBlock` `proofSize` and `refTime` in both normal and operational
thresholds, meaning we can deprecate all controllers for each network in
one call.
## Block Weights
By querying `consts.system.blockWeights` we can see that the
`deprecate_controller_batch` weights fit within the `normal` threshold
on Polkadot.
#### `controller_deprecation_batch` where i = 5900:
#### Ref time: 69,933,325,300
#### Proof size: 21,040,390
### Polkadot
```
// consts.query.blockWeights
maxBlock: {
refTime: 2,000,000,000,000
proofSize: 18,446,744,073,709,551,615
}
normal: {
maxExtrinsic: {
refTime: 1,479,873,955,000
proofSize: 13,650,590,614,545,068,195
}
maxTotal: {
refTime: 1,500,000,000,000
proofSize: 13,835,058,055,282,163,711
}
}
```
### Kusama
```
// consts.query.blockWeights
maxBlock: {
refTime: 2,000,000,000,000
proofSize: 18,446,744,073,709,551,615
}
normal: {
maxExtrinsic: {
refTime: 1,479,875,294,000
proofSize: 13,650,590,614,545,068,195
}
maxTotal: {
refTime: 1,500,000,000,000
proofSize: 13,835,058,055,282,163,711
}
}
```
---------
Co-authored-by: command-bot <>
Co-authored-by: Gonçalo Pestana <[email protected]>deprecate_controller_batch AdminOrigin call (#2589)1 parent c2d45e7 commit 048a9c2
File tree
19 files changed
+624
-285
lines changed- polkadot/runtime
- test-runtime/src
- westend/src
- weights
- substrate
- bin/node/runtime/src
- frame
- babe/src
- beefy/src
- election-provider-multi-phase/test-staking-e2e/src
- fast-unstake/src
- grandpa/src
- nomination-pools
- benchmarking/src
- test-staking/src
- offences/benchmarking/src
- root-offences/src
- session/benchmarking/src
- staking/src
- pallet
19 files changed
+624
-285
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| 675 | + | |
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
| |||
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | | - | |
| 690 | + | |
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| |||
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
| 703 | + | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| |||
674 | 675 | | |
675 | 676 | | |
676 | 677 | | |
| 678 | + | |
677 | 679 | | |
678 | 680 | | |
679 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
0 commit comments