-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow root origin to force transition phases #13070
base: master
Are you sure you want to change the base?
Conversation
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
@Ank4n Could you please review this? |
Self::do_force_rotate_round(); | ||
} | ||
|
||
match Self::create_snapshot() { |
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.
Could we reuse code either by
- extracting in a separate
fn start_signed()
- adding the check for force phase inside the existing arm
match current_phase {
Phase::Off if force_phase == Phase::Signed || remaining <= signed_deadline && remaining > unsigned_deadline => {
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.
A good reason to extract logic into functions start_<some>_phase
is that we can potentially add it to trait ElectionProvider
such that other pallets can tell EPM to force phase as well.
ForceOrigin
to force transition phases
@Ank4n @kianenigma Could you please approve if the changes are ok? |
@Szegoo we recently added an integration test crate for staking/EPM and other staking related pallets under frame/election-provider-multi-phase/test-staking-e2e and one of the main goals is to document the different edge cases and behaviour of the pallets as close to production as possible. I wonder if you could add a few e2e tests there for this PS and document them, I think that would be very useful for reviewers and also for posterity. |
That seems like a good idea, getting to it 👍 |
Integration tests are still WIP. |
@gpestana I've added two integration tests and made up a scenario for both of them. Please let me know if this seems like something reasonable. |
The CI pipeline was cancelled due to failure one of the required jobs. |
Closes: paritytech/polkadot-sdk#432
Introduces three new extrinsics that can be used by force origin to transition between phases and rounds:
force_rotate_round
force_start_phase
- Accepts a phase that we want to transition into as an argument. Only works when transitioning to theSigned
orEmergency
phase, otherwise fails. Stores the phase we want to transition into in theForcePhase
storage value. The transition will happen at the start of the next block.Polkadot companion: paritytech/polkadot#6822