33cn / chain33

高度模块化, 遵循 KISS原则的区块链开发框架
https://chain.33.cn
BSD 3-Clause "New" or "Revised" License
725 stars 254 forks source link

Optimize sync and Fix p2p bug #1302

Closed suyanlong closed 1 year ago

suyanlong commented 1 year ago

@vipwzw @libangzhu

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 87.01% and project coverage change: +0.08 :tada:

Comparison is base (a70aec9) 61.85% compared to head (4d2d1b6) 61.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1302 +/- ## ========================================== + Coverage 61.85% 61.93% +0.08% ========================================== Files 170 171 +1 Lines 23685 23741 +56 ========================================== + Hits 14650 14705 +55 Misses 7205 7205 - Partials 1830 1831 +1 ``` | [Impacted Files](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [blockchain/blockstore.go](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxvY2tjaGFpbi9ibG9ja3N0b3JlLmdv) | `62.20% <ø> (-0.19%)` | :arrow_down: | | [system/p2p/dht/protocol/download/task.go](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3lzdGVtL3AycC9kaHQvcHJvdG9jb2wvZG93bmxvYWQvdGFzay5nbw==) | `74.11% <80.00%> (+2.16%)` | :arrow_up: | | [system/p2p/dht/protocol/download/counter.go](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3lzdGVtL3AycC9kaHQvcHJvdG9jb2wvZG93bmxvYWQvY291bnRlci5nbw==) | `84.90% <84.90%> (ø)` | | | [system/p2p/dht/protocol/download/download.go](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3lzdGVtL3AycC9kaHQvcHJvdG9jb2wvZG93bmxvYWQvZG93bmxvYWQuZ28=) | `57.64% <100.00%> (+1.02%)` | :arrow_up: | | [system/p2p/dht/protocol/download/handler.go](https://app.codecov.io/gh/33cn/chain33/pull/1302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3lzdGVtL3AycC9kaHQvcHJvdG9jb2wvZG93bmxvYWQvaGFuZGxlci5nbw==) | `46.01% <100.00%> (-0.94%)` | :arrow_down: | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/33cn/chain33/pull/1302/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

suyanlong commented 1 year ago

image image

问题:同步时,选择时延最小的节点同步区块,会存在问题,会导致,每一次发送同步请求,都落在相同的一个节点上. 时延增大,造成中心化问题。并且可用节点个数要大于3个以上,才能发起同步请求。

33cn commented 1 year ago

:tada: This PR is included in version 1.68.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: