Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Mplex future #3490

Open
jxs opened this issue Aug 23, 2023 · 8 comments
Open

[Discussion] Mplex future #3490

jxs opened this issue Aug 23, 2023 · 8 comments

Comments

@jxs
Copy link

jxs commented Aug 23, 2023

Mplex is currently the main multiplexing protocol supported by all Ethereum consensus clients, while yamux MAY be supported:

Clients MUST support [mplex](https://github.com/libp2p/specs/tree/master/mplex)
and MAY support [yamux](https://github.com/hashicorp/yamux/blob/master/spec.md).
If both are supported by the client, yamux MUST take precedence during negotiation.
See the [Rationale](#design-decision-rationale) section below for tradeoffs.

Libp2p is deprecating Mplex on libp2p ¹ and making yamux the main and the only multiplexer for TCP.

With that in mind, should we update the spec to swap Mplex to MAY support and yamux to MUST support?

@AgeManning
Copy link
Contributor

Yep, I think the plan is to deprecate mplex once all the client teams have full support and prioritize it. Hopefully we can get this done before the next hard fork.

@nisdas
Copy link
Contributor

nisdas commented Aug 24, 2023

Other clients can chime in, but I think we might only get yamux fully supported and tested after deneb across all clients. So we will have to maintain mplex for a while. For that reason mplex will still need to be a MUST for now.

@arnetheduck
Copy link
Contributor

+1 for the hf after deneb. Practically, I envision clients will first support yamux then prefer it then mplex will finally be removed, resulting in a gradual migration.

@p-shahi
Copy link

p-shahi commented Aug 24, 2023

Protocol Labs is deprecating Mplex on libp2p ¹ and making yamux the main and the only multiplexer for TCP.

@jxs nit but an important one, any chance you can change s/"Protocol Labs"/"different implementations like go, rust, and js-libp2p are" as PL =/= the different implementations

@arnetheduck
Copy link
Contributor

nit

this is a libp2p spec deprecation first and foremost and PL maintains the spec - implementations follow, but they are not driving the deprecation in this case

@jxs
Copy link
Author

jxs commented Aug 24, 2023

Protocol Labs is deprecating Mplex on libp2p ¹ and making yamux the main and the only multiplexer for TCP.

@jxs nit but an important one, any chance you can change s/"Protocol Labs"/"different implementations like go, rust, and js-libp2p are" as PL =/= the different implementations

Thanks for the suggestion Prithvi, updated it

@Menduist
Copy link

Menduist commented Sep 6, 2023

Besides requiring stable yamux support in all implementation, the underlying libp2ps require a clever mechanism (which is not part of the specs) to have the same performance as mplex with more than 256kb in flight on a specific stream.
AFAIK, only go supports this mechanism: libp2p/go-yamux#54

Using yamux without this mechanism would cause an extra ~500ms delay on block propagation when they are >256kb, which we can expect from deneb

As long as this is not resolved, we shouldn't switch, imo
mplex is harder to work with, because of the lack of stream backpressure, but we already dealt with that, so let's not "move fast and break things" just to please some urge to clean a github repo

@Menduist
Copy link

Menduist commented Sep 6, 2023

And FWIW I agree with @arnetheduck, how can you say that the push to switch to yamux is coming from the libp2p implementations, when more than half of them don't have even a stable yamux yet @p-shahi?
(my definition of stable being "ran in prod for a few months")

While I appreciate the fact that thanks to the deprecation, things are starting to move towards yamux, this is very done very hastily, without consideration for networks with multiple libp2ps, and a big step back in term of libp2p interoperability.

(sorry for the off-topic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@jxs @arnetheduck @AgeManning @hwwhww @Menduist @nisdas @p-shahi and others