bsc/eth/protocols
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
..
diff fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
eth fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
snap dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
trust fix: code compatibility fixes 2022-07-05 11:14:21 +08:00