-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Description
In cf3e4c6, we added hole punching for QUIC. Currently, the map of active hole punches is indexed only by the remote's address.
This presents a problem if multiple peers share a single UDP socket.
To be fully correct, we should index our hole punches by socket address AND expected PeerId. To implement this however, we need to upgrade the connection in the QUIC transport, as the incoming connection is just a Future.
How this upgrade should happen is unclear:
- Spawning a new task from inside the
Transportwould create potentially unbounded work where a remote node can spam us with incoming connections. - Running the upgrade on the main task would introduce latency to usercode that also drives
NetworkBehaviours. - Having a single background task remove the parallelism we have for connection upgrades in the
Swarm.
One possible solution that we've debated is to move away from upgrading connections in the Swarm and instead change the Transport interface to do this for us. To still have parallelism for those, each Transport implementation would have to do this itself. Additionally, dial and dial_as_listener would no longer be able to return a Future but would have to return a DialId and the established connection as part of its event in poll.
This in turn presents a new problem: We need to be able to cancel in-progress dials to implement something like happy-eyeballs. Currently, we can just drop the returned Future.
Are you planning to do it yourself in a pull request?
No.