Expand description
Primitives for GRANDPA integration, suitable for WASM compilation.
Structs§
- Equivocation
Proof - 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.
- Grandpa
Justification - A GRANDPA justification for block finality, it includes a commit message and an ancestry proof including all headers routing all precommit target blocks to the commit target block. Due to the current voting strategy the precommit targets should be the same as the commit target, since honest voters don’t vote past authority set change blocks.
- Scheduled
Change - A scheduled change of authority set.
Enums§
- Consensus
Log - An consensus log item for GRANDPA.
- Equivocation
- Wrapper object for GRANDPA equivocation proofs, useful for unifying prevote and precommit equivocations under a common type.
- Signature
Result - Result of checking a message signature.
Constants§
- CLIENT_
LOG_ TARGET - The log target to be used by client code.
- GRANDPA_
ENGINE_ ID - The
ConsensusEngineId
of GRANDPA. - KEY_
TYPE - Key type for GRANDPA module.
- RUNTIME_
LOG_ TARGET - The log target to be used by runtime code.
Traits§
- Grandpa
Api - 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 Aliases§
- Authority
Id - Identity of a Grandpa authority.
- Authority
Index - The index of an authority.
- Authority
List - A list of Grandpa authorities with associated weights.
- Authority
Pair - The grandpa crypto scheme defined via the keypair type.
- Authority
Signature - Signature for a Grandpa authority.
- Authority
Weight - The weight of an authority.
- CatchUp
- A catch up message for this chain’s block type.
- Commit
- A commit message for this chain’s block type.
- Compact
Commit - A compact commit message for this chain’s block type.
- Message
- A GRANDPA message for a substrate chain.
- 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. - Precommit
- A precommit message for this chain’s block type.
- Prevote
- A prevote message for this chain’s block type.
- Primary
Propose - A primary propose message for this chain’s block type.
- Round
Number - The round indicator.
- SetId
- The monotonic identifier of a GRANDPA set of authorities.
- Signed
Message - A signed message.