From 2dc1f691f1bb98cadd7e7867cb924ce69f126751 Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Fri, 22 May 2020 03:48:59 +0200 Subject: [PATCH 1/7] quic: remove experimental status and add it to the default config --- Dockerfile | 2 ++ README.md | 8 ++--- core/core_test.go | 4 +-- core/node/builder.go | 2 +- core/node/groups.go | 1 - core/node/libp2p/transport.go | 2 +- docs/config.md | 4 ++- docs/examples/go-ipfs-as-a-library/main.go | 5 ++++ .../library-experimental-features/README.md | 2 -- docs/experimental-features.md | 30 ------------------- docs/file-transfer.md | 5 ++++ test/sharness/t0125-twonode.sh | 6 ---- test/sharness/t0142-testfilter.sh | 5 ---- test/sharness/t0190-quic-ping.sh | 5 ---- 14 files changed, 23 insertions(+), 58 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a3fcad28..5cd7d54b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,8 @@ COPY --from=0 /usr/lib/*-linux-gnu*/libcrypto.so* /usr/lib/ # Swarm TCP; should be exposed to the public EXPOSE 4001 +# Swarm UDP; should be exposed to the public +EXPOSE 4001/udp # Daemon API; must not be exposed publicly but to client services under you control EXPOSE 5001 # Web Gateway; can be exposed publicly with a proxy, e.g. as https://ipfs.example.org diff --git a/README.md b/README.md index 8aae778ac..00548dbb0 100644 --- a/README.md +++ b/README.md @@ -344,7 +344,7 @@ IPFS files that will persist when you restart the container. Start a container running ipfs and expose ports 4001, 5001 and 8080: - docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest + docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest Watch the ipfs log: @@ -376,16 +376,16 @@ Stop the running container: When starting a container running ipfs for the first time with an empty data directory, it will call `ipfs init` to initialize configuration files and generate a new keypair. At this time, you can choose which profile to apply using the `IPFS_PROFILE` environment variable: - docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest + docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest It is possible to initialize the container with a swarm key file (`/data/ipfs/swarm.key`) using the variables `IPFS_SWARM_KEY` and `IPFS_SWARM_KEY_FILE`. The `IPFS_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, whilst `IPFS_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `IPFS_SWARM_KEY_FILE` **overwrites** the key generated by `IPFS_SWARM_KEY`. - docker run -d --name ipfs_host -e IPFS_SWARM_KEY= -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest + docker run -d --name ipfs_host -e IPFS_SWARM_KEY= -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest The swarm key initialization can also be done using docker secrets **(requires docker swarm or docker-compose)**: cat your_swarm.key | docker secret create swarm_key_secret - - docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest + docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest ### Troubleshooting diff --git a/core/core_test.go b/core/core_test.go index 3a5f7c236..051b812c1 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -20,7 +20,7 @@ func TestInitialization(t *testing.T) { { Identity: id, Addresses: config.Addresses{ - Swarm: []string{"/ip4/0.0.0.0/tcp/4001"}, + Swarm: []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"}, API: []string{"/ip4/127.0.0.1/tcp/8000"}, }, }, @@ -28,7 +28,7 @@ func TestInitialization(t *testing.T) { { Identity: id, Addresses: config.Addresses{ - Swarm: []string{"/ip4/0.0.0.0/tcp/4001"}, + Swarm: []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"}, API: []string{"/ip4/127.0.0.1/tcp/8000"}, }, }, diff --git a/core/node/builder.go b/core/node/builder.go index 2dd1986ca..22ab500e1 100644 --- a/core/node/builder.go +++ b/core/node/builder.go @@ -140,7 +140,7 @@ func defaultRepo(dstore repo.Datastore) (repo.Repo, error) { } c.Bootstrap = cfg.DefaultBootstrapAddresses - c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001"} + c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"} c.Identity.PeerID = pid.Pretty() c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb) diff --git a/core/node/groups.go b/core/node/groups.go index f94d97634..4a769c34f 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -130,7 +130,6 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option { maybeProvide(libp2p.BandwidthCounter, !cfg.Swarm.DisableBandwidthMetrics), maybeProvide(libp2p.NatPortMap, !cfg.Swarm.DisableNatPortMap), maybeProvide(libp2p.AutoRelay, cfg.Swarm.EnableAutoRelay), - maybeProvide(libp2p.QUIC, cfg.Experimental.QUIC), autonat, connmgr, ps, diff --git a/core/node/libp2p/transport.go b/core/node/libp2p/transport.go index 3994da5c5..59e3c4d79 100644 --- a/core/node/libp2p/transport.go +++ b/core/node/libp2p/transport.go @@ -8,7 +8,7 @@ import ( tls "github.com/libp2p/go-libp2p-tls" ) -var DefaultTransports = simpleOpt(libp2p.DefaultTransports) +var DefaultTransports = simpleOpt(libp2p.ChainOptions(libp2p.DefaultTransports, libp2p.Transport(libp2pquic.NewTransport))) var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport)) func Security(enabled bool) interface{} { diff --git a/docs/config.md b/docs/config.md index 2a64275bd..f2211954c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -200,7 +200,9 @@ Default: ```json [ "/ip4/0.0.0.0/tcp/4001", - "/ip6/::/tcp/4001" + "/ip6/::/tcp/4001", + "/ip6/0.0.0.0/udp/4001/quic", + "/ip6/::/udp/4001/quic" ] ``` diff --git a/docs/examples/go-ipfs-as-a-library/main.go b/docs/examples/go-ipfs-as-a-library/main.go index cc390eceb..f07398c30 100644 --- a/docs/examples/go-ipfs-as-a-library/main.go +++ b/docs/examples/go-ipfs-as-a-library/main.go @@ -300,12 +300,17 @@ func main() { // IPFS Cluster Pinning nodes "/ip4/138.201.67.219/tcp/4001/p2p/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA", + "/ip4/138.201.67.219/udp/4001/quic/p2p/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA", "/ip4/138.201.67.220/tcp/4001/p2p/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i", + "/ip4/138.201.67.220/udp/4001/quic/p2p/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i", "/ip4/138.201.68.74/tcp/4001/p2p/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR", + "/ip4/138.201.68.74/udp/4001/quic/p2p/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR", "/ip4/94.130.135.167/tcp/4001/p2p/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE", + "/ip4/94.130.135.167/udp/4001/quic/p2p/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE", // You can add more nodes here, for example, another IPFS node you might have running locally, mine was: // "/ip4/127.0.0.1/tcp/4010/p2p/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L", + // "/ip4/127.0.0.1/udp/4010/quic/p2p/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L", } go connectToPeers(ctx, ipfs, bootstrapNodes) diff --git a/docs/examples/library-experimental-features/README.md b/docs/examples/library-experimental-features/README.md index 6387f3618..a35170695 100644 --- a/docs/examples/library-experimental-features/README.md +++ b/docs/examples/library-experimental-features/README.md @@ -56,8 +56,6 @@ func createTempRepo(ctx context.Context) (string, error) { cfg.Experimental.Libp2pStreamMounting = true // https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#p2p-http-proxy cfg.Experimental.P2pHttpProxy = true - // https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#quic - cfg.Experimental.QUIC = true // https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#strategic-providing cfg.Experimental.StrategicProviding = true diff --git a/docs/experimental-features.md b/docs/experimental-features.md index d498653fc..820fdc6ca 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -22,7 +22,6 @@ the above issue. - [Plugins](#plugins) - [Directory Sharding / HAMT](#directory-sharding--hamt) - [IPNS PubSub](#ipns-pubsub) -- [QUIC](#quic) - [AutoRelay](#autorelay) - [Strategic Providing](#strategic-providing) - [Graphsync](#graphsync) @@ -463,35 +462,6 @@ run your daemon with the `--enable-namesys-pubsub` flag; enables pubsub. - [ ] Needs more people to use and report on how well it works - [ ] Pubsub enabled as a real feature -## QUIC - -### In Version - -0.4.18 - -### State - -Candidate, disabled by default but it will be enabled by default in 0.6.0. - -### How to enable - -Modify your ipfs config: - -``` -ipfs config --json Experimental.QUIC true -``` - -For listening on a QUIC address, add it to the swarm addresses, e.g. `/ip4/0.0.0.0/udp/4001/quic`. - - -### Road to being a real feature - -- [ ] The IETF QUIC specification needs to be finalized. -- [ ] Make sure QUIC connections work reliably -- [ ] Make sure QUIC connection offer equal or better performance than TCP connections on real-world networks -- [ ] Finalize libp2p-TLS handshake spec. - - ## AutoRelay ### In Version diff --git a/docs/file-transfer.md b/docs/file-transfer.md index 247993489..8f38ca765 100644 --- a/docs/file-transfer.md +++ b/docs/file-transfer.md @@ -46,7 +46,9 @@ addresses (like the example below), then your nodes are online. "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb6znj3LQZKP1+X81exf+vbnqNCMtHjZ5RKTCm7Fytnfe+AI1fhs9YbZdkgFkM1HLxmIOLQj2bMXPIGxUM+EnewN8tWurx4B3+lR/LWNwNYcCFL+jF2ltc6SE6BC8kMLEZd4zidOLPZ8lIRpd0x3qmsjhGefuRwrKeKlR4tQ3C76ziOms47uLdiVVkl5LyJ5+mn4rXOjNKt/oy2O4m1St7X7/yNt8qQgYsPfe/hCOywxCEIHEkqmil+vn7bu4RpAtsUzCcBDoLUIWuU3i6qfytD05hP8Clo+at+l//ctjMxylf3IQ5qyP+yfvazk+WHcsB0tWueEmiU5P2nfUUIR3AgMBAAE=", "Addresses": [ "/ip4/127.0.0.1/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", + "/ip4/127.0.0.1/udp/4001/quic/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", "/ip4/192.168.2.131/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", + "/ip4/192.168.2.131/udp/4001/quic/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", ], "AgentVersion": "go-ipfs/0.4.11-dev/", "ProtocolVersion": "ipfs/0.1.0" @@ -90,8 +92,11 @@ Example output of addresses might look something like this: ``` /ip4/127.0.0.1/tcp/4001 +/ip4/127.0.0.1/udp/4001/quic /ip4/192.168.2.133/tcp/4001 +/ip4/192.168.2.133/udp/4001/quic /ip4/88.157.217.196/tcp/63674 +/ip4/88.157.217.196/udp/63674/quic ``` In this case, we can see a localhost (127.0.0.1) address, a LAN address (the diff --git a/test/sharness/t0125-twonode.sh b/test/sharness/t0125-twonode.sh index c70213ac7..424b610ff 100755 --- a/test/sharness/t0125-twonode.sh +++ b/test/sharness/t0125-twonode.sh @@ -89,12 +89,6 @@ test_expect_success "set up tcp testbed" ' iptb testbed create -type localipfs -count 2 -force -init ' -# Enable quic but don't use it yet. -test_expect_success "enable QUIC experiment" ' - ipfsi 0 config --json Experimental.QUIC true && - ipfsi 1 config --json Experimental.QUIC true -' - # test multiplex muxer echo "Running advanced tests with mplex" export LIBP2P_MUX_PREFS="/mplex/6.7.0" diff --git a/test/sharness/t0142-testfilter.sh b/test/sharness/t0142-testfilter.sh index 0b46e2c95..971aa6839 100755 --- a/test/sharness/t0142-testfilter.sh +++ b/test/sharness/t0142-testfilter.sh @@ -21,11 +21,6 @@ test_expect_success 'filter 127.0.0.0/24 on node 1' ' ' for i in $(seq 0 $(( NUM_NODES - 1 ))); do - test_expect_success 'enable quic for node $i' ' - echo "$i" - ipfsi $i config --json Experimental.QUIC true - ' - test_expect_success "change IP for node $i" ' ipfsi $i config --json "Addresses.Swarm" \ "[\"/ip4/127.0.$i.1/tcp/0\",\"/ip4/127.0.$i.1/udp/0/quic\",\"/ip4/127.0.$i.1/tcp/0/ws\"]" diff --git a/test/sharness/t0190-quic-ping.sh b/test/sharness/t0190-quic-ping.sh index c16b23471..ee0bf16ac 100755 --- a/test/sharness/t0190-quic-ping.sh +++ b/test/sharness/t0190-quic-ping.sh @@ -11,11 +11,6 @@ test_expect_success 'init iptb' ' iptb testbed create -type localipfs -count 2 -init ' -test_expect_success "enable QUIC experiment" ' - ipfsi 0 config --json Experimental.QUIC true && - ipfsi 1 config --json Experimental.QUIC true -' - addr1='"[\"/ip4/127.0.0.1/udp/0/quic/\"]"' addr2='"[\"/ip4/127.0.0.1/udp/0/quic/\"]"' test_expect_success "add QUIC swarm addresses" ' From ed437fa64e46bdaac74117c7507003bf05374ef6 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 13:47:57 -0700 Subject: [PATCH 2/7] chore: update go-ipfs-config --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4237bf0ce..9184ecc8e 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.2.9 - github.com/ipfs/go-ipfs-config v0.5.3 + github.com/ipfs/go-ipfs-config v0.6.0 github.com/ipfs/go-ipfs-ds-help v0.1.1 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 diff --git a/go.sum b/go.sum index 6f4dfcfcb..531243cea 100644 --- a/go.sum +++ b/go.sum @@ -303,6 +303,8 @@ github.com/ipfs/go-ipfs-cmds v0.2.9 h1:zQTENe9UJrtCb2bOtRoDGjtuo3rQjmuPdPnVlqoBV github.com/ipfs/go-ipfs-cmds v0.2.9/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= github.com/ipfs/go-ipfs-config v0.5.3 h1:3GpI/xR9FoJNTjU6YvCMRbYyEi0dBVY5UtlUTcNRlSA= github.com/ipfs/go-ipfs-config v0.5.3/go.mod h1:nSLCFtlaL+2rbl3F+9D4gQZQbT1LjRKx7TJg/IHz6oM= +github.com/ipfs/go-ipfs-config v0.6.0 h1:Ez/3/viV9z23Dlc9XUZYtFnQ71gkWzFv5drjcvH9OiI= +github.com/ipfs/go-ipfs-config v0.6.0/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= From 03c1f769d711f90d6d2ea656a7a9701512a86755 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 13:48:26 -0700 Subject: [PATCH 3/7] fix: remove strict signature verification option Signature verification is now always strict. --- core/node/groups.go | 1 - 1 file changed, 1 deletion(-) diff --git a/core/node/groups.go b/core/node/groups.go index 4a769c34f..b8f921124 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -75,7 +75,6 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option { pubsubOptions = append( pubsubOptions, pubsub.WithMessageSigning(!cfg.Pubsub.DisableSigning), - pubsub.WithStrictSignatureVerification(cfg.Pubsub.StrictSignatureVerification), ) switch cfg.Pubsub.Router { From 4714c0ceccd9808b89a4e62783997962a7af9f68 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 13:48:58 -0700 Subject: [PATCH 4/7] feat: enable QUIC by default But only if private networks are disabled. --- core/node/groups.go | 2 +- core/node/libp2p/transport.go | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/node/groups.go b/core/node/groups.go index b8f921124..9078f52b6 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -26,7 +26,7 @@ var BaseLibP2P = fx.Options( fx.Provide(libp2p.UserAgent), fx.Provide(libp2p.PNet), fx.Provide(libp2p.ConnectionManager), - fx.Provide(libp2p.DefaultTransports), + fx.Provide(libp2p.Transports), fx.Provide(libp2p.Host), diff --git a/core/node/libp2p/transport.go b/core/node/libp2p/transport.go index 59e3c4d79..7fca3b71d 100644 --- a/core/node/libp2p/transport.go +++ b/core/node/libp2p/transport.go @@ -6,10 +6,20 @@ import ( libp2pquic "github.com/libp2p/go-libp2p-quic-transport" secio "github.com/libp2p/go-libp2p-secio" tls "github.com/libp2p/go-libp2p-tls" + + "go.uber.org/fx" ) -var DefaultTransports = simpleOpt(libp2p.ChainOptions(libp2p.DefaultTransports, libp2p.Transport(libp2pquic.NewTransport))) -var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport)) +func Transports(pnet struct { + fx.In + Fprint PNetFingerprint `optional:"true"` +}) (opts Libp2pOpts) { + opts.Opts = append(opts.Opts, libp2p.DefaultTransports) + if pnet.Fprint == nil { + opts.Opts = append(opts.Opts, libp2p.Transport(libp2pquic.NewTransport)) + } + return opts +} func Security(enabled bool) interface{} { if !enabled { From a4985c29e8f734e9755917c731823cde38514b02 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 16:21:15 -0700 Subject: [PATCH 5/7] test(sharness): fix pubsub tests --- test/sharness/t0180-pubsub.sh | 38 +++++------------------------------ 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/test/sharness/t0180-pubsub.sh b/test/sharness/t0180-pubsub.sh index abffd2d77..349e98d54 100755 --- a/test/sharness/t0180-pubsub.sh +++ b/test/sharness/t0180-pubsub.sh @@ -106,25 +106,14 @@ test_expect_success 'stop iptb' ' # Test with some nodes not signing messages. -test_expect_success 'disable signing on node 1' ' - ipfsi 1 config --json Pubsub.DisableSigning true -' - -startup_cluster $NUM_NODES --enable-pubsub-experiment -run_pubsub_tests -test_expect_success 'stop iptb' ' - iptb stop -' - -# Test strict message verification. - -test_expect_success 'enable strict signature verification on node 4' ' - ipfsi 4 config --json Pubsub.StrictSignatureVerification true +test_expect_success 'disable signing on nodes 1-3' ' + iptb run [0-3] -- ipfs config --json Pubsub.DisableSigning true ' startup_cluster $NUM_NODES --enable-pubsub-experiment test_expect_success 'set node 4 to listen on testTopic' ' + rm -f node4_actual && ipfsi 4 pubsub sub --enc=ndpayload testTopic > node4_actual & ' @@ -134,25 +123,8 @@ test_expect_success 'stop iptb' ' iptb stop ' -test_expect_success 'node 4 only got the signed message' ' - echo "testOK2" > node4_expected && - test_cmp node4_actual node4_expected -' - -# Test all nodes signing with strict verification - -test_expect_success 're-enable signing on node 1' ' - ipfsi 1 config --json Pubsub.DisableSigning false -' - -test_expect_success 'enable strict signature verification on all nodes' ' - iptb run -- ipfs config --json Pubsub.StrictSignatureVerification true -' - -startup_cluster $NUM_NODES --enable-pubsub-experiment -run_pubsub_tests -test_expect_success 'stop iptb' ' - iptb stop +test_expect_success 'node 4 got no unsigned messages' ' + test_must_be_empty node4_actual ' test_done From 48302a1a9d1829864eed8637a2843033aa8b105b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 16:40:43 -0700 Subject: [PATCH 6/7] chore: update go-ipfs-config Fixes init output. --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 9184ecc8e..eca311821 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.2.9 - github.com/ipfs/go-ipfs-config v0.6.0 + github.com/ipfs/go-ipfs-config v0.6.1 github.com/ipfs/go-ipfs-ds-help v0.1.1 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 diff --git a/go.sum b/go.sum index 531243cea..41238c057 100644 --- a/go.sum +++ b/go.sum @@ -301,10 +301,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7Na github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-cmds v0.2.9 h1:zQTENe9UJrtCb2bOtRoDGjtuo3rQjmuPdPnVlqoBV/M= github.com/ipfs/go-ipfs-cmds v0.2.9/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.5.3 h1:3GpI/xR9FoJNTjU6YvCMRbYyEi0dBVY5UtlUTcNRlSA= -github.com/ipfs/go-ipfs-config v0.5.3/go.mod h1:nSLCFtlaL+2rbl3F+9D4gQZQbT1LjRKx7TJg/IHz6oM= -github.com/ipfs/go-ipfs-config v0.6.0 h1:Ez/3/viV9z23Dlc9XUZYtFnQ71gkWzFv5drjcvH9OiI= -github.com/ipfs/go-ipfs-config v0.6.0/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= +github.com/ipfs/go-ipfs-config v0.6.1 h1:d1f0fEEpUQ9R+6c0VZMNy2P+wCl4K4DO4VHJBvgWwFw= +github.com/ipfs/go-ipfs-config v0.6.1/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= From 9f40af0b13f5434cbaaf85954cf1fe7a9570ddf5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 May 2020 16:57:58 -0700 Subject: [PATCH 7/7] test(sharness): fix bootstrap test for quic bootstrap addrs --- test/sharness/t0120-bootstrap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/sharness/t0120-bootstrap.sh b/test/sharness/t0120-bootstrap.sh index 538c5bde0..892c538f1 100755 --- a/test/sharness/t0120-bootstrap.sh +++ b/test/sharness/t0120-bootstrap.sh @@ -10,6 +10,7 @@ BP2="/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19 BP3="/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb" BP4="/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" BP5="/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" +BP6="/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" test_description="Test ipfs repo operations" @@ -91,10 +92,11 @@ test_bootstrap_cmd() { echo "added $BP3" >>add2_expected && echo "added $BP4" >>add2_expected && echo "added $BP5" >>add2_expected && + echo "added $BP6" >>add2_expected && test_cmp add2_expected add2_actual ' - test_bootstrap_list_cmd $BP1 $BP2 $BP3 $BP4 $BP5 + test_bootstrap_list_cmd $BP1 $BP2 $BP3 $BP4 $BP5 $BP6 test_expect_success "'ipfs bootstrap rm --all' succeeds" ' ipfs bootstrap rm --all >rm2_actual @@ -106,6 +108,7 @@ test_bootstrap_cmd() { echo "removed $BP3" >>rm2_expected && echo "removed $BP4" >>rm2_expected && echo "removed $BP5" >>rm2_expected && + echo "removed $BP6" >>rm2_expected && test_cmp rm2_expected rm2_actual '