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 remote externalities tests + improvements #4436

Open
wants to merge 14 commits into
base: gpestana/stake-tracker_integration
Choose a base branch
from

Conversation

gpestana
Copy link
Contributor

@gpestana gpestana commented May 11, 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;
  • All nominations are "cleaned" (see def. of clean above)
  • Try-state checks related to stake-tracker and approvals pass.

@gpestana
Copy link
Contributor Author

bot bench polkadot-pallet --runtime=westend --pallet=pallet-staking

@command-bot
Copy link

command-bot bot commented May 11, 2024

@gpestana option '--pallet ' argument 'pallet-staking' is invalid. argument pallet is not matching rule ^([a-z_]+)([:]{2}[a-z_]+)?$

@gpestana
Copy link
Contributor Author

bot bench polkadot-pallet --runtime=westend --pallet=pallet_staking

@command-bot
Copy link

command-bot bot commented May 11, 2024

@gpestana https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6179886 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 1-8ad50ea4-362e-4a69-9066-c416c8d669c4 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented May 11, 2024

@gpestana Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6179886 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6179886/artifacts/download.

@kianenigma
Copy link
Contributor

what is the example execution output? any insights or results?

@gpestana gpestana changed the title stake-tracker remote externalities tests stake-tracker remote externalities tests + improvements May 17, 2024
@gpestana
Copy link
Contributor Author

what is the example execution output? any insights or results?

The migration and try-state in this branch are working now.

There were a few edge side-cases that we had to change in this PR, I'll add them to the comments and then merge this PR into the main PR branch.

@gpestana
Copy link
Contributor Author

bot bench polkadot-pallet --runtime=westend --pallet=pallet_staking

@command-bot
Copy link

command-bot bot commented May 30, 2024

@gpestana https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6349082 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 6-43f7f098-94da-42be-8c42-42736492902a to cancel this command or bot cancel to cancel all commands in this pull request.

@@ -2682,6 +2681,64 @@ mod remote_tests {
.unwrap();
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
}

#[tokio::test]
Copy link
Contributor Author

@gpestana gpestana May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove these tests before merging in the base branch.

@gpestana gpestana added the R0-silent Changes should not be mentioned in any release notes label May 30, 2024
@gpestana
Copy link
Contributor Author

bot bench polkadot-pallet --runtime=westend --pallet=pallet_staking

@command-bot
Copy link

command-bot bot commented May 30, 2024

@gpestana https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6350207 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 7-0a2894d9-f5b7-4f9b-9cfb-b6eff3def51d to cancel this command or bot cancel to cancel all commands in this pull request.

…=westend --target_dir=polkadot --pallet=pallet_staking
@command-bot
Copy link

command-bot bot commented May 30, 2024

@gpestana Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6349082 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6349082/artifacts/download.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable 3/3
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6351824

@command-bot
Copy link

command-bot bot commented May 30, 2024

@gpestana Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=pallet_staking has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6350207 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6350207/artifacts/download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants