Crate sp_beefy

source ·
Expand description

Primitives for BEEFY protocol.

The crate contains shared data types used by BEEFY protocol and documentation (in a form of code) for building a BEEFY light client.

BEEFY is a gadget that runs alongside another finality gadget (for instance GRANDPA). For simplicity (and the initially intended use case) the documentation says GRANDPA in places where a more abstract “Finality Gadget” term could be used, but there is no reason why BEEFY wouldn’t run with some other finality scheme. BEEFY validator set is supposed to be tracking the Finality Gadget validator set, but note that it will use a different set of keys. For Polkadot use case we plan to use secp256k1 for BEEFY, while GRANDPA uses ed25519.

Modules

BEEFY cryptographic types
Registry of all known BeefyPayloadId.
BEEFY + MMR utilties.
Primitives for light, 2-phase interactive verification protocol.

Structs

A commitment signed by GRANDPA validators as part of BEEFY protocol.
Proof of voter misbehavior on a given set id. Misbehavior/equivocation in BEEFY happens when a voter votes on the same round/block for different payloads. Proving is achieved by collecting the signed commitments of conflicting votes.
An iterator over the variants of Self
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.
A BEEFY payload type allowing for future extensibility of adding additional kinds of payloads.
A commitment with matching GRANDPA validators’ signatures.
A set of BEEFY authorities, a.k.a. validators.
BEEFY vote message.

Enums

A consensus log item for BEEFY.
Set of test accounts using crate::crypto types.

Constants

The ConsensusEngineId of BEEFY.
Authority set id starts with zero at BEEFY pallet genesis.
Key type for BEEFY module.

Traits

API necessary for BEEFY voters.
Trait representing BEEFY authority id, including custom signature verification.
New BEEFY validator set notification hook.
Trait for custom BEEFY payload providers.

Functions

Check a commitment signature by encoding the commitment and verifying the provided signature using the expected authority id.
Verifies the equivocation proof by making sure that both votes target different blocks and that its signatures are valid.
Create a new EquivocationProof based on given arguments.

Type Definitions

The index of an authority.
Id of different payloads in the crate::Commitment data.
The type used to represent an MMR root hash.
A typedef for validator set id.