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

Wrap EPM Snapshot, SnapshotMetadata and DesiredTargets to ensure invariants #413

Closed
gpestana opened this issue Apr 27, 2023 · 1 comment · Fixed by #1633
Closed

Wrap EPM Snapshot, SnapshotMetadata and DesiredTargets to ensure invariants #413

gpestana opened this issue Apr 27, 2023 · 1 comment · Fixed by #1633
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@gpestana
Copy link
Contributor

gpestana commented Apr 27, 2023

The Snapshot, SnapshotMetadata and DesiredTargets storage items in the EPM pallet must be kept in sync throughout the election lifetime and be killed in tandem. Currently, these storage items are mutated in different places in the pallet.

It makes sense to refactor EPM to hide those storage items behind a shared wrapper that is used to access/mutate and kill the inner items, so as to make sure the invariants hold true at every point in the election.

(related comment)

@wirednkod
Copy link
Contributor

I would like to work on this @gpestana

@wirednkod wirednkod self-assigned this Apr 27, 2023
@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. and removed C1-low labels Aug 25, 2023
@wirednkod wirednkod added T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed T1-FRAME This PR/Issue is related to core FRAME, the framework. labels Sep 17, 2023
github-merge-queue bot pushed a commit that referenced this issue Jan 22, 2024
This PR wraps the `Snapshot`, `SnapshotMetadata` and `DesiredTargets`
storage items in the [EPM
pallet](https://paritytech.github.io/substrate/master/pallet_election_provider_multi_phase/index.html)
in order to keep them in sync throughout the election lifetime and in
order to be killed together.

Prior to this PR, these storage items were mutated in different places
in the pallet;

In addition 2 helper `fns` are introduced for chekcing if all the
wrapped storage items exist or not;

Fixes #413 ;

---------

Co-authored-by: Gonçalo Pestana <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
This PR wraps the `Snapshot`, `SnapshotMetadata` and `DesiredTargets`
storage items in the [EPM
pallet](https://paritytech.github.io/substrate/master/pallet_election_provider_multi_phase/index.html)
in order to keep them in sync throughout the election lifetime and in
order to be killed together.

Prior to this PR, these storage items were mutated in different places
in the pallet;

In addition 2 helper `fns` are introduced for chekcing if all the
wrapped storage items exist or not;

Fixes paritytech#413 ;

---------

Co-authored-by: Gonçalo Pestana <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Status: Done
Status: Backlog
3 participants