Skip to content

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

Merged
niklasad1 merged 1 commit intoparitytech:mainfrom
CertainLach:fix/voters-by-stake-list
Jul 1, 2024
Merged

Fix: Feasibility check fails when all voters have the same staked amount#856
niklasad1 merged 1 commit intoparitytech:mainfrom
CertainLach:fix/voters-by-stake-list

Conversation

@CertainLach
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
@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