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

muxer: remove support for mplex #2498

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ require (
github.com/libp2p/go-flow-metrics v0.1.0
github.com/libp2p/go-libp2p-asn-util v0.3.0
github.com/libp2p/go-libp2p-testing v0.12.0
github.com/libp2p/go-mplex v0.7.0
github.com/libp2p/go-msgio v0.3.0
github.com/libp2p/go-nat v0.2.0
github.com/libp2p/go-netroute v0.2.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLE
github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w=
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg=
github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY=
github.com/libp2p/go-mplex v0.7.0/go.mod h1:rW8ThnRcYWft/Jb2jeORBmPd6xuG3dGxWN/W168L9EU=
github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0=
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk=
Expand Down
48 changes: 0 additions & 48 deletions p2p/muxer/mplex/conn.go

This file was deleted.

64 changes: 0 additions & 64 deletions p2p/muxer/mplex/stream.go

This file was deleted.

28 changes: 0 additions & 28 deletions p2p/muxer/mplex/transport.go

This file was deleted.

52 changes: 0 additions & 52 deletions p2p/muxer/mplex/transport_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion p2p/net/swarm/swarm_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestMetricsNoAllocNoCover(t *testing.T) {
{StreamMultiplexer: "yamux", Security: "tls", Transport: "tcp", UsedEarlyMuxerNegotiation: true},
{StreamMultiplexer: "yamux", Security: "noise", Transport: "tcp", UsedEarlyMuxerNegotiation: false},
{StreamMultiplexer: "", Security: "", Transport: "quic"},
{StreamMultiplexer: "mplex", Security: "noise", Transport: "tcp"},
{StreamMultiplexer: "another-yamux", Security: "noise", Transport: "tcp"},
}

directions := []network.Direction{network.DirInbound, network.DirOutbound}
Expand Down
21 changes: 10 additions & 11 deletions p2p/test/negotiation/muxer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/libp2p/go-libp2p/core/sec/insecure"
"github.com/libp2p/go-libp2p/p2p/muxer/mplex"
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
"github.com/libp2p/go-libp2p/p2p/security/noise"
tls "github.com/libp2p/go-libp2p/p2p/security/tls"
Expand All @@ -21,8 +20,8 @@ import (
)

var (
yamuxOpt = libp2p.Muxer("/yamux", yamux.DefaultTransport)
mplexOpt = libp2p.Muxer("/mplex", mplex.DefaultTransport)
yamuxOpt = libp2p.Muxer("/yamux", yamux.DefaultTransport)
anotherYamuxOpt = libp2p.Muxer("/another-yamux", yamux.DefaultTransport)
)

type testcase struct {
Expand All @@ -43,32 +42,32 @@ func TestMuxerNegotiation(t *testing.T) {
testcases := []testcase{
{
Name: "server and client have the same preference",
ServerPreference: []libp2p.Option{yamuxOpt, mplexOpt},
ClientPreference: []libp2p.Option{yamuxOpt, mplexOpt},
ServerPreference: []libp2p.Option{yamuxOpt, anotherYamuxOpt},
ClientPreference: []libp2p.Option{yamuxOpt, anotherYamuxOpt},
Expected: "/yamux",
},
{
Name: "client only supports one muxer",
ServerPreference: []libp2p.Option{yamuxOpt, mplexOpt},
ServerPreference: []libp2p.Option{yamuxOpt, anotherYamuxOpt},
ClientPreference: []libp2p.Option{yamuxOpt},
Expected: "/yamux",
},
{
Name: "server only supports one muxer",
ServerPreference: []libp2p.Option{yamuxOpt},
ClientPreference: []libp2p.Option{mplexOpt, yamuxOpt},
ClientPreference: []libp2p.Option{anotherYamuxOpt, yamuxOpt},
Expected: "/yamux",
},
{
Name: "client preference preferred",
ServerPreference: []libp2p.Option{yamuxOpt, mplexOpt},
ClientPreference: []libp2p.Option{mplexOpt, yamuxOpt},
Expected: "/mplex",
ServerPreference: []libp2p.Option{yamuxOpt, anotherYamuxOpt},
ClientPreference: []libp2p.Option{anotherYamuxOpt, yamuxOpt},
Expected: "/another-yamux",
},
{
Name: "no preference overlap",
ServerPreference: []libp2p.Option{yamuxOpt},
ClientPreference: []libp2p.Option{mplexOpt},
ClientPreference: []libp2p.Option{anotherYamuxOpt},
Error: "failed to negotiate stream multiplexer: protocols not supported",
},
}
Expand Down
5 changes: 1 addition & 4 deletions test-plans/cmd/ping/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import (
"github.com/go-redis/redis/v8"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/p2p/muxer/mplex"
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
noise "github.com/libp2p/go-libp2p/p2p/security/noise"
"github.com/libp2p/go-libp2p/p2p/security/noise"
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
Expand Down Expand Up @@ -139,8 +138,6 @@ func main() {
switch muxer {
case "yamux":
options = append(options, libp2p.Muxer("/yamux/1.0.0", yamux.DefaultTransport))
case "mplex":
options = append(options, libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport))
default:
log.Fatalf("Unsupported muxer: %s", muxer)
}
Expand Down
1 change: 0 additions & 1 deletion test-plans/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ require (
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions test-plans/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnF
github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLEQHwOCZ7s8s=
github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w=
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY=
github.com/libp2p/go-mplex v0.7.0/go.mod h1:rW8ThnRcYWft/Jb2jeORBmPd6xuG3dGxWN/W168L9EU=
github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0=
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk=
Expand Down
1 change: 0 additions & 1 deletion test-plans/ping-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"noise"
],
"muxers": [
"mplex",
"yamux"
]
}