Commit Graph

7 Commits

Author SHA1 Message Date
Jolly Zhao
15bc2548c1
fix logic issue: handlers.removePeer() is called twice. (#856)
* fix logic issue: handlers.removePeer() is called twice.

There is a logic issue which cause "Ethereum peer removal failed, err=peer not registered" occur quite often.

handler.runEthPeer set up a defer removePeer(). This is always called after a peer is disconnected.
However removePeer is also called by mulitple functions like downloader/fetcher.  After those kind of functions removePeer(), peer handler executes defer removePeer(). This makes removePeer() happened twice, and this is the reason we often see "Ethereum peer removal failed, err=peer not registered".

To solve this, removePeer only needs to hard Disconnect peer from networking layer. Then defer unregisterPeer() will do the cleanup task after then.

* fix: modify test function for close testing.

reference from go-thereum.

Co-authored-by: zjubfd <296179868@qq.com>
2022-04-24 14:24:07 +08:00
yutianwu
7c1c8e2e88
[R4R] add timeout for stopping p2p server (#643)
* add timeout for stopping p2p server

* extend extension wait time

* add unit tests

* fix lint issue
2021-12-13 11:16:03 +08:00
KeefeL
fbc52de8f6
[R4R]reannounce local pending transactions (#570)
* reannouce local pending transactions

* add tests for tx_pool reannouce local pending transactions

* add tests for handler reannounce local pending transactions
2021-11-25 11:00:14 +08:00
yutianwu
610f6a5e63
[R4R] add extension in eth protocol handshake to disable tx broadcast (#412)
* add extension for eth protocol handshake

* fix comments
2021-10-13 11:30:19 +08:00
Péter Szilágyi
fe1586b094
eth, les: drop support for eth/64, fix eth/66 tests 2021-04-09 10:39:45 +03:00
Péter Szilágyi
e3430ac7df
eth: check snap satelliteness, delegate drop to eth (#22235)
* eth: check snap satelliteness, delegate drop to eth

* eth: better handle eth/snap satellite relation, merge reg/unreg paths
2021-02-02 10:44:36 +02:00
Péter Szilágyi
017831dd5b
core, eth: split eth package, implement snap protocol (#21482)
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>
2020-12-14 10:27:15 +01:00