-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DO NOT MERGE] fix(dcutr): fix roles in tcp simultaneous connection #3044
base: master
Are you sure you want to change the base?
Conversation
On the side that in the new code will be the Server, can we add a random wait time after which the server will switch the role to Client and initiate the security negotiation? |
Does it need to be random? Could the server wait 3 RTT (it has the estimate) for the client and switch after? |
Unfortunately simple timeouts wont work. This is trickier. We need to always start as a Server. Then switch roles after a random wait. This is because when old go nodes and new go nodes interact, they may both assume the Client role, in which case, conn establishment will fail as both the sides assume the Client role. In the new code, if we always assume the role of Server, there will be 3 cases: old go node vs new go node
new go node vs new go node
|
97cc0b3
to
3a951e1
Compare
We did the opposite thing of what the spec says to do. This meant that we would fail to hole-punch with rust nodes because both sides we attempt to be the dialer.
cc7e359
to
6459ddb
Compare
We did the opposite thing of what the spec says to do. This meant that we would fail to hole-punch with rust nodes because both sides would attempt to be the dialer.
The spec is a bit confusing since roles get flipped in the middle. But essentially:
/libp2p/dcutr
protocol.This means the side handling the stream is the client, and the side initiating the stream should be the server.
Rollout:
We can't merge this until we figure out how we are going to roll this out.
This change, as is, is a backwards incompatible change. It would cause TCP hole punching to fail between go-libp2p nodes prior to this change and those after.
Let's discuss the rollout strategy here.