Repository navigation
Description
Unit W5.10 of docs/PLAN.md. The row lands with this unit's pull request (see "The docs this unit corrects").
The mplex Muxer value, Mux.mplex under /mplex/6.7.0: the message codec, the go-compatible (id, initiator) stream identity, the half-close rules, and the 1 MiB message cap. It is unit 2 of packages/libp2p/mux/docs/PLAN.md, which #17 (W5.4) left open.
Why this unit exists
The consensus networking spec makes mplex a requirement for every TCP client. vendor/consensus-specs/specs/phase0/p2p-interface.md, lines 210 to 215, at the pin 0216d01:
Clients that support the TCP transport MUST support mplex and MAY support yamux. If both are supported by the client, yamux MUST take precedence during negotiation.
The node speaks TCP, so it must speak mplex, and it must offer yamux first.
The docs this unit corrects
The root docs say the spec removed mplex, and they defer it on that ground. The pinned spec says otherwise, and the spec wins (CLAUDE.md, "Spec is the source of truth"). The pull request corrects, root first:
- root
docs/ARCHITECTURE.md: §1 (line 30, "TLS and mplex beyond their seams"), the §8 transport table (line 1004, "the spec removed mplex"), and the §8 deferred list (line 1032, "mplex. The eth2 networking spec removed it."); - root
docs/PLAN.md: the graph note (line 41), theW5.4row (line 103), the "Deferred" list (line 123), and a newW5.10row; CLAUDE.md, "Scope": mplex moves from the deferred list into the v1 list;packages/libp2p/mux/docs/: unit 2 stops being P2.
go-libp2p v0.50.0 removed mplex from its defaults (the cli PLAN records this for the matrix). That is a difference with go, not with the spec, and it is recorded as one (PRINCIPLES 2.1).
Where the spec lives
- The wire format:
vendor/specs/mplex/README.md. - The package docs:
packages/libp2p/mux/docs/ARCHITECTURE.md(theMux.mplexsurface, contracts 4 and 5, the 1 MiB cap) andPLAN.md(unit 2 and its milestones). - The root contract:
docs/ARCHITECTURE.md§4.9 (the identity rule) and §5.1 (the mplex framing cap). - The references: the
spikebranch,Conn/Mplex.lean; go-mplex, rust-libp2p'smuxers/mplex, js-libp2p'sstream-multiplexer-mplex, and nim-libp2p'smuxers/mplex.
Definition of done
Mux.mplex : Core.Muxerfollows the mux ARCHITECTURE's public surface, and its owned contracts hold.- The unit 2 test milestones of the mux PLAN pass: the identity rule, the 1 MiB cap before allocation, the 9-byte header varint bound, the three half-close cases, and reset in both directions.
Mux.mplexinteroperates with go-mplex over loopback TCP in both directions. go-libp2p v0.50 has no mplex, so the go side is go-mplex itself.- Every host the repo assembles offers
[Mux.yamux, Mux.mplex], in that order (the spec's precedence rule). The interop harness takesMux.mplexformuxer=mplex. lake build --wfail,lake test, the suite withLEAN_NUM_THREADS=1, andscripts/lint-imports.share green.- No
sorry, no build warnings (CLAUDE.md, "Strict checking").
Depends on
- [W5.2] libp2p/core: the types and the seams #15 (
W5.2), merged: theMuxerseam. - [W5.4] libp2p/mux: the Muxer values #17 (
W5.4), closed:Mux.mplexIdandMux.mplexMessageCap. - [SEAM] W5.9 interop: connect Interop.Mock.Stack and land the green matrix run inside #60 #73 (
W5.9seam, PR feat(cli): run the interop harness on the real stack #88) for the harness wiring only.
Ground rules
- Comment
claimto take the issue. - Target the
hackathon26branch. - The license-acceptance line of the PR description stays ticked; commits carry no AI co-author trailers.
- Prose register everywhere: CLAUDE.md, "Writing Style".
Activity