Crate tc_consensus_slots[−][src]
Slots functionality for Tetcore.
Some consensus algorithms have a concept of slots, which are intervals in time during which certain events can and/or must occur. This crate provides generic functionality for slots.
Structs
BackoffAuthoringOnFinalizedHeadLagging | A simple default strategy for how to decide backing off authoring blocks if the number of unfinalized blocks grows too large. |
SlotDuration | A slot duration. Create with |
SlotInfo | Information about a slot. |
SlotResult | The result of |
Enums
CheckedHeader | A header which has been checked |
Error |
Constants
MAX_SLOT_CAPACITY | We keep at least this number of slots in database. |
PRUNING_BOUND | We prune slots when they reach this number. |
Traits
BackoffAuthoringBlocksStrategy | Trait for providing the strategy for when to backoff block authoring. |
SimpleSlotWorker | A skeleton implementation for |
SlotCompatible | Slot compatible inherent data. |
SlotWorker | A worker that should be invoked at every new slot. |
Functions
check_equivocation | Checks if the header is an equivocation and returns the proof in that case. |
slot_lenience_exponential | Calculate a slot duration lenience based on the number of missed slots from current
to parent. If the number of skipped slots is greated than 0 this method will apply
an exponential backoff of at most |
slot_lenience_linear | Calculate a slot duration lenience based on the number of missed slots from current
to parent. If the number of skipped slots is greated than 0 this method will apply
a linear backoff of at most |
start_slot_worker | Start a new slot worker. |
Type Definitions
StorageChanges | The changes that need to applied to the storage to create the state for a block. |