Crate sp_consensus_babe
source ·Expand description
Primitives for BABE.
Modules
- Private implementation details of BABE digests.
- Inherents for BABE
Structs
- Configuration data used by the BABE consensus engine.
- Configuration data used by the BABE consensus engine.
- Configuration data used by the BABE consensus engine that may change with epochs.
- BABE epoch information
- 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. - Unit type wrapper that represents a slot.
- A slot duration defined in milliseconds.
- VRF output type suitable for schnorrkel operations.
- VRF proof type suitable for schnorrkel operations.
- VRF input ready to be used for VRF sign and verify operations.
- VRF signature data
- Transcript ready to be used for VRF related operations.
Enums
- Types of allowed slots.
- An consensus log item for BABE.
Constants
- The
ConsensusEngineId
of BABE. - Key type for BABE module.
- 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.
- The length of the public key
- VRF output length for per-slot randomness.
- VRF context used for per-slot randomness generation.
Traits
- API necessary for block authorship with BABE.
Functions
- Verifies the equivocation proof by making sure that: both headers have different hashes, are targetting the same slot, and have valid signatures by the same authority.
- Returns the epoch index the given slot belongs to.
- Returns the first slot at the given epoch index.
- Make VRF signing data suitable for BABE’s protocol.
- Make VRF input suitable for BABE’s randomness generation.
Type Definitions
- 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.
- The index of an authority.
- 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.
- A Babe authority signature.
- The weight of an authority.
- The cumulative weight of a BABE block, i.e. sum of block weights starting at this block until the genesis block.
- An equivocation proof for multiple block authorships on the same slot (i.e. double vote).
- Randomness type required by BABE operations.
- VRF input.