libp2p / libp2p/rust-libp2p

Switch from `webrtc-rs` to `str0m`

Open
#3,659 19 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty:hard help wanted priority:nicetohave
Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Description

The webrtc-rs implementation has a few fundamental issues due to its design. async callbacks require locks and prevent the idiomatic use of &mut. This results in problems such as https://github.com/webrtc-rs/webrtc/issues/413 which currently prevent us from upgrading to the latest version: https://github.com/libp2p/rust-libp2p/pull/3552

The new kid on the block is str0m, a sans IO implementation of the webrtc stack: https://github.com/algesten/str0m

In the tests, it looks like they already support data channels, meaning we might be able to replace webrtc with it.

Motivation

  • webrtc is an extremely heavy dependency and it bloats our dependency tree
  • It doesn't follow idiomatic Rust and was hard to integrate into our codebase
  • From the above follows: Easier maintenance
  • A production-grade webrtc implementation

Related issues:

Are you planning to do it yourself in a pull request?

No.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests in rust-libp2p. Start by locating the current webrtc dependency and data-channel integration, then review the str0m tests referenced in the issue. Done means replacing the existing implementation with str0m while preserving supported data-channel behavior and reducing the dependency burden.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
audio-video-rtc, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.