-
Notifications
You must be signed in to change notification settings - Fork 804
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
Batching backward sync #3532
Batching backward sync #3532
Conversation
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.
added some comments mostly about logging messages
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java
Outdated
Show resolved
Hide resolved
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java
Outdated
Show resolved
Hide resolved
.../eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java
Outdated
Show resolved
Hide resolved
f3d85ad
to
f41df41
Compare
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.
Added some comment
...main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncLookupService.java
Show resolved
Hide resolved
.../eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardsSyncContext.java
Outdated
Show resolved
Hide resolved
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java
Outdated
Show resolved
Hide resolved
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java
Outdated
Show resolved
Hide resolved
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java
Outdated
Show resolved
Hide resolved
3034f51
to
2e8fb73
Compare
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
Signed-off-by: Jiri Peinlich <[email protected]>
3ca29f1
to
aa083e6
Compare
Signed-off-by: Jiri Peinlich <[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.
some minor feedback, will push a PR to address
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardsSyncContext.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueSegmentIdentifier.java
Show resolved
Hide resolved
...hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java
Show resolved
Hide resolved
...eum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java
Outdated
Show resolved
Hide resolved
...n/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/GenericKeyValueStorageFacade.java
Outdated
Show resolved
Hide resolved
.../eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhase.java
Outdated
Show resolved
Hide resolved
.../eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhase.java
Outdated
Show resolved
Hide resolved
.getBlockchain() | ||
.getBlockByHash(block.getHeader().getParentHash()); | ||
if (parent.isEmpty()) { | ||
batchSize = batchSize / 2 + 1; |
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 is a little opaque. Why are we changing batchSize if we encounter a missing parent?
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.
I noticed that very occasionally when I request too many bodies at the same time, some peers do not give me back all the bodies back. I ended up in an endless loop.
- Give me 200 bodies
- Peer gives back bodies without one
- I import all blocks until the one that was not given back.
- Repeat 1,2 forever because the one not given back is always the same first block now.
I noticed that reducing the batch size (to eventually ask just for 1 body) resolved that issue for me. I am happy to apply a different tactic.
...m/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksConvertor.java
Outdated
Show resolved
Hide resolved
Signed-off-by: garyschulte <[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.
left a few comments/questions open, but ✅
Signed-off-by: Jiri Peinlich <[email protected]>
…ching-backward-sync
Signed-off-by: Jiri Peinlich <[email protected]>
8cce883
to
bbe59bf
Compare
ec18c73
to
a75453a
Compare
Signed-off-by: Jiri Peinlich <[email protected]>
a75453a
to
fec1462
Compare
Kudos, SonarCloud Quality Gate passed! |
* Backward sync now batches requests Signed-off-by: Jiri Peinlich <[email protected]>
* Backward sync now batches requests Signed-off-by: Jiri Peinlich <[email protected]>
PR description
This PR is making changing backward sync to use the batching mechanism.