Revert "libp2p: add QUIC and WebTransport to default listen addresses"

This reverts commit 0a064c1b3d.
This commit is contained in:
Shrenuj Bansal 2023-05-10 15:58:30 -04:00
parent 6fd93ed170
commit da2e155b72
4 changed files with 6 additions and 16 deletions

View File

@ -38,7 +38,7 @@
#
# type: []string
# env var: LOTUS_LIBP2P_LISTENADDRESSES
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0", "/ip4/0.0.0.0/udp/0/quic-v1", "/ip6/::/udp/0/quic-v1", "/ip4/0.0.0.0/udp/0/quic-v1/webtransport", "/ip6/::/udp/0/quic-v1/webtransport"]
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0"]
# Addresses to explicitally announce to other peers. If not specified,
# all interface addresses are announced

View File

@ -38,7 +38,7 @@
#
# type: []string
# env var: LOTUS_LIBP2P_LISTENADDRESSES
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0", "/ip4/0.0.0.0/udp/0/quic-v1", "/ip6/::/udp/0/quic-v1", "/ip4/0.0.0.0/udp/0/quic-v1/webtransport", "/ip6/::/udp/0/quic-v1/webtransport"]
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0"]
# Addresses to explicitally announce to other peers. If not specified,
# all interface addresses are announced

View File

@ -220,17 +220,14 @@ func TestNetBlockIPAddr(t *testing.T) {
firstAddrInfo, _ := firstNode.NetAddrsListen(ctx)
secondAddrInfo, _ := secondNode.NetAddrsListen(ctx)
secondNodeIPsMap := map[string]struct{}{} // so we can deduplicate
var secondNodeIPs []string
for _, addr := range secondAddrInfo.Addrs {
ip, err := manet.ToIP(addr)
if err != nil {
continue
}
secondNodeIPsMap[ip.String()] = struct{}{}
}
var secondNodeIPs []string
for s := range secondNodeIPsMap {
secondNodeIPs = append(secondNodeIPs, s)
secondNodeIPs = append(secondNodeIPs, ip.String())
}
// Sanity check that we're not already connected somehow
@ -246,8 +243,6 @@ func TestNetBlockIPAddr(t *testing.T) {
list, err := firstNode.NetBlockList(ctx)
require.NoError(t, err)
fmt.Println(list.IPAddrs)
fmt.Println(secondNodeIPs)
require.Equal(t, len(list.IPAddrs), len(secondNodeIPs), "expected %d blocked IPs", len(secondNodeIPs))
for _, blockedIP := range list.IPAddrs {
found := false
@ -261,8 +256,7 @@ func TestNetBlockIPAddr(t *testing.T) {
require.True(t, found, "blocked IP %s is not one of secondNodeIPs", blockedIP)
}
// a QUIC connection might still succeed when gated, but will be killed right after the handshake
_ = secondNode.NetConnect(ctx, firstAddrInfo)
require.Error(t, secondNode.NetConnect(ctx, firstAddrInfo), "shouldn't be able to connect to second node")
connectedness, err = secondNode.NetConnectedness(ctx, firstAddrInfo.ID)
require.NoError(t, err, "failed to determine connectedness")
require.NotEqual(t, connectedness, network.Connected)

View File

@ -57,10 +57,6 @@ func defCommon() Common {
ListenAddresses: []string{
"/ip4/0.0.0.0/tcp/0",
"/ip6/::/tcp/0",
"/ip4/0.0.0.0/udp/0/quic-v1",
"/ip6/::/udp/0/quic-v1",
"/ip4/0.0.0.0/udp/0/quic-v1/webtransport",
"/ip6/::/udp/0/quic-v1/webtransport",
},
AnnounceAddresses: []string{},
NoAnnounceAddresses: []string{},