Expand description
Finality gadget for blockchains.
https://github.com/w3f/consensus/blob/master/pdf/grandpa.pdf
Consensus proceeds in rounds. Each round, voters will cast a prevote and precommit message.
Votes on blocks are then applied to the blockchain, being recursively applied to
blocks before them. A DAG is superimposed over the blockchain with the vote_graph
logic.
Equivocation detection and vote-set management is done in the round
module.
The work for actually casting votes is done in the voter
module.
Modules§
- round
- Logic for a single round of GRANDPA.
- vote_
graph - Maintains the vote-graph of the blockchain.
- voter
- A voter in GRANDPA. This transitions between rounds and casts votes.
- voter_
set - Implementation of a
VoterSet
, representing the complete set of voters and their weights in the context of a round of the protocol.
Structs§
- CatchUp
- A catch-up message, which is an aggregate of prevotes and precommits necessary to complete a round.
- Commit
- A commit message which is an aggregate of precommits.
- Commit
Validation Result - Struct returned from
validate_commit
function with information about the validation result. - Compact
Commit - A commit message with compact representation of authentication data.
- Equivocation
- An equivocation (double-vote) in a given round.
- Historical
Votes - Historical votes seen in a round.
- Precommit
- A precommit for a block and its ancestors.
- Prevote
- A prevote for a block and its ancestors.
- Primary
Propose - A primary proposed block, this is a broadcast of the last round’s estimate.
- Signed
Message - A signed message.
- Signed
Precommit - A signed precommit message.
- Signed
Prevote - A signed prevote message.
Enums§
Traits§
- Block
Number Ops - Arithmetic necessary for a block number.
- Chain
- Chain context necessary for implementation of the finality gadget.
Functions§
- process_
commit_ validation_ result - Runs the callback with the appropriate
CommitProcessingOutcome
based on the givenCommitValidationResult
. Outcome is bad if ghost is undefined, good otherwise. - validate_
commit - Validates a GRANDPA commit message.
Type Aliases§
- Multi
Auth Data - Authentication data for a set of many messages, currently a set of precommit signatures but in the future could be optimized with BLS signature aggregation.