sei-protocol / sei-tendermint

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

Fix handshake and dial timeout #247

Closed yzang2019 closed 1 month ago

yzang2019 commented 1 month ago

Describe your changes and provide context

Sometimes a peer could end up having multiple different IP addresses in the network, some IP are stale, this will cause dial always fail and got stuck. Currently the dial and handshake timeout is not passed in correctly, leading to the fact that the timeout is infinite. So we should enable dial timeout to fix this issue.

Testing performed to validate your change

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Project coverage is 58.07%. Comparing base (29b1ac3) to head (4b1e977). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/blocksync/pool.go 66.66% 6 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247/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/247?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 #247 +/- ## ========================================== + Coverage 58.03% 58.07% +0.03% ========================================== Files 249 249 Lines 34510 34515 +5 ========================================== + Hits 20029 20043 +14 - Misses 12880 12881 +1 + Partials 1601 1591 -10 ``` | [Files with missing lines](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) | Coverage Δ | | |---|---|---| | [internal/p2p/peermanager.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247?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.33% <100.00%> (+0.02%)` | :arrow_up: | | [node/node.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247?src=pr&el=tree&filepath=node%2Fnode.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-bm9kZS9ub2RlLmdv) | `58.60% <100.00%> (+0.21%)` | :arrow_up: | | [internal/blocksync/pool.go](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247?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=) | `79.10% <66.66%> (+2.18%)` | :arrow_up: | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/sei-protocol/sei-tendermint/pull/247/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)