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

Refactor NposSolver to be generic over the election algorithm #448

Open
gpestana opened this issue Oct 31, 2022 · 1 comment
Open

Refactor NposSolver to be generic over the election algorithm #448

gpestana opened this issue Oct 31, 2022 · 1 comment
Labels
I4-refactor Code needs refactoring. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@gpestana
Copy link
Contributor

Currently, the NposSolver::weight() trait is generic over a frame_election_provider_support::WeightInfo which returns the weights of running two flavors of phragmen.

This means that the NposSolver trait is not ergonomic for developer who'd like to use their own election algorithm. We could either:

i) refactor NposSolver to be more generic; or
ii) add a new trait ElectionSolver that is completely agnostic wrt to the election algorithm used.

@gpestana
Copy link
Contributor Author

Related to paritytech/substrate#8250 and paritytech/substrate#12588

@kianenigma as discussed, this is probably not very important, but opening this issue for idea bookeeping.

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I4-refactor Code needs refactoring. I10-unconfirmed Issue might be valid, but it's not yet known. and removed I7-refactor labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I4-refactor Code needs refactoring. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
Status: 📕 Backlog
Development

No branches or pull requests

2 participants