Unable to open subsequent data channels if the WebRTC Direct initial handshake channel has been closed
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 1.3k
- Avg merge
- 8h 47m
- Merged PRs (30d)
- 19
Description
Summary
The WebRTC Direct spec says:
On success of the authentication handshake, the used datachannel is closed and the plain WebRTC connection is used with its multiplexing capabilities via datachannels.
https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md#connection-security
At the moment the js-libp2p implementation does not close the handshake datachannel, leaving it open for the duration of the connection.
Given that the final data read from the channel during the noise handshake is done by the client, it would be the one to close the connection.
I am trying to update the js-libp2p implementation to close the handshake datachannel as per the spec but if I do, the transport interop tests start to fail against rust-libp2p with Chrome/Firefox/WebKit being the diallers (go & Node.js work fine).
From what I can see, after the handshake channel has been closed, opening the subsequent outbound channel to send the ping message never completes.
Inbound datachannels are still opened correctly as I can see from the logs that rust-libp2p pings js-libp2p during the test.
I believe @sukunrt observed something similar with rust-libp2p while working on go-libp2p, though he elected to just not close the handshake datachannel.
rust-libp2p logs from the test run in Docker are pasted below.
Expected behavior
Outbound datachannels should open correctly after the initial handshake datachannel has been closed.
Actual behavior
Outbound datachannels fail to open after the initial handshake datachannel has been closed.
Relevant log output
Logs from the Docker test run are below (GitHub complains it's too long to be pasted here).
Possible Solution
No response
Version
0.54
Would you like to work on fixing this bug?
I'd like some help resolving it
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the transport interop tests and the Rust WebRTC Direct handshake/datachannel lifecycle described in the issue, comparing behavior with js-libp2p. Reproduce the Chrome, Firefox, and WebKit dialler cases with the initial handshake channel closed; done means subsequent outbound datachannels open and the interop tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100