From 25adea6d568aa59ac67c818436263ca96fc8eba7 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 10 Apr 2019 23:09:17 +0300 Subject: [PATCH 1/3] gomod: update go-libp2p-net, go-libp2p-swarm, and go-libp2p-circuit --- go.mod | 6 +++--- go.sum | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 67df3c17ef..cd4fd9ce55 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/libp2p/go-conn-security-multistream v0.0.1 github.com/libp2p/go-libp2p-autonat v0.0.4 github.com/libp2p/go-libp2p-blankhost v0.0.1 - github.com/libp2p/go-libp2p-circuit v0.0.2 + github.com/libp2p/go-libp2p-circuit v0.0.3 github.com/libp2p/go-libp2p-crypto v0.0.1 github.com/libp2p/go-libp2p-discovery v0.0.1 github.com/libp2p/go-libp2p-host v0.0.1 @@ -20,14 +20,14 @@ require ( github.com/libp2p/go-libp2p-loggables v0.0.1 github.com/libp2p/go-libp2p-metrics v0.0.1 github.com/libp2p/go-libp2p-nat v0.0.2 - github.com/libp2p/go-libp2p-net v0.0.1 + github.com/libp2p/go-libp2p-net v0.0.2 github.com/libp2p/go-libp2p-netutil v0.0.1 github.com/libp2p/go-libp2p-peer v0.0.1 github.com/libp2p/go-libp2p-peerstore v0.0.1 github.com/libp2p/go-libp2p-protocol v0.0.1 github.com/libp2p/go-libp2p-routing v0.0.1 github.com/libp2p/go-libp2p-secio v0.0.1 - github.com/libp2p/go-libp2p-swarm v0.0.1 + github.com/libp2p/go-libp2p-swarm v0.0.2 github.com/libp2p/go-libp2p-transport v0.0.4 github.com/libp2p/go-libp2p-transport-upgrader v0.0.1 github.com/libp2p/go-maddr-filter v0.0.1 diff --git a/go.sum b/go.sum index afabbc0791..7a6ae33f09 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ github.com/gxed/hashland/keccakpg v0.0.1 h1:wrk3uMNaMxbXiHibbPO4S0ymqJMm41WiudyF github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1 h1:SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJu4ZbSc= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -88,8 +90,8 @@ github.com/libp2p/go-libp2p-autonat v0.0.4 h1:cZzdB9KW1ZkHnSjLCB6aFNw47XS4r+SecC github.com/libp2p/go-libp2p-autonat v0.0.4/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-blankhost v0.0.1 h1:/mZuuiwntNR8RywnCFlGHLKrKLYne+qciBpQXWqp5fk= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= -github.com/libp2p/go-libp2p-circuit v0.0.2 h1:wwbYslVw1aW2DAAuJxXRS5gB2clz1s23gv9NOb8iwsE= -github.com/libp2p/go-libp2p-circuit v0.0.2/go.mod h1:zV136p4UQ76qH/Wj+X/Hivcg6sf6Yb1G7YL8o+GGj38= +github.com/libp2p/go-libp2p-circuit v0.0.3 h1:FKhhuMOegdNIEbXkZsClEiqXJr+NmR+REmQRiMgtSyA= +github.com/libp2p/go-libp2p-circuit v0.0.3/go.mod h1:p1cHJnB9xnX5/1vZLkXgKwmNEOQQuF/Hp+SkATXnXYk= github.com/libp2p/go-libp2p-crypto v0.0.1 h1:JNQd8CmoGTohO/akqrH16ewsqZpci2CbgYH/LmYl8gw= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-discovery v0.0.1 h1:VkjCKmJQMwpDUwtA8Qc1z3TQAHJgQ5nGQ6cdN0wQXOw= @@ -108,6 +110,8 @@ github.com/libp2p/go-libp2p-nat v0.0.2 h1:sKI5hiCsGFhuEKdXMsF9mywQu2qhfoIGX6a+VG github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-net v0.0.1 h1:xJ4Vh4yKF/XKb8fd1Ev0ebAGzVjMxXzrxG2kjtU+F5Q= github.com/libp2p/go-libp2p-net v0.0.1/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= +github.com/libp2p/go-libp2p-net v0.0.2 h1:qP06u4TYXfl7uW/hzqPhlVVTSA2nw1B/bHBJaUnbh6M= +github.com/libp2p/go-libp2p-net v0.0.2/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= github.com/libp2p/go-libp2p-netutil v0.0.1 h1:LgD6+skofkOx8z6odD9+MZHKjupv3ng1u6KRhaADTnA= github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFxecf9Gt03cKxm2f/Q= github.com/libp2p/go-libp2p-peer v0.0.1 h1:0qwAOljzYewINrU+Kndoc+1jAL7vzY/oY2Go4DCGfyY= @@ -122,6 +126,8 @@ github.com/libp2p/go-libp2p-secio v0.0.1 h1:CqE/RdsizOwItdgLe632iyft/w0tshDLmZGA github.com/libp2p/go-libp2p-secio v0.0.1/go.mod h1:IdG6iQybdcYmbTzxp4J5dwtUEDTOvZrT0opIDVNPrJs= github.com/libp2p/go-libp2p-swarm v0.0.1 h1:Vne+hjaDwXqzgNwQ2vb2YKbnbOTyXjtS47stT66Apc4= github.com/libp2p/go-libp2p-swarm v0.0.1/go.mod h1:mh+KZxkbd3lQnveQ3j2q60BM1Cw2mX36XXQqwfPOShs= +github.com/libp2p/go-libp2p-swarm v0.0.2 h1:cpHHXTeU2IgUu8LPemF7vaLPGtVC6VxMoll2EwqlC+E= +github.com/libp2p/go-libp2p-swarm v0.0.2/go.mod h1:n0cAAcKyndIrJWctQwjqXlAdIPBZzfdpBjx1SSvz30g= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= github.com/libp2p/go-libp2p-transport v0.0.4 h1:/CPHQMN75/IQwkhBxxIo6p6PtL3rwFZtlzBROT3e8mw= github.com/libp2p/go-libp2p-transport v0.0.4/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= From 1e48e15da7fb91a058fadc0298239a2eae7cdfd0 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 10 Apr 2019 23:12:14 +0300 Subject: [PATCH 2/3] respect NoDial option in routed host --- p2p/host/routed/routed.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/p2p/host/routed/routed.go b/p2p/host/routed/routed.go index d921536895..e5b2e40d14 100644 --- a/p2p/host/routed/routed.go +++ b/p2p/host/routed/routed.go @@ -169,9 +169,12 @@ func (rh *RoutedHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol // Ensure we have a connection, with peer addresses resolved by the routing system (#207) // It is not sufficient to let the underlying host connect, it will most likely not have // any addresses for the peer without any prior connections. - err := rh.Connect(ctx, pstore.PeerInfo{ID: p}) - if err != nil { - return nil, err + // If the caller wants to prevent the host from dialing, it should use the NoDial option. + if nodial, _ := inet.GetNoDial(ctx); !nodial { + err := rh.Connect(ctx, pstore.PeerInfo{ID: p}) + if err != nil { + return nil, err + } } return rh.host.NewStream(ctx, p, pids...) From e4061bbb878caa3cf928e1b608b2bdd003d62196 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 10 Apr 2019 23:12:43 +0300 Subject: [PATCH 3/3] travis: remove gx build --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4cfe98c242..5163d693fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ env: global: - GOTFLAGS="-race" matrix: - - BUILD_DEPTYPE=gx - BUILD_DEPTYPE=gomod @@ -24,7 +23,6 @@ script: cache: directories: - - $GOPATH/src/gx - $GOPATH/pkg/mod - $HOME/.cache/go-build