-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stake tracker improvements (migration and try-state checks OK in Polk…
…adot) (#4673) Changes in the migration code introduced in this PR: - Migration removes duplicate nominations in all nominators, if they exist (changes by calling `fn do_add_nominator` with dedup nominations) - Migration removes all the non active validator nominations to avoid adding dangling nominations (changes by calling `fn do_add_nominator` if necessary) - Migration iterates through all `Nominators` map first and through all the `Validators` map to insert all the validators that are not nominated to the target list (with self-stake only). - Moves stake-tracker related try-state checks to the staking pallet (no try-state checks in the stake-tracker pallet anymore). - Runs benchmarks for MMB migration step with bench bot. The migration code has been validated against the Polkadot using the externalities tests in [polkadot/runtime/westend/src/lib.rs](https://github.com/paritytech/polkadot-sdk/pull/4436/files/46a80f14ba8990b014d8f9df36727c77e2f3e929#diff-5264d812f7aadfc486efffd3322b11c8dee5e8ddf2e77e0a9e70b573f3d2afdd). Upon running the migrations, we ensure that: - All validators have been added to the target list with their correct approvals score (as per the try-state checks). - All nominations are "cleaned" (see def. of clean above) - Try-state checks related to stake-tracker and approvals pass. Note: Same as #4436 but with a non-messed up git history. Merging into `gpestana/stake-tracker_integration`. --------- Co-authored-by: Ankan <[email protected]> Co-authored-by: command-bot <>
- Loading branch information
Showing
17 changed files
with
1,390 additions
and
1,270 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
549 changes: 351 additions & 198 deletions
549
polkadot/runtime/westend/src/weights/pallet_staking.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.