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

Adds multi-block election types and refactors current pallets to support new interfaces and types #6034

Open
wants to merge 110 commits into
base: master
Choose a base branch
from

Conversation

gpestana
Copy link
Contributor

@gpestana gpestana commented Oct 13, 2024

This PR refactors the types and structs required to run a mulit-block election and updates the EPM, staking-pallet and all dependent pallets to use the multi-block types. The Westend runtime is configured to run a 1 paged election, which is a noop refactor compared to the current single-block election.

Notable changes since last reviews:

Tasks based on feedback that can be closed after merging this PR: Umbrella ticket for multi-block election tasks to improve after PR#6034.


The multi-block election provider pallet is wip and it's added in a separate PR (#6213).

To-do before merging:

  • test with chopsticks/follow-chain
  • add benchmarks for on_intialize in pallet staking

@gpestana gpestana self-assigned this Oct 13, 2024
@gpestana gpestana requested a review from a team as a code owner October 13, 2024 23:49
@gpestana gpestana requested a review from Ank4n October 13, 2024 23:49
@gpestana gpestana marked this pull request as draft October 13, 2024 23:49
@gpestana gpestana added the T2-pallets This PR/Issue is related to a particular pallet. label Oct 13, 2024
Copy link
Contributor

@Ank4n Ank4n left a comment

Choose a reason for hiding this comment

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

Only looked at traits. Will do another pass.

@gpestana gpestana marked this pull request as ready for review October 18, 2024 16:42
@kianenigma kianenigma requested a review from acatangiu as a code owner January 16, 2025 09:17

let (exposure_metadata, exposure_pages) = exposure.into_pages(page_size);
defensive_assert!(exposure_pages.len() == expected_page_count, "unexpected page count");
if let Some(stored_overview) = ErasStakersOverview::<T>::get(era, &validator) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ank4n @kianenigma to review this one last time. I think it can be written simpler.

Does it have good tests?

pub mod v17 {
use super::*;

pub struct VersionedMigrateV16ToV17<T>(core::marker::PhantomData<T>);
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: test for this.

@kianenigma
Copy link
Contributor

bot bench substrate-pallet --pallet=pallet_staking

@command-bot
Copy link

command-bot bot commented Jan 17, 2025

@kianenigma https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8044020 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --features=riscv --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 12-f7e15fd4-16b8-4614-bbee-2e75ed6ab334 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jan 17, 2025

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

@kianenigma
Copy link
Contributor

/cmd bench --pallet pallet_staking

Copy link

Command "bench --pallet pallet_staking" has started 🚀 See logs here

Copy link

Command "bench --pallet pallet_staking" has failed ❌! See logs here

@kianenigma
Copy link
Contributor

/cmd bench --pallet pallet_staking

Copy link

Command "bench --pallet pallet_staking" has started 🚀 See logs here

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12830145089
Failed job name: fmt

Copy link

Command "bench --pallet pallet_staking" has failed ❌! See logs here

Command output:

❌ Failed benchmarks of runtimes/pallets:
-- dev: ['pallet_staking']
✅ Successful benchmarks of runtimes/pallets:
-- westend: ['pallet_staking']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
Status: In review
Status: Scheduled
Development

Successfully merging this pull request may close these issues.

6 participants