Bound staking storage items (#12230)
* replace pallet level unboundedness to individual storage items * bound structs * bounding history depth * defensive error * use the era history depth from config * clean up history depth from storage in v11 * keep the name HistoryDepth for the new configuration value * use u32 for history depth in node runtime * improve doc comments * add HistoryDepth to mock runtimes with pallet-staking * rustfmt * refactor and doc improve * apply re-benchmarked weight for staking * pr feedback improvements * test for claimed rewards following the expected bounds * refactor test to calculate first and last reward era programmatically * verify previous eras cannot be claimed * add migration v12 * ".git/.scripts/bench-bot.sh" pallet dev pallet_staking * fix compiler error * corrupting history depth does not lead to catastrophic issue * fix new line * remove unused import * fmt * add test to document scenario where history depth is reduced without migration * fmt * Update frame/staking/src/lib.rs Co-authored-by:Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/staking/src/migrations.rs Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> * doc for all storage items bounded by HistoryDepth * Update frame/staking/src/pallet/mod.rs Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/staking/src/tests.rs Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> * pr feedback fixes * Update frame/staking/src/tests.rs Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> * remove extra checks * fix merge * fmt Co-authored-by: command-bot <> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by:
kianenigma <kian@parity.io>
Showing
- substrate/bin/node/runtime/src/lib.rs 2 additions, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/babe/src/mock.rs 1 addition, 0 deletionssubstrate/frame/babe/src/mock.rs
- substrate/frame/grandpa/src/mock.rs 1 addition, 0 deletionssubstrate/frame/grandpa/src/mock.rs
- substrate/frame/nomination-pools/benchmarking/src/mock.rs 1 addition, 0 deletionssubstrate/frame/nomination-pools/benchmarking/src/mock.rs
- substrate/frame/nomination-pools/test-staking/src/mock.rs 1 addition, 0 deletionssubstrate/frame/nomination-pools/test-staking/src/mock.rs
- substrate/frame/offences/benchmarking/src/mock.rs 1 addition, 0 deletionssubstrate/frame/offences/benchmarking/src/mock.rs
- substrate/frame/session/benchmarking/src/mock.rs 1 addition, 0 deletionssubstrate/frame/session/benchmarking/src/mock.rs
- substrate/frame/staking/src/benchmarking.rs 1 addition, 20 deletionssubstrate/frame/staking/src/benchmarking.rs
- substrate/frame/staking/src/lib.rs 25 additions, 13 deletionssubstrate/frame/staking/src/lib.rs
- substrate/frame/staking/src/migrations.rs 47 additions, 5 deletionssubstrate/frame/staking/src/migrations.rs
- substrate/frame/staking/src/mock.rs 2 additions, 0 deletionssubstrate/frame/staking/src/mock.rs
- substrate/frame/staking/src/pallet/impls.rs 16 additions, 9 deletionssubstrate/frame/staking/src/pallet/impls.rs
- substrate/frame/staking/src/pallet/mod.rs 43 additions, 66 deletionssubstrate/frame/staking/src/pallet/mod.rs
- substrate/frame/staking/src/slashing.rs 2 additions, 2 deletionssubstrate/frame/staking/src/slashing.rs
- substrate/frame/staking/src/tests.rs 256 additions, 92 deletionssubstrate/frame/staking/src/tests.rs
- substrate/frame/staking/src/weights.rs 269 additions, 276 deletionssubstrate/frame/staking/src/weights.rs
Loading
Please register or sign in to comment