bsc/eth
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
..
catalyst dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
downloader fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
ethconfig fix comments: prune ancient compatibility, add prune ancient comments 2022-12-22 20:07:55 +08:00
fetcher eth/fetcher: fix re-queue failed issue; 2023-02-08 11:41:49 +08:00
filters eth, trie: sync with upstream v1.10.26 to solve snap sync issues (#1226) 2022-12-13 17:16:14 +08:00
gasprice dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
protocols fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
tracers dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
api_backend.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
api_test.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
api.go eth: fix typo in comment (#23941) 2021-11-22 02:53:16 +01:00
backend.go mointor: implement double sign monitor (#1199) 2023-02-03 15:53:36 +08:00
bloombits.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
discovery.go cmd/utils: use eth DNS tree for snap discovery (#22808) 2021-05-04 11:29:32 +02:00
handler_diff_test.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
handler_diff.go fix: memory leak issue with diff protocol (#1019) 2022-07-26 16:33:59 +08:00
handler_eth_test.go core/types: faster RLP encoding of Header, StateAcccount, Re... (#24420) 2022-08-26 14:44:54 +08:00
handler_eth.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
handler_trust.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
handler.go eth, trie: sync with upstream v1.10.26 to solve snap sync issues (#1226) 2022-12-13 17:16:14 +08:00
peer.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
peerset.go fix: p2p sync with lagging peer (#1301) 2023-02-09 22:01:44 +08:00
state_accessor.go dep: bump the version of several important library (#1274) 2023-02-02 19:36:37 +08:00
sync_test.go eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
sync.go fix: code compatibility fixes 2022-07-05 11:14:21 +08:00