Skip to content
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

Merged
merged 37 commits into from
Mar 18, 2022
Merged

Conversation

gezero
Copy link
Contributor

@gezero gezero commented Mar 7, 2022

PR description

This PR is making changing backward sync to use the batching mechanism.

Copy link
Contributor

@macfarla macfarla left a 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

@gezero gezero force-pushed the batching-backward-sync branch 4 times, most recently from f3d85ad to f41df41 Compare March 11, 2022 19:27
matkt
matkt previously requested changes Mar 12, 2022
Copy link
Contributor

@matkt matkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comment

@gezero gezero force-pushed the batching-backward-sync branch 7 times, most recently from 3034f51 to 2e8fb73 Compare March 16, 2022 15:20
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]>
Copy link
Contributor

@garyschulte garyschulte left a 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

.getBlockchain()
.getBlockByHash(block.getHeader().getParentHash());
if (parent.isEmpty()) {
batchSize = batchSize / 2 + 1;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

  1. Give me 200 bodies
  2. Peer gives back bodies without one
  3. I import all blocks until the one that was not given back.
  4. 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.

Copy link
Contributor

@garyschulte garyschulte left a 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]>
@sonarcloud
Copy link

sonarcloud bot commented Mar 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

80.7% 80.7% Coverage
0.0% 0.0% Duplication

@garyschulte garyschulte dismissed matkt’s stale review March 18, 2022 17:01

to be addressed by #3614

@garyschulte garyschulte merged commit 0fce76c into hyperledger:main Mar 18, 2022
garyschulte pushed a commit to garyschulte/besu that referenced this pull request May 2, 2022
* Backward sync now batches requests

Signed-off-by: Jiri Peinlich <[email protected]>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Backward sync now batches requests

Signed-off-by: Jiri Peinlich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants