This repository has been archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Peers Cannot Successfully Handshake #70
Comments
@nisdas thank you for diagnosing and reporting this! We should be able to detect when a simultaneous connection is happening and automatically assign the initiator / responder role based on some deterministic criteria, e.g. by comparing the hash of the initial messages. I'll start working on that today and keep this issue updated as things progress. |
This is not sufficient, this has to be propagated to the muxer as well -- yamux in particular. |
see also libp2p/go-libp2p#712 |
Hey @yusefnapora , any update on this ? |
We face the same problem in Anytype. Do you have any update on this? @yusefnapora @jbenet |
3 tasks
1 task
8 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In local testing with
NOISE
enabled, I getfailed to negotiate security protocol: error reading handshake message: noise: message is too short
often. For a background on this issue and more context: prysmaticlabs/prysm#5372 .This happens often enough with two peers trying to connect and performing a NOISE handshake with each other. On further exploration this was because each peer regarded themselves as the initiator of the handshake in the same connection, which lead to malformed handshake responses being produced. This was because each peer read the initiating payload from the other peer as a response to their initial handshake. I am not sure how this happens, this would point to the issue being in Swarm rather than Noise. To clarify this only happens when each peer dials each other at the same time.
I explored this issue in SECIO too, and did notice that there were instances where both peers dialed each other the same time and shared the same connection, instead of having separate connections for each respective dial. However SECIO differs from NOISE in the fact that there is no fixed
initiator
orresponder
. Each peer is expected to write the initial proposal payload into the stream at the same time, and also read the corresponding peer's proposal from the same stream. Therefore SECIO wouldn't fail from the same issue as NOISE.To reproduce this you can run the following test:
You can split out noise for secio, and you will notice that the error disappears
The text was updated successfully, but these errors were encountered: