Function sp_consensus_sassafras::ticket::ticket_id_threshold
source · pub fn ticket_id_threshold(
redundancy: u32,
slots: u32,
attempts: u32,
validators: u32,
) -> TicketId
Expand description
Computes a boundary for TicketId
maximum allowed value for a given epoch.
Only ticket identifiers below this threshold should be considered as candidates for slot assignment.
The value is computed as TicketId::MAX*(redundancy*slots)/(attempts*validators)
Where:
redundancy
: redundancy factor;slots
: number of slots in epoch;attempts
: max number of tickets attempts per validator;validators
: number of validators in epoch.
If attempts * validators = 0
then we return 0.
For details about the formula and implications refer to probabilities an parameters paragraph of the w3f introduction to the protocol.