sei-protocol / sei-tendermint

Tendermint fork with ABCI++ support, bug fixes, and custom features
Other
39 stars 36 forks source link

Add a new config to speed up block sync #244

Closed yzang2019 closed 1 month ago

yzang2019 commented 1 month ago

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

codecov[bot] commented 1 month ago

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 :warning:
node/setup.go 0.00% 5 Missing and 1 partial :warning:
internal/blocksync/pool.go 33.33% 3 Missing and 1 partial :warning:
internal/blocksync/reactor.go 33.33% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244/graphs/tree.svg?width=650&height=150&src=pr&token=VYIWMMGYMP&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) ```diff @@ 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](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) | Coverage Δ | | |---|---|---| | [config/config.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=config%2Fconfig.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-Y29uZmlnL2NvbmZpZy5nbw==) | `63.11% <100.00%> (ø)` | | | [config/toml.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=config%2Ftoml.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-Y29uZmlnL3RvbWwuZ28=) | `51.35% <ø> (ø)` | | | [internal/blocksync/reactor.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=internal%2Fblocksync%2Freactor.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-aW50ZXJuYWwvYmxvY2tzeW5jL3JlYWN0b3IuZ28=) | `51.97% <33.33%> (ø)` | | | [internal/blocksync/pool.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=internal%2Fblocksync%2Fpool.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-aW50ZXJuYWwvYmxvY2tzeW5jL3Bvb2wuZ28=) | `77.56% <33.33%> (-2.35%)` | :arrow_down: | | [node/setup.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=node%2Fsetup.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-bm9kZS9zZXR1cC5nbw==) | `69.56% <0.00%> (-1.24%)` | :arrow_down: | | [internal/p2p/peermanager.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244?src=pr&el=tree&filepath=internal%2Fp2p%2Fpeermanager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-aW50ZXJuYWwvcDJwL3BlZXJtYW5hZ2VyLmdv) | `79.31% <33.33%> (-0.83%)` | :arrow_down: | ... and [12 files with indirect coverage changes](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/244/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)