[WIP] feat(webrtc): add experimental WebRTC transport to litep2p backend#12315
[WIP] feat(webrtc): add experimental WebRTC transport to litep2p backend#12315gab8i wants to merge 3 commits into
Conversation
Add webrtc-direct support to the litep2p backend, gated behind a new `--experimental-webrtc` CLI flag. - WebRTC `listen_addr` entries are skipped with a warning unless enabled. - Persist the DTLS certificate to `<net_config_path>/webrtc_certificate` so the node keeps a stable identity across restarts. Fall back to an ephemeral cert otherwise. - update network type to support `WebRTCDirect`
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
/cmd prdoc --audience node_dev --bump patch |
…e_dev --bump patch'
| nodelay: true, | ||
| ..Default::default() | ||
| }) | ||
| .with_webrtc({ |
There was a problem hiding this comment.
I think we shouldn't call with_webrtc if the provided listen addresses are empty.
One extra thing would be to warn if:
- experimental webrtc feature is enabled
- no webrtc addresses are provide
There was a problem hiding this comment.
Ok, that's easy to adjust. The idea was to keep the same approach for each transport layer, to support this litep2p does a no-op if config contains no listen addresses.
I will add the warnings and update the code to only call with_webrtc if webrtc_address is not empty!
| /// Experimental: `/ip4/0.0.0.0/udp/<port>/webrtc-direct` and | ||
| /// `/ip6/[::]/udp/<port>/webrtc-direct`. Only works on litep2p network backend. |
There was a problem hiding this comment.
Nit: Should we specify that 0.0.0.0 isn't allowed and that the proper external IP address should be configured instead? Maybe we should double check for interface 0.0.0.0 in the provided list?
Description
Add webrtc-direct support to the litep2p backend
--experimental-webrtcCLI flag.listen_addrentries are skipped with a warning unless enabled.<net_config_path>/webrtc_certificateso the node keeps a stable identity across restarts. Fall back to an ephemeral cert otherwise.WebRTCDirectIntegration
No behavioral change unless --experimental-webrtc is explicitly enabled.
Review Notes
This PR adds experimental webrtc-direct transport support to the litep2p network backend. It is fully opt-in: nothing changes for existing nodes unless the operator explicitly passes --experimental-webrtc and supplies a webrtc-direct listen address. Default backend (litep2p) behavior, the libp2p backend, and all existing transports are untouched.
Checklist
Trequired)/cmd label <label-name>to add labels