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

Add a new config to speed up block sync #244

Merged
merged 4 commits into from
Oct 17, 2024
Merged

Add a new config to speed up block sync #244

merged 4 commits into from
Oct 17, 2024

Conversation

yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented Oct 17, 2024

Describe your changes and provide context

This PR speed up block sync and fix a few issues:

  1. The bpr pending request number is too high, leading to overuse of network and possible gaps
  2. The peer pickup logic is not great, so that it would have a high chance to pick a slow peer or not responding peer, leading to constant timeout
  3. We should never switch to consensus mode if we are behind, we should stick to the catch up mode

Testing performed to validate your change

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 29.03226% with 22 lines in your changes missing coverage. Please review.

Project coverage is 58.08%. Comparing base (96d05f0) to head (d53293b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/p2p/peermanager.go 33.33% 7 Missing and 3 partials ⚠️
node/setup.go 0.00% 5 Missing and 1 partial ⚠️
internal/blocksync/pool.go 33.33% 3 Missing and 1 partial ⚠️
internal/blocksync/reactor.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
- Coverage   58.21%   58.08%   -0.13%     
==========================================
  Files         249      249              
  Lines       34485    34510      +25     
==========================================
- Hits        20074    20046      -28     
- Misses      12825    12872      +47     
- Partials     1586     1592       +6     
Files with missing lines Coverage Δ
config/config.go 63.11% <100.00%> (ø)
config/toml.go 51.35% <ø> (ø)
internal/blocksync/reactor.go 51.97% <33.33%> (ø)
internal/blocksync/pool.go 77.56% <33.33%> (-2.35%) ⬇️
node/setup.go 69.56% <0.00%> (-1.24%) ⬇️
internal/p2p/peermanager.go 79.31% <33.33%> (-0.83%) ⬇️

... and 12 files with indirect coverage changes

@yzang2019 yzang2019 merged commit 29b1ac3 into main Oct 17, 2024
23 of 24 checks passed
Kbhat1 pushed a commit that referenced this pull request Nov 13, 2024
* Never switch to consensus due to timeout

* Add blocksync peer config to speed up block sync rate

* Fix config parsing

* Add some logs
yzang2019 added a commit that referenced this pull request Dec 3, 2024
* Never switch to consensus due to timeout

* Add blocksync peer config to speed up block sync rate

* Fix config parsing

* Add some logs
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.

2 participants