Expand description
Primitives for BABE.
Modules§
Structs§
- Babe
Configuration - Configuration data used by the BABE consensus engine.
- Babe
Configuration V1 - Configuration data used by the BABE consensus engine.
- Babe
Epoch Configuration - Configuration data used by the BABE consensus engine that may change with epochs.
- Epoch
- BABE epoch information
- Opaque
KeyOwnership Proof - 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.
- Slot
Duration - A slot duration defined in milliseconds.
- VrfPre
Output - VRF pre-output type suitable for schnorrkel operations.
- VrfProof
- VRF proof type suitable for schnorrkel operations.
- VrfSign
Data - 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§
- Allowed
Slots - Types of allowed slots.
- Consensus
Log - 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§
- Authority
Id - 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.
- Authority
Index - The index of an authority.
- Authority
Pair - 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.
- Authority
Signature - A Babe authority signature.
- Babe
Authority Weight - The weight of an authority.
- Babe
Block Weight - The cumulative weight of a BABE block, i.e. sum of block weights starting at this block until the genesis block.
- Equivocation
Proof - 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.