You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the number of seats for the next epoch decreases, and a group of eligible validators have the same lowest bid, the selection process lacks fairness. For example, consider validators v1, v2, v3, v4, and v5 with bids of 500, 250, 10, 10, and 10, respectively. The issue arises because there is no randomness in selecting which of the lowest bid validators will be excluded from the set.
Expected behavior
The expected behavior is that validators with the same bid value should have an equal chance of being included or excluded from the validator set, ensuring a fair selection process for each epoch.
Technical Analysis
Currently, eligible validators are sorted by bid using a bubble sort algorithm. After sorting, the list is reversed, creating a list X with the highest bids first and the lowest bids last. Validators are selected from left to right in list X until all seats are filled.
The problem with bubble sort is that it does not change the position of elements with equal values. Thus, if multiple validators have the same bid, the one that appears first will always remain in its position. When the sorted list is reversed, the first validator with the lowest bid will always be excluded.
Solution
With the recent addition of a random number generation module, we can create a function that ensures randomness among validators with the same bid value. This will ensure fairness in selecting which validators are included or excluded from the set in each epoch.
The text was updated successfully, but these errors were encountered:
Describe the bug
When the number of seats for the next epoch decreases, and a group of eligible validators have the same lowest bid, the selection process lacks fairness. For example, consider validators v1, v2, v3, v4, and v5 with bids of 500, 250, 10, 10, and 10, respectively. The issue arises because there is no randomness in selecting which of the lowest bid validators will be excluded from the set.
Expected behavior
The expected behavior is that validators with the same bid value should have an equal chance of being included or excluded from the validator set, ensuring a fair selection process for each epoch.
Technical Analysis
Currently, eligible validators are sorted by bid using a bubble sort algorithm. After sorting, the list is reversed, creating a list X with the highest bids first and the lowest bids last. Validators are selected from left to right in list X until all seats are filled.
The problem with bubble sort is that it does not change the position of elements with equal values. Thus, if multiple validators have the same bid, the one that appears first will always remain in its position. When the sorted list is reversed, the first validator with the lowest bid will always be excluded.
Solution
With the recent addition of a random number generation module, we can create a function that ensures randomness among validators with the same bid value. This will ensure fairness in selecting which validators are included or excluded from the set in each epoch.
The text was updated successfully, but these errors were encountered: