Remove the ability to select more than one for random sampling #563
+79
−401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR relates to #543, which removes voter selection. It removes the currently unused processing within the random sampling function and integrates it with the proposer selection. Multiple sampling was originally intended to select more than one in voter selection, but in practice, voters were selected in other ways and only used to select one proposer.
RandomSamplingWithPriority()
function has been moved toSelectProposer()
. This removes the check, as it's able to guarantee that thetotalVotingPower
is the sum of theVotingPower
.Candidate
interface that is no longer required has been removed.I originally intended to remove SplitMix64 because I thought we could just use
LastProofHash
as a random number, but in reality, we need to use random numbers based on height and round in addition toLastProofHash
, so SplitMix64 is still used (and therefore remains compatible with the previous behavior).Closes: #XXX