* 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
* reannouce local pending transactions
* add tests for tx_pool reannouce local pending transactions
* add tests for handler reannounce local pending transactions
Prevents a situation where we (not running snap) connects with a peer running snap, and get stalled waiting for snap registration to succeed (which will never happen), which cause a waitgroup wait to halt shutdown
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default.
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>