-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Bound staking storage items #12230
Bound staking storage items #12230
Conversation
frame/staking/src/migrations.rs
Outdated
@@ -20,6 +20,36 @@ use super::*; | |||
use frame_election_provider_support::SortedListProvider; | |||
use frame_support::traits::OnRuntimeUpgrade; | |||
|
|||
pub mod v11 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruseinov given you past experience, would like your review of this :)
frame/staking/src/pallet/mod.rs
Outdated
@@ -124,6 +125,18 @@ pub mod pallet { | |||
#[pallet::constant] | |||
type MaxNominations: Get<u32>; | |||
|
|||
/// `HistoryDepth` stores the number of previous eras for which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this value is actually used for the first key of a number of double maps as well 🙈
(also, same comment about comments being 100 in width, I used this https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see this used only in Claimed Rewards in the Staking Ledger
@Ank4n Configuration ("-c" or "--configuration") should be specified exactly once |
/cmd queue -c bench-bot $ 1 |
@Ank4n https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1831190 was started for your command Comment |
@Ank4n Command |
/cmd queue -c bench-bot $ pallet dev pallet_staking |
@Ank4n https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1831235 was started for your command Comment |
@Ank4n Command |
/cmd queue -c bench-bot $ pallet dev pallet_staking |
@Ank4n |
/cmd cancel 6-ab24f4ab-4142-4773-8a12-624c23b03cf9 |
@Ank4n Command |
e994f46
to
7e1ffdd
Compare
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
…ound-staking-storage-trivial
bot rebase |
Error: Command 'Command { std: "git" "merge" "origin/master" "--no-ff" "--no-edit", kill_on_drop: false }' failed with status Some(1); output: no output |
bot merge |
* master: [Fix] parameter_types! dead code errors (#12340) [Feature] Sequential migration execution for try-runtime (#12319) bench: Use `_` instead of `::` in auto-generated file names (#12332) Fast Unstake Pallet (#12129) Rename anonymous to pure proxy (#12283) Migrate remaining old decl_* macros to the new pallet attribute macros (#12271) pallet-utility: Disallow none origin (#12321) Make automatic storage deposits resistant against changing deposit prices (#12083) Format templates and fix `--steps` default value (#12286) Bump `wasmtime` to 1.0.0 (#12317) Introduce 'intermediate_insert' method to hide implementation details (#12215) Bound staking storage items (#12230) Use `array-bytes` for All Array/Bytes/Hex Operations (#12190) BREAKING: Rename Origin (#12258) Use temporary db for benchmarking (#12254) rpc: Implement `chainSpec` RPC API (#12261) Import target block body during warp sync (#12300) Proper naming wrt expectations (#12311) [ci] Revert cancel-pipeline job (#12309)
.saturating_add(Weight::from_ref_time(6_687_552 as u64).saturating_mul(v as u64)) | ||
// Standard Error: 266_386 | ||
.saturating_add(Weight::from_ref_time(6_839_134 as u64).saturating_mul(n as u64)) | ||
.saturating_add(T::DbWeight::get().reads(6722 as u64)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just seeing this now 😅
It is either a bug (fixed in #12482) or expected.
#### Intro Upgrade polkadot from v0.9.27 to v0.9.30 as a checkpoint, then to v0.9.33 (latest version without workspace dependencies) Require ComposableFi/composable-ibc#176 to be merged first. #### Migrations - v0.9.28 - [x] paritytech/polkadot#5582 - Nomination not present in our runtimes - v0.9.29 - [x] paritytech/substrate#12095 - Nomination not present in our runtimes - v0.9.30 - [x] paritytech/substrate#12034 - BagList/Staking not present in our runtimes - [x] paritytech/polkadot#5930 - Nomination/BagList/Staking not present in our runtimes - [x] paritytech/substrate#12230 - Staking not present in our runtimes - [x] paritytech/polkadot#5996 - Staking not present in our runtimes - [x] paritytech/substrate#12083 - Contracts not present in our runtimes Signed-off-by: cor <[email protected]> Co-authored-by: cor <[email protected]>
* 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 <[email protected]> * Update frame/staking/src/migrations.rs Co-authored-by: Kian Paimani <[email protected]> * doc for all storage items bounded by HistoryDepth * Update frame/staking/src/pallet/mod.rs Co-authored-by: Kian Paimani <[email protected]> * Update frame/staking/src/tests.rs Co-authored-by: Kian Paimani <[email protected]> * pr feedback fixes * Update frame/staking/src/tests.rs Co-authored-by: Kian Paimani <[email protected]> * remove extra checks * fix merge * fmt Co-authored-by: command-bot <> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: kianenigma <[email protected]>
This fixes part 1 & 2 of paritytech/polkadot-sdk#255
polkadot companion: paritytech/polkadot#5996