Joystream / Joystream/joystream
Question about Referendum winners calculation
@mnaamani is already working on this.
Since Mar 31, 2022.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Hi Team!
To give you a bit of a context: after the first Olympia council elections that went quite problematic, I am tasked to investigate the possible reasons some candidates with high stakes didn't get the seat. The following code snippet from the referendum pallet had drawn my attention in this regard:
// espace when item is currently not in winning list and still has not enough vote
// power to make it to already full list
if current_winners_index_of_vote_recipient.is_none()
&& current_winners_count as u64 == winning_target_count
&& option_result.vote_power <= current_winners[current_winners_count - 1].vote_power
{
return (current_winners.to_vec(), None);
}
As there are no unit tests for this particular condition, let me clarify how I understood this code works, all right? Imagine the following set up: let winners count be 2, and current_winners = [ Alice(VotePower=100), Bob(VotePower=50) ].
Now, two independent votes are revealed for another user Charlie (who is not in the current_winners): first vote 40, and second vote - 30 (70 in total).
Do I understand correctly, that the code above won't let Charlie crowd out Bob and get the seat in the Council?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.