-
Notifications
You must be signed in to change notification settings - Fork 700
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
base: master
Are you sure you want to change the base?
Conversation
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.
Only looked at traits. Will do another pass.
fn elect(remaining: PageIndex) -> Result<BoundedSupportsOf<Self>, Self::Error>; | ||
|
||
/// The index of the *most* significant page that this election provider supports. | ||
fn msp() -> PageIndex { |
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.
may be call it highest page or top page?
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.
Also, since the current page index needs to be stored somewhere, could we just store it on ElectionProvider
, and Staking then can just call next_elect()
?
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 I called it like this initially be be simiar to the concept if msp (most significant bit) in cpus.
…into gpestana/epm-mb
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
…into gpestana/epm-mb
// default bounds are unbounded. | ||
let targets = | ||
T::DataProvider::electable_targets(DataProviderBounds::default(), Zero::zero())?; | ||
let voters = T::DataProvider::electing_voters(DataProviderBounds::default(), Zero::zero())?; |
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.
we can introduce a function unbounded
to DataProviderBounds
to make code more readable.
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
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:
on_intialize
in pallet staking