-
Notifications
You must be signed in to change notification settings - Fork 896
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
7536 use head for snap sync #7718
7536 use head for snap sync #7718
Conversation
Signed-off-by: Kevin King <[email protected]>
Signed-off-by: Kevin King <[email protected]>
ca75702
to
5a43468
Compare
...th/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromBlock.java
Outdated
Show resolved
Hide resolved
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, good tests. One nit and one suggestion
@Override | ||
public Optional<FastSyncState> selectNewPivotBlock() { | ||
final Optional<ForkchoiceEvent> maybeForkchoice = forkchoiceStateSupplier.get(); | ||
if (maybeForkchoice.isPresent() && maybeForkchoice.get().hasValidSafeBlockHash()) { |
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.
hasValidSafeBlockHash() isn't necessary for the head block implementation. I would suggest making getPivotHash return Optional, and you can do the safe block check there and return Optional.empty() if it doesn't exist.
this is a very corner case, where we would be trying to sync a network very near genesis, before any block has been marked 'safe'. The prior implementation of safe-only would have the same issue. So this isn't a huge deal, but fixing it now might save a headache in the future for sync tests or something like that where we would be syncing a brand new chain.
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.
makes sense, applied changes
Signed-off-by: Kevin King <[email protected]>
Signed-off-by: kingnhcomcast <[email protected]>
Signed-off-by: Kevin King <[email protected]>
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.
🚢
This reverts commit a7e1f6a. Signed-off-by: Simon Dudley <[email protected]>
This reverts commit a7e1f6a. Signed-off-by: Simon Dudley <[email protected]>
…7767) This reverts commit a7e1f6a. Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: FlorianHuc <[email protected]>
…7767) This reverts commit a7e1f6a. Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: FlorianHuc <[email protected]>
PR description
Fixed Issue(s)
fixes #7536
Default is sync to head, added config option 'Xsnapsync-to-head-enabled' which can be set to false to revert to older sync to safe block.
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests