This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
grandpa: always store justification for the latest finalized block #8392
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
|
Still want to add some tests for this. |
Contributor
|
Awesome, nicely done! |
andresilva
commented
Mar 18, 2021
octol
approved these changes
Mar 18, 2021
Contributor
octol
left a comment
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.
Looks good!
Contributor
Author
|
Sorry but I forgot about this PR. Should be good to merge now. |
Contributor
|
I'm not qualified to review, but I enjoy the idea of merging this. |
Contributor
Author
expenses
approved these changes
Apr 1, 2021
Contributor
expenses
left a comment
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.
LGTM
Contributor
Author
|
bot merge |
|
Trying merge. |
hirschenberger
pushed a commit
to hirschenberger/substrate
that referenced
this pull request
Apr 14, 2021
…aritytech#8392) * grandpa: always store justification for best finalized block * grandpa-warp-sync: add latest justification when finished proving * grandpa-warp-sync: change logic for sending best justification when finished * grandpa: test storing best justification * grandpa: reorder variants in WarpSyncFinished
This pull request was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when GRANDPA finalizes a block the client does not always persist the justification. It currently only does it: on authority set change blocks, randomly every N blocks. Since the only justifications that are required to provably sync the chain correctly are for the authority set handoffs it would just contribute to database bloat if we kept justifications for everything that's finalized. Still having a justification at hand for a recent block is useful to prove finality to light clients who don't participate in the GRANDPA protocol.
This PR adds a GRANDPA auxiliary storage entry where we always store the justification for the latest finalized block and overwrite it once a new block gets finalized.
Additionally I updated the warp sync protocol to make sure that we send the latest justification once we have finished warp syncing to the latest authority set.