-
Notifications
You must be signed in to change notification settings - Fork 12
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
Leader blocksync #1322
Merged
Merged
Leader blocksync #1322
Conversation
This file contains 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
0f8a485
to
4956a9a
Compare
4956a9a
to
5c4d7f3
Compare
4a7b93b
to
73d7cf5
Compare
When this merges we need a descriptive commit message, which actually would be good for the PR description too. ;) |
jchappelow
reviewed
Feb 3, 2025
jchappelow
reviewed
Feb 3, 2025
06294ea
to
bd9c175
Compare
LGTM, but might be a little last minute for a |
I am fairly confident, ran lots of tests for various sync scenarios. |
bd9c175
to
7d3b082
Compare
jchappelow
reviewed
Feb 3, 2025
jchappelow
approved these changes
Feb 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two mechanisms are used to prevent the leader from committing a block at an already finalized height:
height the leader must sync to before proposing blocks. The node operator should set the
checkpoint height based on the network's best height.
will respond with a NACK, indicating the leader is out-of-sync. They can provide an OutOfSyncProof
as evidence, including the BlockHeader and the leader's signature of the block the validator is on.
This forces the leader to catch up to the validator's block height before proposing blocks again. This
corrective mechanism allows leader to eventually converge to the best height.
However the nodes can still end up in these weird race scenarios where majority of Validators are in-sync with the leader, but not with the Validator with BestHeight, and the Ack's from the out of sync validators might end up reaching the leader faster than the OutOfSync NACK, eventually making the leader to commit the block. But the situation is not unrecoverable, leader and these Validators can always be wiped out and restarted to the correct state.