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

Fix: Feasibility check fails when all voters have the same staked amount #856

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

CertainLach
Copy link
Contributor

TrimmedVotes uses BTreeMap to sort voters by stake, which results in voters with the same stake to be dropped from election.

In case if desired_targets == total_voters (on private network) it results in immediate feasibility check failure in solution_weight->epm::mock_votes, as voters < desired_targets.

`TrimmedVotes` uses `BTreeMap` to sort voters by stake, which results in
voters with the same stake to be dropped from election.
In case if `desired_targets` == `total_voters` it results in immediate
feasibility check failure in `solution_weight`->`epm::mock_votes`, as
`voters < desired_targets`.
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, looks good to me

@niklasad1 niklasad1 merged commit 08e4812 into paritytech:main Jul 1, 2024
10 checks passed
@CertainLach CertainLach deleted the fix/voters-by-stake-list branch July 1, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants