bsc/eth/downloader
setunapo b3a20c7611
fix: p2p sync with lagging peer (#1301)
* fix: p2p sync with lagging peer

no need to sync with lagging peer, which could make the local chain stalling as well.

* fix: do not drop lagging peer, will retry it later.

The lagging peer is probably already the best peer with largest total difficulty.
Shoule not remove it, since p2p is a bidirectional connection, drop it could make
the peer unable to sync with this peer as well.
And the lagging peer could catch up later, so keep it.

* p2p: add lagging field in Peer

lagging peer will be connected, but won't be used to sync.
the lagging flag can be clear once the Peer updates its latest block state.

* test: fix UT compile issue

* fix: lagging peer func rename

* test: fix a UT fail of download test

errStallingPeer is replaced by errLaggingPeer in this case

* fix: lagging issue in light mode

* test: add and resolve UT of lagging peer
2023-02-09 22:01:44 +08:00
..
api.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
downloader_test.go fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
downloader.go fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
events.go cmd,eth: 16400 Add an option to stop geth once in sync. WIP for light mode (#17321) 2019-01-30 08:40:36 +01:00
fetchers_concurrent_bodies.go eth: pre-process downloader responses on the peer reader thread 2021-12-01 20:18:12 +02:00
fetchers_concurrent_headers.go eth: pre-process downloader responses on the peer reader thread 2021-12-01 20:18:12 +02:00
fetchers_concurrent_receipts.go eth: pre-process downloader responses on the peer reader thread 2021-12-01 20:18:12 +02:00
fetchers_concurrent.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
fetchers.go eth: pre-process downloader responses on the peer reader thread 2021-12-01 20:18:12 +02:00
metrics.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
modes.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
peer.go fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
queue_test.go eth: pre-process downloader responses on the peer reader thread 2021-12-01 20:18:12 +02:00
queue.go dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
resultstore.go dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
statesync.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
testchain_test.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00