-
Notifications
You must be signed in to change notification settings - Fork 852
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
Support BFT mining coordinator being temporarily stopped while syncing #7657
Merged
matthew1001
merged 10 commits into
hyperledger:main
from
matthew1001:bft-pause-while-syncing
Oct 9, 2024
Merged
Support BFT mining coordinator being temporarily stopped while syncing #7657
matthew1001
merged 10 commits into
hyperledger:main
from
matthew1001:bft-pause-while-syncing
Oct 9, 2024
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
…g happens Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
fab-10
reviewed
Sep 20, 2024
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, please add a CHANGELOG entry, and does it make sense to add some tests?
Yes good point, I'll add both shortly @fab-10 |
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Signed-off-by: Matthew Whitehead <[email protected]>
Tests & changelog entry added @fab-10 |
fab-10
approved these changes
Oct 8, 2024
macfarla
reviewed
Oct 9, 2024
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftEventQueue.java
Outdated
Show resolved
Hide resolved
macfarla
reviewed
Oct 9, 2024
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftProcessor.java
Outdated
Show resolved
Hide resolved
macfarla
approved these changes
Oct 9, 2024
…common/bft/BftEventQueue.java Co-authored-by: Sally MacFarlane <[email protected]> Signed-off-by: Matt Whitehead <[email protected]>
…common/bft/BftProcessor.java Co-authored-by: Sally MacFarlane <[email protected]> Signed-off-by: Matt Whitehead <[email protected]>
Signed-off-by: Matt Whitehead <[email protected]>
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.
PR description
When a new BFT node starts syncing against an existing chain, its BFT block timer tries to propose blocks even though it does not have the current state of the chain. This can result in exceptions such as:
BFT nodes should not try to propose blocks until they are in sync with the rest of the chain. This PR makes the following changes:
BftProcessor
so that the existingstop()
call isn't necessarily terminal. Today it only appears to be used on shutdown. This PR makes it possible tostop()
aBftProcessor
in such a way that it can be restarted again without the node restartingBftMiningCoordinator
to restart theBftProcessor
when it the coordinator is restartedThe result is that a node can begin doing BFT work (e.g. in the case where it is a single node with nobody to sync with, or where it is a validator for a brand new chain), but then stop its BFT work if it determines that it has a sync peer and starts downloading from it. Once syncing has completed the BFT work can then resume, this time with up-to-date state for the chain.