Expand description
Holds the types and functions for DRB computation.
Modules§
- election
- Functions for leader selection based on the DRB.
Structs§
- DrbInput
- DrbResults
- Seeds for DRB computation and computed results.
- Heartbeat
- A counter a long computation bumps as it makes progress.
Constants§
- DIFFICULTY_
LEVEL - Arbitrary number of times the hash function will be repeatedly called.
- DRB_
CANCEL_ 🔒BATCH - Hashes between cancellation checks. Bounds both how long hashing continues after
cancelfires and how stale a supervisor’s view ofHeartbeatcan be; independent of theDRB_CHECKPOINT_INTERVALpersistence cadence. - DRB_
CHECKPOINT_ INTERVAL - Interval at which to store the results
- DRB_
PROGRESS_ LOAD_ TIMEOUT - Default upper bound on loading previously stored DRB progress at the
start of a computation. Sized like the stake-table storage bound
(espresso’s
DEFAULT_STORAGE_READ_TIMEOUT). - INITIAL_
DRB_ RESULT - DRB result for epoch 1 and 2.
- INITIAL_
DRB_ SEED_ INPUT - DRB seed input for epoch 1 and 2.
- KEEP_
PREVIOUS_ RESULT_ COUNT - Number of previous results and seeds to keep
Functions§
- compute_
drb_ result - Compute the DRB result for the leader rotation.
- difficulty_
level - Difficulty level of the DRB calculation.
- drb_
difficulty_ selector - hash_
batches 🔒 - Hash
hashrepeatedlycounttimes, checkingcanceland bumpingheartbeatbetween batches.
Type Aliases§
- DrbDifficulty
Selector Fn - DrbResult
- Alias for DRB result from
compute_drb_result. - DrbSeed
Input - Alias for DRB seed input for
compute_drb_result, serialized from the QC signature.