Expand description

Slots functionality for Substrate.

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

A simple default strategy for how to decide backing off authoring blocks if the number of unfinalized blocks grows too large.

A slot duration. Create with get_or_compute.

Information about a slot.

Enums

A header which has been checked

Constants

We keep at least this number of slots in database.

We prune slots when they reach this number.

Traits

Trait for providing the strategy for when to backoff block authoring.

A skeleton implementation for SlotWorker which tries to claim a slot at its beginning and tries to produce a block if successfully claimed, timing out if block production takes too long.

Slot compatible inherent data.

A worker that should be invoked at every new slot.

Functions

Checks if the header is an equivocation and returns the proof in that case.

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 2^7 * slot_duration, if no slots were skipped this method will return None.

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 20 * slot_duration, if no slots were skipped this method will return None.

Start a new slot worker.

Type Definitions

The changes that need to applied to the storage to create the state for a block.