Module ariadne_v2

Source
Expand description

Random selection out of two pools of weighted (trustless) and unweighted (permissioned) candidates controlled by a T/P ratio (D-parameter), with guaranteed seat allocations

Functionsยง

select_authorities
Selects committee according to D-parameter and candidates lists. Resulting committee has size of registered_seats + permissioned_seats. If both registered_candidates and permissioned_candidates are not empty then the selected committee has exactly registered_seats assigned to registered_candidates.
weighted_with_guaranteed_assignment
Pseudo-random selection with repetitions, but for any candidate that has expected number of seats as P+Q, where P is non-negative integer and Q is in [0, 1), it guarantees at least P places.