Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

EPM and staking events improvement #13026

Closed
gpestana opened this issue Dec 28, 2022 · 1 comment · Fixed by #13035
Closed

EPM and staking events improvement #13026

gpestana opened this issue Dec 28, 2022 · 1 comment · Fixed by #13035
Assignees
Labels
D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit J0-enhancement An additional feature request. J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@gpestana
Copy link
Contributor

gpestana commented Dec 28, 2022

A few suggestions to make it easier to trace runtime events related to the election provider and staking pallets:

EPM pallet

  • SolutionStored { compute, prev_ejected, origin, Option<T::AccountId> } (modified).
  • PhaseTransitioned { from: Phase, to: Phase, round: u32}: All the phase transition events (Event::SignedPhaseStarted, Event::UnsighedPhaseStarted) are replaced by a state transition event that keep the previous and next phase. This will also allow us to easily start emitting when the emergency and phase off start and all new future phases that we may need.

Staking pallet:

  • ForceEra { mode: Forcing }: signals that a new Forcing mode was set.

In addition to refactoring and adding new events, this PR also adds helper functions to transition EPM phases and set a new force era mode.

@gpestana gpestana added J0-enhancement An additional feature request. J2-unconfirmed Issue might be valid, but it’s not yet known. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Dec 28, 2022
@gpestana gpestana self-assigned this Dec 28, 2022
@Ank4n
Copy link
Contributor

Ank4n commented Dec 29, 2022

  • SolutionStored { compute, prev_ejected, account_id, score }: should also have the AccountId of the miner that stored the solution and its score.
  • FYI: this event is also emitted for unsigned solutions. We can keep it as optional which is then will also be useful to indicate whether it was a signed or an unsigned solution.

👍

  • EmergencyPhaseStarted: indicates when the emergency phase has started.
    👍 . I think we should have an event for the start of each phase including even Off Phase?

Yes, I think that would be helpful.

  • FallbackSolution: indicates that a solution has been provided by T::Fallback
  • GovernanceSolution: indicates that a solution has been provided by T::GovernanceFallback
    Might be better to indicate this in the existing SolutionSotred event?

Right, the solution type is already stored as compute as param of the Event::Finalized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit J0-enhancement An additional feature request. J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants