Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server can't properly handshake clients #458

Closed
roman-khimov opened this issue Oct 28, 2019 · 0 comments · Fixed by #478
Closed

Server can't properly handshake clients #458

roman-khimov opened this issue Oct 28, 2019 · 0 comments · Fixed by #478
Assignees
Labels
bug Something isn't working network P2P layer
Milestone

Comments

@roman-khimov
Copy link
Member

Our production nodes have a lot of cases like this in their logs:

time="2019-10-25T23:06:52Z" level=info msg="new peer connected" addr="X.X.X.X:55234"
time="2019-10-25T23:06:52Z" level=warning msg="peer disconnected" addr="X.X.X.X:55234" peerCount=26 reason="invalid handshake: received Version in nothingDone state"

The problem is that the server doesn't expect Version packet to come from the client. Usually our node is a client and it sends its Version first, but on the server side this conversation is mirrored and should be processed the other way around.

@roman-khimov roman-khimov added the network P2P layer label Oct 28, 2019
@roman-khimov roman-khimov added this to the v0.61.0 milestone Oct 28, 2019
@roman-khimov roman-khimov added the bug Something isn't working label Oct 28, 2019
@roman-khimov roman-khimov modified the milestones: v0.61.0, v0.62.0 Nov 1, 2019
@roman-khimov roman-khimov self-assigned this Nov 5, 2019
roman-khimov added a commit that referenced this issue Nov 6, 2019
This allows to start handshaking from both client and server (mainnet/testnet
nodes were seen to not care about string ordering for it), but still maintains
some sane checks in the process. It also makes functions thread-safe because
we have two goroutines servicing read and write side of the Peer connection,
so they can clash on access to the struct fields.

Add a test for it also.
roman-khimov added a commit that referenced this issue Nov 6, 2019
This allows to start handshaking from both client and server (mainnet/testnet
nodes were seen to not care about string ordering for it), but still maintains
some sane checks in the process. It also makes functions thread-safe because
we have two goroutines servicing read and write side of the Peer connection,
so they can clash on access to the struct fields.

Add a test for it also.
roman-khimov added a commit that referenced this issue Nov 6, 2019
This allows to start handshaking from both client and server (mainnet/testnet
nodes were seen to not care about string ordering for it), but still maintains
some sane checks in the process. It also makes functions thread-safe because
we have two goroutines servicing read and write side of the Peer connection,
so they can clash on access to the struct fields.

Add a test for it also.
roman-khimov added a commit that referenced this issue Nov 6, 2019
Fixes #458, MaxPeers handling and some other related things.
volekerb pushed a commit that referenced this issue Nov 11, 2019
This allows to start handshaking from both client and server (mainnet/testnet
nodes were seen to not care about string ordering for it), but still maintains
some sane checks in the process. It also makes functions thread-safe because
we have two goroutines servicing read and write side of the Peer connection,
so they can clash on access to the struct fields.

Add a test for it also.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working network P2P layer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant