-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Abstracts elections-phragmen pallet to use NposSolver (v2) #13453
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
bot bench $ pallet dev pallet-elections |
@gpestana https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2756664 was started for your command Comment |
@gpestana Command |
bot bench $ pallet dev frame-election-provider-support |
@gpestana https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2756843 was started for your command Comment |
@gpestana Command |
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. |
Yes, we are still interested in merging this PR but are waiting for the opengov v1 to be completely deprecated and for the monorepo so that the merge is easier. Meanwhile, I will fix the conflicts. |
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. |
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. |
will work on this PR this week. |
This PR refactors the current
elections-phragmen
pallet to use anNposSolver
instead of hardcoding one flavor of phragmen. In addition, it implements an approval voting election scheme where each voter backs a limited set of candidates, without requiring splitting the stake among the selected candidates.When using the
pallet-elections
, one should consider switching to a simplerNposSolver
type like the approvals voting scheme, which is lighter than phragmen and reasonable in most cases. Users of this pallet should keep in mind that the election happens periodicallyon_initialize
, and thus ensure that the election weight fits within a block (there is an integrity test to ensure the runtime configs comply).Note that, although this PR renamed the old
pallet-elections-phragmen
topallet-elections
, the pallet name in the runtimes did not change in order to avoid a runtime upgrade (we could use move_pallet but that's not recommended). Otherwise a runtime upgrade would have been required.Finally, this PR removes the need for a separate benchmarking crate for
elections-provider-support
. This way, it is possible to use the CI bench bot to correctly calculate and commit weights (all changes related to this merged and more info about it in this PR #13431).polkadot companion: paritytech/polkadot#6278