Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stake tracker improvements (migration and try-state checks OK in Polkadot) #4673

Conversation

gpestana
Copy link
Contributor

@gpestana gpestana commented Jun 3, 2024

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. 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.

@gpestana gpestana changed the title Gpestana/stake tracker integration ext stable Stake tracker improvements (migration and try-state checks OK in Polkadot) Jun 3, 2024
@gpestana gpestana merged commit 6219b32 into gpestana/stake-tracker_integration Jun 3, 2024
18 of 41 checks passed
@gpestana gpestana deleted the gpestana/stake-tracker_integration-ext-stable branch June 3, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants