This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
Base p2p handshake code doesn't like Disconnect as first message across the connection. #1167
Comments
I was going through the open issues and this one caught my attention because I remember investigating something like this in the past, but it turns out it was a similar issue during the auth handshake: ethereum/py-evm#901 Anyway, I've confirmed that attempting to connect to a (geth) node with maxed out peers is the cause for that HandshakeFailure, but as it is a generic handshake failure, the peer connection tracker will retry that peer after every 10 seconds. I believe the correct solution is to raise a |
gsalgado
added a commit
to gsalgado/trinity
that referenced
this issue
Nov 19, 2019
A maxed out peer will disconnect during the P2P handshake by sending us a disconnect msg with the TOO_MANY_PEERS reason. We must detect that and wait a while before attempting to connect again. Closes ethereum#1167
gsalgado
added a commit
to gsalgado/trinity
that referenced
this issue
Nov 20, 2019
A maxed out peer will disconnect during the P2P handshake by sending us a disconnect msg with the TOO_MANY_PEERS reason. We must detect that and wait a while before attempting to connect again. Closes ethereum#1167
gsalgado
added a commit
to gsalgado/trinity
that referenced
this issue
Nov 20, 2019
A maxed out peer will disconnect during the P2P handshake by sending us a disconnect msg with the TOO_MANY_PEERS reason. We must detect that and wait a while before attempting to connect again. Closes ethereum#1167
gsalgado
added a commit
that referenced
this issue
Nov 21, 2019
A maxed out peer will disconnect during the P2P handshake by sending us a disconnect msg with the TOO_MANY_PEERS reason. We must detect that and wait a while before attempting to connect again. Closes #1167
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What is wrong?
I'm seeing this line show up in logs a lot:
I suspect these are common because when we try to dial a peer that has a full peer pool, they may just immediately send the disconnect message rather than handshaking.
We should handle this gracefully as it happens a lot and it seems reasonable.
How can it be fixed
trinity/p2p/handshake.py
Lines 126 to 130 in 83a2963
THis code should be updated to special case the
Disconnect
message. The handshake still needs to fail so we could just raise aHandshakeFailure
exception with a more appropriate message.The text was updated successfully, but these errors were encountered: