Crate tp_finality_grandpa[][src]

Primitives for GRANDPA integration, suitable for WASM compilation.

Structs

EquivocationProof

Proof of voter misbehavior on a given set id. Misbehavior/equivocation in GRANDPA happens when a voter votes on the same round (either at prevote or precommit stage) for different blocks. Proving is achieved by collecting the signed messages of conflicting votes.

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.

ScheduledChange

A scheduled change of authority set.

VersionedAuthorityList

An AuthorityList that is encoded with a version specifier. The encoding version is updated any time the AuthorityList type changes. This ensures that encodings of different versions of an AuthorityList are differentiable. Attempting to decode an authority list with an unknown version will fail.

Enums

ConsensusLog

An consensus log item for GRANDPA.

Equivocation

Wrapper object for GRANDPA equivocation proofs, useful for unifying prevote and precommit equivocations under a common type.

Constants

AUTHORITIES_CALL

WASM function call to get current GRANDPA authorities.

GRANDPA_AUTHORITIES_KEY

The storage key for the current set of weighted Grandpa authorities. The value stored is an encoded VersionedAuthorityList.

GRANDPA_ENGINE_ID

The ConsensusEngineId of GRANDPA.

KEY_TYPE

Key type for GRANDPA module.

PENDING_CHANGE_CALL

WASM function call to check for pending changes.

Traits

GrandpaApi

APIs for integrating the GRANDPA finality gadget into runtimes. This should be implemented on the runtime side.

Functions

check_equivocation_proof

Verifies the equivocation proof by making sure that both votes target different blocks and that its signatures are valid.

check_message_signature

Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id.

check_message_signature_with_buffer

Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id. The encoding necessary to verify the signature will be done using the given buffer, the original content of the buffer will be cleared.

localized_payload

Encode round message localized to a given round and set id.

localized_payload_with_buffer

Encode round message localized to a given round and set id using the given buffer. The given buffer will be cleared and the resulting encoded payload will always be written to the start of the buffer.

sign_message

Localizes the message to the given set and round and signs the payload.

Type Definitions

AuthorityId

Identity of a Grandpa authority.

AuthorityIndex

The index of an authority.

AuthorityList

A list of Grandpa authorities with associated weights.

AuthorityPair

The grandpa crypto scheme defined via the keypair type.

AuthoritySignature

Signature for a Grandpa authority.

AuthorityWeight

The weight of an authority.

RoundNumber

The round indicator.

SetId

The monotonic identifier of a GRANDPA set of authorities.