Skip to main content

Module drb

Module drb 

Source
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 cancel fires and how stale a supervisor’s view of Heartbeat can be; independent of the DRB_CHECKPOINT_INTERVAL persistence 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 hash repeatedly count times, checking cancel and bumping heartbeat between batches.

Type Aliases§

DrbDifficultySelectorFn
DrbResult
Alias for DRB result from compute_drb_result.
DrbSeedInput
Alias for DRB seed input for compute_drb_result, serialized from the QC signature.