-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Description
While working on an interoperability test between py-libp2p
and rust-libp2p
for a simple ping exchange, I discovered that py-libp2p
still relies on mplex
as its default stream multiplexer (e.g., in libp2p/stream_muxer/mplex/
and used in TransportUpgrader
). However, mplex
has been deprecated across the libp2p
ecosystem, with implementations like rust-libp2p
and go-libp2p
now using yamux
as the standard multiplexer. This mismatch causes compatibility issues, as seen in my ongoing interop tests where py-libp2p
fails to mux streams with rust-libp2p
after the Noise handshake.
Impact
py-libp2p
cannot interoperate seamlessly with modernlibp2p
implementations that useyamux
.- The continued use of
mplex
risks falling further behind thelibp2p
spec and community standards.
Proposed Solution
- Replace
mplex
withyamux
as the default multiplexer inpy-libp2p
. - Update
TransportUpgrader
and related components to prioritize/yamux/1.0.0
over/mplex/0.0.1
. - Deprecate or remove
mplex
support to align withrust-libp2p
andgo-libp2p
.
Current Work
I’m actively working on implementing yamux
support in py-libp2p
(see libp2p/stream_muxer/yamux/yamux.py
). My current efforts include:
- Adapting
yamux.py
to use a 12-byte header per the spec. - Integrating it into
TransportUpgrader
for Noise/Yamux interop withrust-libp2p
. - Resolving type and linting issues (
mypy
,flake8
,pydocstyle
) for a clean PR.
I plan to submit a PR as soon as possible once the interop test succeeds and the implementation is stable.
Request for Feedback
- Would maintainers prefer
mplex
deprecated gradually (e.g., dual support) or removed outright?
Related Efforts
- My WIP interop PR: WIP.
rust-libp2p
Yamux reference: https://github.com/libp2p/rust-libp2p/tree/master/muxers/yamux.
Looking forward to collaborating on this to bring py-libp2p
up to date with the broader libp2p
ecosystem