referrerpolicy=no-referrer-when-downgrade

Crate sp_consensus_babe

Source
Expand description

Primitives for BABE.

Modules§

digests
Private implementation details of BABE digests.
inherents
Inherents for BABE

Structs§

BabeConfiguration
Configuration data used by the BABE consensus engine.
BabeConfigurationV1
Configuration data used by the BABE consensus engine.
BabeEpochConfiguration
Configuration data used by the BABE consensus engine that may change with epochs.
Epoch
BABE epoch information
OpaqueKeyOwnershipProof
An opaque type used to represent the key ownership proof at the runtime API boundary. The inner value is an encoded representation of the actual key ownership proof which will be parameterized when defining the runtime. At the runtime API boundary this type is unknown and as such we keep this opaque representation, implementors of the runtime API will have to make sure that all usages of OpaqueKeyOwnershipProof refer to the same type.
Slot
Unit type wrapper that represents a slot.
SlotDuration
A slot duration defined in milliseconds.
VrfPreOutput
VRF pre-output type suitable for schnorrkel operations.
VrfProof
VRF proof type suitable for schnorrkel operations.
VrfSignData
VRF input ready to be used for VRF sign and verify operations.
VrfSignature
VRF signature data
VrfTranscript
Transcript ready to be used for VRF related operations.

Enums§

AllowedSlots
Types of allowed slots.
ConsensusLog
An consensus log item for BABE.

Constants§

BABE_ENGINE_ID
The ConsensusEngineId of BABE.
KEY_TYPE
Key type for BABE module.
MEDIAN_ALGORITHM_CARDINALITY
How many blocks to wait before running the median algorithm for relative time This will not vary from chain to chain as it is not dependent on slot duration or epoch length.
PUBLIC_KEY_LENGTH
The length of the public key
RANDOMNESS_LENGTH
VRF output length for per-slot randomness.
RANDOMNESS_VRF_CONTEXT
VRF context used for per-slot randomness generation.

Traits§

BabeApi
API necessary for block authorship with BABE.

Functions§

check_equivocation_proof
Verifies the equivocation proof by making sure that: both headers have different hashes, are targeting the same slot, and have valid signatures by the same authority.
epoch_index
Returns the epoch index the given slot belongs to.
epoch_start_slot
Returns the first slot at the given epoch index.
make_vrf_sign_data
Make VRF signing data suitable for BABE’s protocol.
make_vrf_transcript
Make VRF input suitable for BABE’s randomness generation.

Type Aliases§

AuthorityId
A Babe authority identifier. Necessarily equivalent to the schnorrkel public key used in the main Babe module. If that ever changes, then this must, too.
AuthorityIndex
The index of an authority.
AuthorityPair
A Babe authority keypair. Necessarily equivalent to the schnorrkel public key used in the main Babe module. If that ever changes, then this must, too.
AuthoritySignature
A Babe authority signature.
BabeAuthorityWeight
The weight of an authority.
BabeBlockWeight
The cumulative weight of a BABE block, i.e. sum of block weights starting at this block until the genesis block.
EquivocationProof
An equivocation proof for multiple block authorships on the same slot (i.e. double vote).
Randomness
Randomness type required by BABE operations.
VrfInput
VRF input.