-
Notifications
You must be signed in to change notification settings - Fork 5
Grandpa protocols #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
4d33321
9d5ba21
bc84a3e
a756666
356bc8d
feabc80
d470644
68d4070
2ad5f1f
3cf902a
be569e3
257246c
03df0db
555c272
7666d23
737b8ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -703,3 +703,85 @@ Auditor -> Validator | |
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
|
|
||
| ### CE 146: GRANDPA Vote | ||
|
|
||
| GRANDPA voter sets match validator sets for each epoch. | ||
| This is sent by each voting validator to all other voting validators. | ||
|
|
||
| ``` | ||
| Ed25519 Public = [u8; 32] | ||
| Round Number = u64 | ||
| Set Id = u32 | ||
| Prevote = Header Hash ++ Slot | ||
| Precommit = Header Hash ++ Slot | ||
| PrimaryPropose = Header Hash ++ Slot | ||
| Message = Enum { | ||
|
||
| 0 = Prevote, | ||
| 1 = Precommit, | ||
| 2 = PrimaryPropose | ||
| } | ||
| Signed Message = Message ++ Ed25519 Signature ++ Ed25519 Public | ||
|
||
|
|
||
| Validator -> Validator | ||
|
|
||
| --> 0 ++ Round Number ++ Set Id ++ Signed Message | ||
|
||
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
|
|
||
| ### CE 147: GRANDPA Commit | ||
|
|
||
| This is sent by each voting validator to all other voting validators. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to be clearer about the sending behaviour here. The paper says that to reduce spam, we should:
I assume this is implemented in the Rust crate? Although it doesn't seem critical that all implementations do exactly the same thing here, we should probably still document the expected behaviour. |
||
|
|
||
| ``` | ||
| Precommits = len++[Precommit] | ||
| Multi Auth Data = len++[Ed25519 Signature ++ Ed25519 Public] | ||
|
||
| Compact Commit = Header Hash ++ Slot ++ Precommits ++ Multi Auth Data | ||
|
||
|
|
||
| Validator -> Validator | ||
|
|
||
| --> 1 ++ Round Number ++ Set Id ++ Compact Commit | ||
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
|
|
||
| ### CE 148: GRANDPA State | ||
|
|
||
| This is sent by each voting validator to all other voting validators and informs them of the latest round it is participating in. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should clarify when this is sent. Is it sent once the validator "starts the round" as defined in the paper? |
||
|
|
||
| ``` | ||
| Validator -> Validator | ||
|
|
||
| --> 2 ++ Round Number ++ Set Id ++ Slot | ||
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
|
|
||
| ### CE 149: GRANDPA CatchUp | ||
|
|
||
| Catchup Request. This is sent by a voting validator to another validator. | ||
|
|
||
| ``` | ||
| Validator -> Validator | ||
|
|
||
| --> 3 ++ Round Number ++ Set Id | ||
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
|
|
||
| Catchup Response. This includes all votes required to catch up state to that of the responding voter. | ||
|
||
|
|
||
| ``` | ||
| Signed Prevote = Prevote ++ Ed25519 Signature ++ Ed25519 Public | ||
| Signed Precommit = Precommit ++ Ed25519 Signature ++ Ed25519 Public | ||
| Base Hash = Header Hash | ||
| Base Number = Slot | ||
| Catchup = Round Number ++ len++[Signed Prevote] ++ len++[Signed Precommit] ++ Base Hash ++ Base Number | ||
|
|
||
| Validator -> Validator | ||
|
|
||
| --> 4 ++ Set Id ++ Catchup | ||
| --> FIN | ||
| <-- FIN | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A summary of the vote types here and when they are sent would be good. Ideally it should be possible to implement this using only the GRANDPA paper and this document. So in particular, I think
PrimaryProposeneeds clarifying here, as I don't think that wording is used in the paper. I assume it is the block broadcast by the primary in step 2 of the protocol? We also need to define here how the primary is chosen as this is not defined in the paper.