From 1b36fd8697728e93b500035001f05a515202e182 Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Tue, 2 Jun 2020 19:07:02 +0530 Subject: [PATCH 1/5] first draft --- go.mod | 6 +- go.sum | 149 +++++++++++++++++++++++- p2p/protocol/identify/id.go | 79 +++++++++---- p2p/protocol/identify/id_test.go | 115 ++++++++++++++++++ p2p/protocol/identify/pb/identify.pb.go | 81 ++++++++++--- p2p/protocol/identify/pb/identify.proto | 9 +- p2p/protocol/identify/peer_loop.go | 30 ++--- 7 files changed, 401 insertions(+), 68 deletions(-) diff --git a/go.mod b/go.mod index 01b6940f89..02284b660d 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,6 @@ require ( github.com/libp2p/go-libp2p-autonat v0.2.3 github.com/libp2p/go-libp2p-blankhost v0.1.6 github.com/libp2p/go-libp2p-circuit v0.2.2 - github.com/libp2p/go-libp2p-connmgr v0.2.4 // indirect github.com/libp2p/go-libp2p-core v0.5.7 github.com/libp2p/go-libp2p-discovery v0.4.0 github.com/libp2p/go-libp2p-loggables v0.1.0 @@ -26,7 +25,7 @@ require ( github.com/libp2p/go-libp2p-netutil v0.1.0 github.com/libp2p/go-libp2p-peerstore v0.2.4 github.com/libp2p/go-libp2p-secio v0.2.2 - github.com/libp2p/go-libp2p-swarm v0.2.4 + github.com/libp2p/go-libp2p-swarm v0.2.6 github.com/libp2p/go-libp2p-testing v0.1.1 github.com/libp2p/go-libp2p-tls v0.1.3 github.com/libp2p/go-libp2p-transport-upgrader v0.3.0 @@ -40,12 +39,9 @@ require ( github.com/multiformats/go-multiaddr v0.2.2 github.com/multiformats/go-multiaddr-dns v0.2.0 github.com/multiformats/go-multiaddr-net v0.1.5 - github.com/multiformats/go-multibase v0.0.2 // indirect github.com/multiformats/go-multistream v0.1.1 github.com/stretchr/testify v1.5.1 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 - go.uber.org/zap v1.15.0 // indirect - golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 // indirect golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476 // indirect golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect ) diff --git a/go.sum b/go.sum index 02945554d0..cf5f58f1c4 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,12 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= +dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= +dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= +dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= +dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -6,9 +14,13 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75 h1:3ILjVyslFbc4jl1w5TWuvvslFD/nDfR2H8tVaMVLrEY= +github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/benbjohnson/clock v1.0.2 h1:Z0CN0Yb4ig9sGPXkvAQcGJfnrrMQ5QYLCMPRi9iD7YE= -github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.0.1/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= @@ -22,13 +34,17 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -46,9 +62,16 @@ github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70d github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= @@ -56,23 +79,37 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.4.0 h1:Rd1kQnQu0Hq3qvJppYSG0HtP+f5LPPUiDswTLiEegLg= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -131,9 +168,12 @@ github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsj github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -146,6 +186,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/libp2p/go-addr-util v0.0.1 h1:TpTQm9cXVRVSKsYbgQ7GKc3KbbHVTnbostgGaDEP+88= @@ -184,8 +225,7 @@ github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3 github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= github.com/libp2p/go-libp2p-circuit v0.2.2 h1:87RLabJ9lrhoiSDDZyCJ80ZlI5TLJMwfyoGAaWXzWqA= github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= -github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= +github.com/libp2p/go-libp2p-connmgr v0.2.3/go.mod h1:Gqjg29zI8CwXX21zRxy6gOg8VYu3zVerJRt2KyktzH4= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= @@ -201,6 +241,7 @@ github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5 h1:/yiFUZDoBWqvpWeHHJ1iA8SOs5obT1/+UdNfckwD57M= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= +github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.5.7 h1:QK3xRwFxqd0Xd9bSZL+8yZ8ncZZbl6Zngd/+Y+A6sgQ= github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= @@ -232,6 +273,9 @@ github.com/libp2p/go-libp2p-peerstore v0.2.4 h1:jU9S4jYN30kdzTpDAR7SlHUD+meDUjTO github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= +github.com/libp2p/go-libp2p-pubsub v0.3.1/go.mod h1:TxPOBuo1FPdsTjFnv+FGZbNbWYsp74Culx+4ViQpato= +github.com/libp2p/go-libp2p-quic-transport v0.3.7 h1:F9hxonkJvMipNim8swrvRk2uL9s8pqzHz0M6eMf8L58= +github.com/libp2p/go-libp2p-quic-transport v0.3.7/go.mod h1:Kr4aDtnfHHNeENn5J+sZIVc+t8HpQn9W6BOxhVGHbgI= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= @@ -242,6 +286,8 @@ github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaT github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= github.com/libp2p/go-libp2p-swarm v0.2.4 h1:94XL76/tFeTdJNcIGugi+1uZo5O/a7y4i21PirwbgZI= github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= +github.com/libp2p/go-libp2p-swarm v0.2.6 h1:UhMXIa+yCOALQyceENEIStMlbTCzOM6aWo6vw8QW17Q= +github.com/libp2p/go-libp2p-swarm v0.2.6/go.mod h1:F9hrkZjO7dDbcEiYii/fAB1QdpLuU6h1pa4P5VNsEgc= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -309,13 +355,22 @@ github.com/libp2p/go-yamux v1.3.5 h1:ibuz4naPAully0pN6J/kmUARiqLpnDQIzI/8GCOrljg github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.6 h1:O5qcBXRcfqecvQ/My9NqDNHB3/5t58yuJYqthcKhhgE= github.com/libp2p/go-yamux v1.3.6/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= +github.com/lucas-clemente/quic-go v0.15.7 h1:Pu7To5/G9JoP1mwlrcIvfV8ByPBlCzif3MCl8+1W83I= +github.com/lucas-clemente/quic-go v0.15.7/go.mod h1:Myi1OyS0FOjL3not4BxT7KN29bRkcMUV5JVVFLKtDp8= +github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= +github.com/marten-seemann/qtls v0.9.1 h1:O0YKQxNVPaiFgMng0suWEOY2Sb4LT2sRn9Qimq3Z1IQ= +github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28 h1:gQhy5bsJa8zTlVI8lywCTZp1lguor+xevFoYlzeCTQY= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= @@ -329,6 +384,8 @@ github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKU github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -378,29 +435,63 @@ github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= +github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= +github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= +github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= +github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= +github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= +github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= +github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= +github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= +github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= +github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= +github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= @@ -422,7 +513,10 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= +github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= @@ -432,8 +526,10 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= +github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -454,12 +550,16 @@ go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -467,9 +567,11 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -481,9 +583,14 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= @@ -491,19 +598,26 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476 h1:E7ct1C6/33eOdrGZKMoyntcEvs2dwZnDe30crG5vpYU= golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -514,18 +628,26 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -535,12 +657,23 @@ golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapK golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= +google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -550,6 +683,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -558,6 +692,13 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 01bc818b4d..a43643cce0 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -20,6 +20,7 @@ import ( pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" ggio "github.com/gogo/protobuf/io" + "github.com/gogo/protobuf/proto" logging "github.com/ipfs/go-log" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr-net" @@ -43,6 +44,9 @@ const LibP2PVersion = "ipfs/0.1.0" // Deprecated: Set this with the UserAgent option. var ClientVersion = "github.com/libp2p/go-libp2p" +var legacyIDSize = 2 * 1024 // 2k Bytes +var signedIDSize = 8 * 1024 // 8K + func init() { bi, ok := debug.ReadBuildInfo() if !ok { @@ -395,18 +399,14 @@ func (ids *IDService) sendIdentifyResp(s network.Stream) { } ph.snapshotMu.RLock() - mes := &pb.Identify{} - ids.populateMessage(mes, c, ph.snapshot) - w := ggio.NewDelimitedWriter(s) - w.WriteMsg(mes) - + ids.writeChunkedIdentifyMsg(c, ph.snapshot, s) log.Debugf("%s sent message to %s %s", ID, c.RemotePeer(), c.RemoteMultiaddr()) } func (ids *IDService) handleIdentifyResponse(s network.Stream) { c := s.Conn() - r := ggio.NewDelimitedReader(s, 2048) + r := ggio.NewDelimitedReader(s, legacyIDSize) mes := pb.Identify{} if err := r.ReadMsg(&mes); err != nil { log.Warning("error reading identify message: ", err) @@ -414,9 +414,20 @@ func (ids *IDService) handleIdentifyResponse(s network.Stream) { return } + if mes.SignedRecordInNextMessage { + m := &pb.Identify{} + if err := ggio.NewDelimitedReader(s, signedIDSize).ReadMsg(m); err != nil { + log.Warning("error reading identify message: ", err) + s.Reset() + return + } + mes.SignedPeerRecord = m.SignedPeerRecord + } + defer func() { go helpers.FullClose(s) }() log.Debugf("%s received message from %s %s", s.Protocol(), c.RemotePeer(), c.RemoteMultiaddr()) + ids.consumeMessage(&mes, c) } @@ -432,11 +443,34 @@ func (ids *IDService) getSnapshot() *identifySnapshot { return snapshot } -func (ids *IDService) populateMessage( - mes *pb.Identify, +func (ids *IDService) writeChunkedIdentifyMsg(c network.Conn, snapshot *identifySnapshot, s network.Stream) error { + mes := ids.getIdentifyMsgUnsigned(c, snapshot) + sr := ids.getSignedRecord(snapshot) + mes.SignedPeerRecord = sr + writer := ggio.NewDelimitedWriter(s) + + if sr == nil || proto.Size(mes) <= legacyIDSize { + return writer.WriteMsg(mes) + } else { + mes.SignedPeerRecord = nil + mes.SignedRecordInNextMessage = true + if err := writer.WriteMsg(mes); err != nil { + return err + } + + // then write just the signed record + m := &pb.Identify{SignedPeerRecord: sr} + err := writer.WriteMsg(m) + return err + } +} + +func (ids *IDService) getIdentifyMsgUnsigned( conn network.Conn, snapshot *identifySnapshot, -) { +) *pb.Identify { + mes := &pb.Identify{} + remoteAddr := conn.RemoteMultiaddr() localAddr := conn.LocalMultiaddr() @@ -458,17 +492,6 @@ func (ids *IDService) populateMessage( } mes.ListenAddrs = append(mes.ListenAddrs, addr.Bytes()) } - - if !ids.disableSignedPeerRecord && snapshot.record != nil { - recBytes, err := snapshot.record.Marshal() - if err != nil { - log.Errorf("error marshaling peer record: %v", err) - } else { - mes.SignedPeerRecord = recBytes - log.Debugf("%s sent peer record to %s", ids.Host.ID(), conn.RemotePeer()) - } - } - // set our public key ownKey := ids.Host.Peerstore().PubKey(ids.Host.ID()) @@ -495,6 +518,22 @@ func (ids *IDService) populateMessage( av := ids.UserAgent mes.ProtocolVersion = &pv mes.AgentVersion = &av + + return mes +} + +func (ids *IDService) getSignedRecord(snapshot *identifySnapshot) []byte { + if ids.disableSignedPeerRecord || snapshot.record == nil { + return nil + } + + recBytes, err := snapshot.record.Marshal() + if err != nil { + log.Errorw("failed to marshal signed record", "err", err) + return nil + } + + return recBytes } func (ids *IDService) consumeMessage(mes *pb.Identify, c network.Conn) { diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index 1dbea1f9d7..8167a3b452 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -766,3 +766,118 @@ func TestSendPushIfDeltaNotSupported(t *testing.T) { return err == nil && len(sup) == 0 }, 5*time.Second, 500*time.Millisecond) } + +/*func TestLargeIdentifyMessage(t *testing.T) { + oldTTL := peerstore.RecentlyConnectedAddrTTL + peerstore.RecentlyConnectedAddrTTL = time.Second + defer func() { + peerstore.RecentlyConnectedAddrTTL = oldTTL + }() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + sk1, _, err := coretest.RandTestKeyPair(ic.RSA, 4096) + require.NoError(t, err) + sk2, _, err := coretest.RandTestKeyPair(ic.RSA, 4096) + require.NoError(t, err) + + h1 := blhost.NewBlankHost(swarmt.GenSwarm(t, ctx, swarmt.OptPeerPrivateKey(sk1))) + h2 := blhost.NewBlankHost(swarmt.GenSwarm(t, ctx, swarmt.OptPeerPrivateKey(sk2))) + + // add protocol strings to make the message larger + for i := 0; i < 100; i++ { + r := "rand" + string(i) + h1.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) + h2.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) + } + + h1p := h1.ID() + h2p := h2.ID() + + ids1 := identify.NewIDService(h1) + ids2 := identify.NewIDService(h2) + defer ids1.Close() + defer ids2.Close() + + sub, err := ids1.Host.EventBus().Subscribe(new(event.EvtPeerIdentificationCompleted), eventbus.BufSize(16)) + if err != nil { + t.Fatal(err) + } + + testKnowsAddrs(t, h1, h2p, []ma.Multiaddr{}) // nothing + testKnowsAddrs(t, h2, h1p, []ma.Multiaddr{}) // nothing + + // the forgetMe addr represents an address for h1 that h2 has learned out of band + // (not via identify protocol). During the identify exchange, it will be + // forgotten and replaced by the addrs h1 sends. + forgetMe, _ := ma.NewMultiaddr("/ip4/1.2.3.4/tcp/1234") + + h2.Peerstore().AddAddr(h1p, forgetMe, peerstore.RecentlyConnectedAddrTTL) + time.Sleep(500 * time.Millisecond) + + h2pi := h2.Peerstore().PeerInfo(h2p) + if err := h1.Connect(ctx, h2pi); err != nil { + t.Fatal(err) + } + + h1t2c := h1.Network().ConnsToPeer(h2p) + if len(h1t2c) == 0 { + t.Fatal("should have a conn here") + } + + ids1.IdentifyConn(h1t2c[0]) + + // the IDService should be opened automatically, by the network. + // what we should see now is that both peers know about each others listen addresses. + t.Log("test peer1 has peer2 addrs correctly") + testKnowsAddrs(t, h1, h2p, h2.Addrs()) // has them + testHasCertifiedAddrs(t, h1, h2p, h2.Peerstore().Addrs(h2p)) // should have signed addrs also + testHasProtocolVersions(t, h1, h2p) + testHasPublicKey(t, h1, h2p, h2.Peerstore().PubKey(h2p)) // h1 should have h2's public key + + // now, this wait we do have to do. it's the wait for the Listening side + // to be done identifying the connection. + c := h2.Network().ConnsToPeer(h1.ID()) + if len(c) < 1 { + t.Fatal("should have connection by now at least.") + } + ids2.IdentifyConn(c[0]) + + // and the protocol versions. + t.Log("test peer2 has peer1 addrs correctly") + testKnowsAddrs(t, h2, h1p, h1.Addrs()) // has them + testHasCertifiedAddrs(t, h2, h1p, h1.Peerstore().Addrs(h1p)) + testHasProtocolVersions(t, h2, h1p) + testHasPublicKey(t, h2, h1p, h1.Peerstore().PubKey(h1p)) // h1 should have h2's public key + + // Need both sides to actually notice that the connection has been closed. + h1.Network().ClosePeer(h2p) + h2.Network().ClosePeer(h1p) + if len(h2.Network().ConnsToPeer(h1.ID())) != 0 || len(h1.Network().ConnsToPeer(h2.ID())) != 0 { + t.Fatal("should have no connections") + } + + t.Log("testing addrs just after disconnect") + // addresses don't immediately expire on disconnect, so we should still have them + testKnowsAddrs(t, h2, h1p, h1.Addrs()) + testKnowsAddrs(t, h1, h2p, h2.Addrs()) + testHasCertifiedAddrs(t, h1, h2p, h2.Peerstore().Addrs(h2p)) + testHasCertifiedAddrs(t, h2, h1p, h1.Peerstore().Addrs(h1p)) + + // the addrs had their TTLs reduced on disconnect, and + // will be forgotten soon after + t.Log("testing addrs after TTL expiration") + time.Sleep(2 * time.Second) + testKnowsAddrs(t, h1, h2p, []ma.Multiaddr{}) + testKnowsAddrs(t, h2, h1p, []ma.Multiaddr{}) + testHasCertifiedAddrs(t, h1, h2p, []ma.Multiaddr{}) + testHasCertifiedAddrs(t, h2, h1p, []ma.Multiaddr{}) + + // test that we received the "identify completed" event. + select { + case <-sub.Out(): + case <-time.After(10 * time.Second): + t.Fatalf("expected EvtPeerIdentificationCompleted event within 10 seconds; none received") + } +}*/ diff --git a/p2p/protocol/identify/pb/identify.pb.go b/p2p/protocol/identify/pb/identify.pb.go index a9f28d6e15..14faecbce7 100644 --- a/p2p/protocol/identify/pb/identify.pb.go +++ b/p2p/protocol/identify/pb/identify.pb.go @@ -5,6 +5,7 @@ package identify_pb import ( fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -99,6 +100,10 @@ type Identify struct { Protocols []string `protobuf:"bytes,3,rep,name=protocols" json:"protocols,omitempty"` // a delta update is incompatible with everything else. If this field is included, none of the others can appear. Delta *Delta `protobuf:"bytes,7,opt,name=delta" json:"delta,omitempty"` + // signedRecordInNextMessage is set to true by a peer to indicate to the receiver that the signed record is absent in the current message + // and the peer should read the next message from the stream to fetch it. + // This is done because messages with signed records can exceed the legacy message size of 2K bytes. + SignedRecordInNextMessage bool `protobuf:"varint,9,opt,name=signedRecordInNextMessage" json:"signedRecordInNextMessage"` // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. @@ -192,6 +197,13 @@ func (m *Identify) GetDelta() *Delta { return nil } +func (m *Identify) GetSignedRecordInNextMessage() bool { + if m != nil { + return m.SignedRecordInNextMessage + } + return false +} + func (m *Identify) GetSignedPeerRecord() []byte { if m != nil { return m.SignedPeerRecord @@ -207,24 +219,28 @@ func init() { func init() { proto.RegisterFile("identify.proto", fileDescriptor_83f1e7e6b485409f) } var fileDescriptor_83f1e7e6b485409f = []byte{ - // 272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4a, 0xc3, 0x40, - 0x14, 0x86, 0x99, 0xd6, 0x6a, 0xf3, 0x12, 0x5a, 0x99, 0xd5, 0x2c, 0x24, 0xc4, 0x6c, 0x1c, 0x5c, - 0x64, 0xe1, 0x0d, 0x14, 0x37, 0xe2, 0xa6, 0x8c, 0xe0, 0x56, 0x92, 0xbc, 0x67, 0x19, 0x48, 0x33, - 0x65, 0x32, 0x0a, 0xbd, 0x95, 0xc7, 0x70, 0xe9, 0x11, 0x24, 0x27, 0x91, 0x4c, 0x4d, 0x93, 0xea, - 0x72, 0x3e, 0x3e, 0xe6, 0x7f, 0xff, 0x0f, 0x0b, 0x8d, 0x54, 0x3b, 0xfd, 0xba, 0xcb, 0xb6, 0xd6, - 0x38, 0xc3, 0xc3, 0xe1, 0x5d, 0xa4, 0x4f, 0x30, 0xbb, 0xa7, 0xca, 0xe5, 0xfc, 0x0a, 0x96, 0x39, - 0x22, 0xe1, 0x8b, 0x97, 0x4a, 0x53, 0x35, 0x82, 0x25, 0x53, 0x19, 0xa8, 0x85, 0xc7, 0xab, 0x9e, - 0xf2, 0x4b, 0x88, 0xec, 0x66, 0x64, 0x4d, 0xbc, 0x15, 0xda, 0xcd, 0x41, 0x49, 0x3f, 0x26, 0x30, - 0x7f, 0xf8, 0x0d, 0xe1, 0x12, 0x96, 0xbd, 0xfc, 0x4c, 0xb6, 0xd1, 0xa6, 0x16, 0xb3, 0x84, 0xc9, - 0x40, 0xfd, 0xc5, 0x3c, 0x85, 0x28, 0x5f, 0x53, 0xed, 0x7a, 0xed, 0xd4, 0x6b, 0x47, 0x8c, 0x5f, - 0x40, 0xb0, 0x7d, 0x2b, 0x2a, 0x5d, 0x3e, 0xd2, 0x4e, 0xb0, 0x84, 0xc9, 0x48, 0x0d, 0x80, 0x27, - 0x10, 0x56, 0xba, 0x71, 0x54, 0xdf, 0x22, 0xda, 0xfd, 0x69, 0x91, 0x1a, 0xa3, 0x2e, 0xc3, 0x14, - 0x0d, 0xd9, 0x77, 0xc2, 0x0e, 0x88, 0x13, 0xff, 0xc5, 0x11, 0xf3, 0x19, 0x87, 0x7a, 0x53, 0x5f, - 0x6f, 0x00, 0x5c, 0xc2, 0x0c, 0xbb, 0xc5, 0xc4, 0x59, 0xc2, 0x64, 0x78, 0xc3, 0xb3, 0xd1, 0x9c, - 0x99, 0xdf, 0x52, 0xed, 0x05, 0x7e, 0x0d, 0xe7, 0x8d, 0x5e, 0xd7, 0x84, 0x2b, 0x22, 0xab, 0xa8, - 0x34, 0x16, 0xc5, 0xdc, 0xe7, 0xfd, 0xe3, 0x77, 0xd1, 0x67, 0x1b, 0xb3, 0xaf, 0x36, 0x66, 0xdf, - 0x6d, 0xcc, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x03, 0xc8, 0x41, 0xb3, 0x01, 0x00, 0x00, + // 331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xdf, 0x4a, 0xfb, 0x30, + 0x14, 0xc7, 0x7f, 0xd9, 0x9f, 0x9f, 0x6b, 0x5a, 0x36, 0xc9, 0x55, 0x15, 0x99, 0x75, 0x37, 0x06, + 0xc1, 0x0e, 0x7c, 0x03, 0x87, 0x37, 0x43, 0x94, 0x11, 0xc1, 0x5b, 0x69, 0x9b, 0xb3, 0x1a, 0xe8, + 0x9a, 0x91, 0x64, 0xe2, 0xde, 0x70, 0x97, 0x3e, 0x81, 0xc8, 0x9e, 0xc1, 0x07, 0x90, 0x9d, 0xba, + 0x7f, 0x8a, 0x77, 0x39, 0x9f, 0x7c, 0x92, 0x73, 0xce, 0x97, 0xb6, 0x95, 0x84, 0xd2, 0xa9, 0xf1, + 0x3c, 0x9e, 0x1a, 0xed, 0x34, 0xf3, 0xb7, 0x75, 0x7a, 0x7c, 0x99, 0x2b, 0xf7, 0x3c, 0x4b, 0xe3, + 0x4c, 0x4f, 0xfa, 0xb9, 0xce, 0x75, 0x1f, 0x9d, 0x74, 0x36, 0xc6, 0x0a, 0x0b, 0x3c, 0x55, 0x6f, + 0x7b, 0x0f, 0xb4, 0x79, 0x03, 0x85, 0x4b, 0xd8, 0x39, 0xed, 0x24, 0x52, 0x82, 0x7c, 0x42, 0x9e, + 0xe9, 0xc2, 0x86, 0x24, 0xaa, 0x73, 0x4f, 0xb4, 0x11, 0x8f, 0xd6, 0x94, 0x9d, 0xd1, 0xc0, 0x4c, + 0x76, 0xac, 0x1a, 0x5a, 0xbe, 0x99, 0x6c, 0x94, 0xde, 0x67, 0x8d, 0xb6, 0x86, 0xdf, 0x33, 0x31, + 0x4e, 0x3b, 0x6b, 0xf9, 0x11, 0x8c, 0x55, 0xba, 0x0c, 0x9b, 0x11, 0xe1, 0x9e, 0xf8, 0x89, 0x59, + 0x8f, 0x06, 0x49, 0x0e, 0xa5, 0x5b, 0x6b, 0xff, 0x51, 0xdb, 0x63, 0xec, 0x84, 0x7a, 0xd3, 0x59, + 0x5a, 0xa8, 0xec, 0x16, 0xe6, 0x21, 0x89, 0x08, 0x0f, 0xc4, 0x16, 0xb0, 0x88, 0xfa, 0x85, 0xb2, + 0x0e, 0xca, 0x6b, 0x29, 0x4d, 0x35, 0x5a, 0x20, 0x76, 0xd1, 0xaa, 0x87, 0x4e, 0x2d, 0x98, 0x17, + 0x90, 0x2b, 0x10, 0x36, 0xf0, 0x8b, 0x3d, 0x86, 0x3d, 0x36, 0xeb, 0xd5, 0x71, 0xbd, 0x2d, 0x60, + 0x9c, 0x36, 0xe5, 0x2a, 0xb1, 0xf0, 0x20, 0x22, 0xdc, 0xbf, 0x62, 0xf1, 0x4e, 0xfa, 0x31, 0x66, + 0x29, 0x2a, 0x81, 0x0d, 0xe8, 0x91, 0x55, 0x79, 0x09, 0x52, 0x40, 0xa6, 0x8d, 0x1c, 0x96, 0xf7, + 0xf0, 0xea, 0xee, 0xc0, 0xda, 0x24, 0x87, 0xd0, 0x8b, 0x08, 0x6f, 0x0d, 0x1a, 0x8b, 0xf7, 0xd3, + 0x7f, 0xe2, 0x6f, 0x8d, 0x5d, 0xd0, 0xc3, 0xea, 0x72, 0x04, 0x60, 0x2a, 0x21, 0x6c, 0xe1, 0xcc, + 0xbf, 0xf8, 0x20, 0x58, 0x2c, 0xbb, 0xe4, 0x6d, 0xd9, 0x25, 0x1f, 0xcb, 0x2e, 0xf9, 0x0a, 0x00, + 0x00, 0xff, 0xff, 0x49, 0x35, 0xe7, 0x94, 0x26, 0x02, 0x00, 0x00, } func (m *Delta) Marshal() (dAtA []byte, err error) { @@ -296,6 +312,14 @@ func (m *Identify) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + i-- + if m.SignedRecordInNextMessage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 if m.SignedPeerRecord != nil { i -= len(m.SignedPeerRecord) copy(dAtA[i:], m.SignedPeerRecord) @@ -441,6 +465,7 @@ func (m *Identify) Size() (n int) { l = len(m.SignedPeerRecord) n += 1 + l + sovIdentify(uint64(l)) } + n += 2 if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -868,6 +893,26 @@ func (m *Identify) Unmarshal(dAtA []byte) error { m.SignedPeerRecord = []byte{} } iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SignedRecordInNextMessage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIdentify + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SignedRecordInNextMessage = bool(v != 0) default: iNdEx = preIndex skippy, err := skipIdentify(dAtA[iNdEx:]) diff --git a/p2p/protocol/identify/pb/identify.proto b/p2p/protocol/identify/pb/identify.proto index afc85253f6..aaa521b38e 100644 --- a/p2p/protocol/identify/pb/identify.proto +++ b/p2p/protocol/identify/pb/identify.proto @@ -2,6 +2,8 @@ syntax = "proto2"; package identify.pb; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + message Delta { // new protocols now serviced by the peer. repeated string added_protocols = 1; @@ -37,10 +39,15 @@ message Identify { // a delta update is incompatible with everything else. If this field is included, none of the others can appear. optional Delta delta = 7; + // signedRecordInNextMessage is set to true by a peer to indicate to the receiver that the signed record is absent in the current message + // and the peer should read the next message from the stream to fetch it. + // This is done because messages with signed records can exceed the legacy message size of 2K bytes. + optional bool signedRecordInNextMessage = 9 [(gogoproto.nullable) = false]; + // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. // see github.com/libp2p/go-libp2p-core/record/pb/envelope.proto and // github.com/libp2p/go-libp2p-core/peer/pb/peer_record.proto for message definitions. optional bytes signedPeerRecord = 8; -} +} \ No newline at end of file diff --git a/p2p/protocol/identify/peer_loop.go b/p2p/protocol/identify/peer_loop.go index 8e66b0ef6b..46df782e8a 100644 --- a/p2p/protocol/identify/peer_loop.go +++ b/p2p/protocol/identify/peer_loop.go @@ -116,9 +116,15 @@ func (ph *peerHandler) sendDelta() error { return fmt.Errorf("failed to open delta stream: %w", err) } - if err := ph.sendMessage(ds, &pb.Identify{Delta: mes}); err != nil { + defer helpers.FullClose(ds) + + c := ds.Conn() + if err := ggio.NewDelimitedWriter(ds).WriteMsg(&pb.Identify{Delta: mes}); err != nil { return fmt.Errorf("failed to send delta message, %w", err) } + log.Debugw("sent identify update", "protocol", ds.Protocol(), "peer", c.RemotePeer(), + "peer address", c.RemoteMultiaddr()) + return nil } @@ -131,20 +137,16 @@ func (ph *peerHandler) sendPush() error { if err != nil { return fmt.Errorf("failed to open push stream: %w", err) } - - conn := dp.Conn() - mes := &pb.Identify{} + defer helpers.FullClose(dp) snapshot := ph.ids.getSnapshot() ph.snapshotMu.Lock() ph.snapshot = snapshot ph.snapshotMu.Unlock() - - ph.ids.populateMessage(mes, conn, snapshot) - - if err := ph.sendMessage(dp, mes); err != nil { + if err := ph.ids.writeChunkedIdentifyMsg(dp.Conn(), snapshot, dp); err != nil { return fmt.Errorf("failed to send push message: %w", err) } + return nil } @@ -244,15 +246,3 @@ func (ph *peerHandler) nextDelta() *pb.Delta { RmProtocols: removed, } } - -func (ph *peerHandler) sendMessage(s network.Stream, mes *pb.Identify) error { - defer helpers.FullClose(s) - c := s.Conn() - if err := ggio.NewDelimitedWriter(s).WriteMsg(mes); err != nil { - return err - - } - log.Debugw("sent identify update", "protocol", s.Protocol(), "peer", c.RemotePeer(), - "peer address", c.RemoteMultiaddr()) - return nil -} From 60b52f10aece5ef61e9f176c12d4d069dc80207f Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Tue, 2 Jun 2020 20:48:23 +0530 Subject: [PATCH 2/5] more protocol strings --- p2p/protocol/identify/id.go | 30 ++++++------- p2p/protocol/identify/id_test.go | 7 +-- p2p/protocol/identify/pb/identify.pb.go | 57 ++++++++++++------------- p2p/protocol/identify/pb/identify.proto | 6 +-- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index a43643cce0..734682b3b6 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -406,7 +406,7 @@ func (ids *IDService) sendIdentifyResp(s network.Stream) { func (ids *IDService) handleIdentifyResponse(s network.Stream) { c := s.Conn() - r := ggio.NewDelimitedReader(s, legacyIDSize) + r := ggio.NewDelimitedReader(s, signedIDSize) mes := pb.Identify{} if err := r.ReadMsg(&mes); err != nil { log.Warning("error reading identify message: ", err) @@ -414,9 +414,9 @@ func (ids *IDService) handleIdentifyResponse(s network.Stream) { return } - if mes.SignedRecordInNextMessage { + if mes.More { m := &pb.Identify{} - if err := ggio.NewDelimitedReader(s, signedIDSize).ReadMsg(m); err != nil { + if err := r.ReadMsg(m); err != nil { log.Warning("error reading identify message: ", err) s.Reset() return @@ -444,28 +444,28 @@ func (ids *IDService) getSnapshot() *identifySnapshot { } func (ids *IDService) writeChunkedIdentifyMsg(c network.Conn, snapshot *identifySnapshot, s network.Stream) error { - mes := ids.getIdentifyMsgUnsigned(c, snapshot) + mes := ids.createBaseIdentifyResponse(c, snapshot) sr := ids.getSignedRecord(snapshot) mes.SignedPeerRecord = sr writer := ggio.NewDelimitedWriter(s) if sr == nil || proto.Size(mes) <= legacyIDSize { return writer.WriteMsg(mes) - } else { - mes.SignedPeerRecord = nil - mes.SignedRecordInNextMessage = true - if err := writer.WriteMsg(mes); err != nil { - return err - } - - // then write just the signed record - m := &pb.Identify{SignedPeerRecord: sr} - err := writer.WriteMsg(m) + } + mes.SignedPeerRecord = nil + mes.More = true + if err := writer.WriteMsg(mes); err != nil { return err } + + // then write just the signed record + m := &pb.Identify{SignedPeerRecord: sr} + err := writer.WriteMsg(m) + return err + } -func (ids *IDService) getIdentifyMsgUnsigned( +func (ids *IDService) createBaseIdentifyResponse( conn network.Conn, snapshot *identifySnapshot, ) *pb.Identify { diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index 8167a3b452..2745a9f220 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -767,7 +767,7 @@ func TestSendPushIfDeltaNotSupported(t *testing.T) { }, 5*time.Second, 500*time.Millisecond) } -/*func TestLargeIdentifyMessage(t *testing.T) { +func TestLargeIdentifyMessage(t *testing.T) { oldTTL := peerstore.RecentlyConnectedAddrTTL peerstore.RecentlyConnectedAddrTTL = time.Second defer func() { @@ -786,7 +786,8 @@ func TestSendPushIfDeltaNotSupported(t *testing.T) { h2 := blhost.NewBlankHost(swarmt.GenSwarm(t, ctx, swarmt.OptPeerPrivateKey(sk2))) // add protocol strings to make the message larger - for i := 0; i < 100; i++ { + // about 2K of protocol strings + for i := 0; i < 500; i++ { r := "rand" + string(i) h1.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) h2.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) @@ -880,4 +881,4 @@ func TestSendPushIfDeltaNotSupported(t *testing.T) { case <-time.After(10 * time.Second): t.Fatalf("expected EvtPeerIdentificationCompleted event within 10 seconds; none received") } -}*/ +} diff --git a/p2p/protocol/identify/pb/identify.pb.go b/p2p/protocol/identify/pb/identify.pb.go index 14faecbce7..506959c58c 100644 --- a/p2p/protocol/identify/pb/identify.pb.go +++ b/p2p/protocol/identify/pb/identify.pb.go @@ -100,10 +100,10 @@ type Identify struct { Protocols []string `protobuf:"bytes,3,rep,name=protocols" json:"protocols,omitempty"` // a delta update is incompatible with everything else. If this field is included, none of the others can appear. Delta *Delta `protobuf:"bytes,7,opt,name=delta" json:"delta,omitempty"` - // signedRecordInNextMessage is set to true by a peer to indicate to the receiver that the signed record is absent in the current message + // more is set to true by a peer to indicate to the receiver that the signed record is absent in the current message // and the peer should read the next message from the stream to fetch it. // This is done because messages with signed records can exceed the legacy message size of 2K bytes. - SignedRecordInNextMessage bool `protobuf:"varint,9,opt,name=signedRecordInNextMessage" json:"signedRecordInNextMessage"` + More bool `protobuf:"varint,9,opt,name=more" json:"more"` // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. @@ -197,9 +197,9 @@ func (m *Identify) GetDelta() *Delta { return nil } -func (m *Identify) GetSignedRecordInNextMessage() bool { +func (m *Identify) GetMore() bool { if m != nil { - return m.SignedRecordInNextMessage + return m.More } return false } @@ -219,28 +219,27 @@ func init() { func init() { proto.RegisterFile("identify.proto", fileDescriptor_83f1e7e6b485409f) } var fileDescriptor_83f1e7e6b485409f = []byte{ - // 331 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xdf, 0x4a, 0xfb, 0x30, - 0x14, 0xc7, 0x7f, 0xd9, 0x9f, 0x9f, 0x6b, 0x5a, 0x36, 0xc9, 0x55, 0x15, 0x99, 0x75, 0x37, 0x06, - 0xc1, 0x0e, 0x7c, 0x03, 0x87, 0x37, 0x43, 0x94, 0x11, 0xc1, 0x5b, 0x69, 0x9b, 0xb3, 0x1a, 0xe8, - 0x9a, 0x91, 0x64, 0xe2, 0xde, 0x70, 0x97, 0x3e, 0x81, 0xc8, 0x9e, 0xc1, 0x07, 0x90, 0x9d, 0xba, - 0x7f, 0x8a, 0x77, 0x39, 0x9f, 0x7c, 0x92, 0x73, 0xce, 0x97, 0xb6, 0x95, 0x84, 0xd2, 0xa9, 0xf1, - 0x3c, 0x9e, 0x1a, 0xed, 0x34, 0xf3, 0xb7, 0x75, 0x7a, 0x7c, 0x99, 0x2b, 0xf7, 0x3c, 0x4b, 0xe3, - 0x4c, 0x4f, 0xfa, 0xb9, 0xce, 0x75, 0x1f, 0x9d, 0x74, 0x36, 0xc6, 0x0a, 0x0b, 0x3c, 0x55, 0x6f, - 0x7b, 0x0f, 0xb4, 0x79, 0x03, 0x85, 0x4b, 0xd8, 0x39, 0xed, 0x24, 0x52, 0x82, 0x7c, 0x42, 0x9e, - 0xe9, 0xc2, 0x86, 0x24, 0xaa, 0x73, 0x4f, 0xb4, 0x11, 0x8f, 0xd6, 0x94, 0x9d, 0xd1, 0xc0, 0x4c, - 0x76, 0xac, 0x1a, 0x5a, 0xbe, 0x99, 0x6c, 0x94, 0xde, 0x67, 0x8d, 0xb6, 0x86, 0xdf, 0x33, 0x31, - 0x4e, 0x3b, 0x6b, 0xf9, 0x11, 0x8c, 0x55, 0xba, 0x0c, 0x9b, 0x11, 0xe1, 0x9e, 0xf8, 0x89, 0x59, - 0x8f, 0x06, 0x49, 0x0e, 0xa5, 0x5b, 0x6b, 0xff, 0x51, 0xdb, 0x63, 0xec, 0x84, 0x7a, 0xd3, 0x59, - 0x5a, 0xa8, 0xec, 0x16, 0xe6, 0x21, 0x89, 0x08, 0x0f, 0xc4, 0x16, 0xb0, 0x88, 0xfa, 0x85, 0xb2, - 0x0e, 0xca, 0x6b, 0x29, 0x4d, 0x35, 0x5a, 0x20, 0x76, 0xd1, 0xaa, 0x87, 0x4e, 0x2d, 0x98, 0x17, - 0x90, 0x2b, 0x10, 0x36, 0xf0, 0x8b, 0x3d, 0x86, 0x3d, 0x36, 0xeb, 0xd5, 0x71, 0xbd, 0x2d, 0x60, - 0x9c, 0x36, 0xe5, 0x2a, 0xb1, 0xf0, 0x20, 0x22, 0xdc, 0xbf, 0x62, 0xf1, 0x4e, 0xfa, 0x31, 0x66, - 0x29, 0x2a, 0x81, 0x0d, 0xe8, 0x91, 0x55, 0x79, 0x09, 0x52, 0x40, 0xa6, 0x8d, 0x1c, 0x96, 0xf7, - 0xf0, 0xea, 0xee, 0xc0, 0xda, 0x24, 0x87, 0xd0, 0x8b, 0x08, 0x6f, 0x0d, 0x1a, 0x8b, 0xf7, 0xd3, - 0x7f, 0xe2, 0x6f, 0x8d, 0x5d, 0xd0, 0xc3, 0xea, 0x72, 0x04, 0x60, 0x2a, 0x21, 0x6c, 0xe1, 0xcc, - 0xbf, 0xf8, 0x20, 0x58, 0x2c, 0xbb, 0xe4, 0x6d, 0xd9, 0x25, 0x1f, 0xcb, 0x2e, 0xf9, 0x0a, 0x00, - 0x00, 0xff, 0xff, 0x49, 0x35, 0xe7, 0x94, 0x26, 0x02, 0x00, 0x00, + // 316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xcd, 0x4a, 0xf3, 0x40, + 0x14, 0x86, 0xbf, 0xe9, 0xcf, 0x67, 0x73, 0x12, 0x5a, 0x99, 0xd5, 0x20, 0x52, 0x63, 0x37, 0x0e, + 0x82, 0x29, 0x78, 0x07, 0x16, 0x37, 0xe2, 0xa6, 0x8c, 0xe0, 0x56, 0x9a, 0xcc, 0x69, 0x1c, 0x48, + 0x32, 0x65, 0x32, 0x15, 0x7a, 0x87, 0xc5, 0x95, 0x57, 0x20, 0xd2, 0x2b, 0x91, 0x9e, 0xda, 0x3f, + 0xdd, 0xe5, 0x3c, 0x3c, 0x99, 0xf3, 0x9e, 0x17, 0xba, 0x46, 0x63, 0xe5, 0xcd, 0x74, 0x91, 0xcc, + 0x9c, 0xf5, 0x96, 0x87, 0xfb, 0x39, 0x3d, 0xbb, 0xc9, 0x8d, 0x7f, 0x9d, 0xa7, 0x49, 0x66, 0xcb, + 0x61, 0x6e, 0x73, 0x3b, 0x24, 0x27, 0x9d, 0x4f, 0x69, 0xa2, 0x81, 0xbe, 0x36, 0xff, 0x0e, 0x9e, + 0xa0, 0x7d, 0x8f, 0x85, 0x9f, 0xf0, 0x2b, 0xe8, 0x4d, 0xb4, 0x46, 0xfd, 0x42, 0x3c, 0xb3, 0x45, + 0x2d, 0x58, 0xdc, 0x94, 0x81, 0xea, 0x12, 0x1e, 0x6f, 0x29, 0xbf, 0x84, 0xc8, 0x95, 0x07, 0x56, + 0x83, 0xac, 0xd0, 0x95, 0x3b, 0x65, 0xf0, 0xde, 0x80, 0xce, 0xc3, 0x4f, 0x26, 0x2e, 0xa1, 0xb7, + 0x95, 0x9f, 0xd1, 0xd5, 0xc6, 0x56, 0xa2, 0x1d, 0x33, 0x19, 0xa8, 0xdf, 0x98, 0x0f, 0x20, 0x9a, + 0xe4, 0x58, 0xf9, 0xad, 0xf6, 0x9f, 0xb4, 0x23, 0xc6, 0xcf, 0x21, 0x98, 0xcd, 0xd3, 0xc2, 0x64, + 0x8f, 0xb8, 0x10, 0x2c, 0x66, 0x32, 0x52, 0x7b, 0xc0, 0x63, 0x08, 0x0b, 0x53, 0x7b, 0xac, 0xee, + 0xb4, 0x76, 0x9b, 0x68, 0x91, 0x3a, 0x44, 0xeb, 0x1d, 0x36, 0xad, 0xd1, 0xbd, 0xa1, 0x5e, 0x03, + 0xd1, 0xa2, 0x27, 0x8e, 0x18, 0xed, 0xd8, 0x9d, 0xd7, 0xa4, 0xf3, 0xf6, 0x80, 0x4b, 0x68, 0xeb, + 0x75, 0x63, 0xe2, 0x24, 0x66, 0x32, 0xbc, 0xe5, 0xc9, 0x41, 0xfb, 0x09, 0x75, 0xa9, 0x36, 0x02, + 0x17, 0xd0, 0x2a, 0xad, 0x43, 0x11, 0xc4, 0x4c, 0x76, 0x46, 0xad, 0xe5, 0xe7, 0xc5, 0x3f, 0x45, + 0x84, 0x5f, 0xc3, 0x69, 0x6d, 0xf2, 0x0a, 0xf5, 0x18, 0xd1, 0x29, 0xcc, 0xac, 0xd3, 0xa2, 0x43, + 0x49, 0xfe, 0xf0, 0x51, 0xb4, 0x5c, 0xf5, 0xd9, 0xc7, 0xaa, 0xcf, 0xbe, 0x56, 0x7d, 0xf6, 0x1d, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xed, 0x85, 0x1b, 0xfc, 0x01, 0x00, 0x00, } func (m *Delta) Marshal() (dAtA []byte, err error) { @@ -313,7 +312,7 @@ func (m *Identify) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } i-- - if m.SignedRecordInNextMessage { + if m.More { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -895,7 +894,7 @@ func (m *Identify) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedRecordInNextMessage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -912,7 +911,7 @@ func (m *Identify) Unmarshal(dAtA []byte) error { break } } - m.SignedRecordInNextMessage = bool(v != 0) + m.More = bool(v != 0) default: iNdEx = preIndex skippy, err := skipIdentify(dAtA[iNdEx:]) diff --git a/p2p/protocol/identify/pb/identify.proto b/p2p/protocol/identify/pb/identify.proto index aaa521b38e..f81d7a0e93 100644 --- a/p2p/protocol/identify/pb/identify.proto +++ b/p2p/protocol/identify/pb/identify.proto @@ -39,10 +39,10 @@ message Identify { // a delta update is incompatible with everything else. If this field is included, none of the others can appear. optional Delta delta = 7; - // signedRecordInNextMessage is set to true by a peer to indicate to the receiver that the signed record is absent in the current message + // more is set to true by a peer to indicate to the receiver that the signed record is absent in the current message // and the peer should read the next message from the stream to fetch it. // This is done because messages with signed records can exceed the legacy message size of 2K bytes. - optional bool signedRecordInNextMessage = 9 [(gogoproto.nullable) = false]; + optional bool more = 9 [(gogoproto.nullable) = false]; // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but @@ -50,4 +50,4 @@ message Identify { // see github.com/libp2p/go-libp2p-core/record/pb/envelope.proto and // github.com/libp2p/go-libp2p-core/peer/pb/peer_record.proto for message definitions. optional bytes signedPeerRecord = 8; -} \ No newline at end of file +} From c4a1e220ac3d3fd0f8e5cd7072b9bd71d2c4f8af Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Tue, 2 Jun 2020 21:00:57 +0530 Subject: [PATCH 3/5] test large push msgs --- p2p/protocol/identify/id_test.go | 97 ++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index 2745a9f220..b9e836ffc6 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -882,3 +882,100 @@ func TestLargeIdentifyMessage(t *testing.T) { t.Fatalf("expected EvtPeerIdentificationCompleted event within 10 seconds; none received") } } + +func TestLargePushMessage(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + sk1, _, err := coretest.RandTestKeyPair(ic.RSA, 4096) + require.NoError(t, err) + sk2, _, err := coretest.RandTestKeyPair(ic.RSA, 4096) + require.NoError(t, err) + + h1 := blhost.NewBlankHost(swarmt.GenSwarm(t, ctx, swarmt.OptPeerPrivateKey(sk1))) + h2 := blhost.NewBlankHost(swarmt.GenSwarm(t, ctx, swarmt.OptPeerPrivateKey(sk2))) + + // add protocol strings to make the message larger + // about 2K of protocol strings + for i := 0; i < 500; i++ { + r := "rand" + string(i) + h1.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) + h2.SetStreamHandler(protocol.ID(r), func(network.Stream) {}) + } + + h1p := h1.ID() + h2p := h2.ID() + + ids1 := identify.NewIDService(h1) + ids2 := identify.NewIDService(h2) + defer ids1.Close() + defer ids2.Close() + + testKnowsAddrs(t, h1, h2p, []ma.Multiaddr{}) // nothing + testKnowsAddrs(t, h2, h1p, []ma.Multiaddr{}) // nothing + + h2pi := h2.Peerstore().PeerInfo(h2p) + require.NoError(t, h1.Connect(ctx, h2pi)) + // h1 should immediately see a connection from h2 + require.Len(t, h1.Network().ConnsToPeer(h2p), 1) + // wait for h2 to Identify itself so we are sure h2 has seen the connection. + ids1.IdentifyConn(h1.Network().ConnsToPeer(h2p)[0]) + + // h2 should now see the connection and we should wait for h1 to Identify itself to h2. + require.Len(t, h2.Network().ConnsToPeer(h1p), 1) + ids2.IdentifyConn(h2.Network().ConnsToPeer(h1p)[0]) + + testKnowsAddrs(t, h1, h2p, h2.Peerstore().Addrs(h2p)) + testKnowsAddrs(t, h2, h1p, h1.Peerstore().Addrs(h1p)) + + // change addr on host 1 and ensure host2 gets a push + lad := ma.StringCast("/ip4/127.0.0.1/tcp/1234") + require.NoError(t, h1.Network().Listen(lad)) + require.Contains(t, h1.Addrs(), lad) + emitAddrChangeEvt(t, h1) + + require.Eventually(t, func() bool { + addrs := h2.Peerstore().Addrs(h1p) + for _, ad := range addrs { + if ad.Equal(lad) { + return true + } + } + return false + }, 5*time.Second, 500*time.Millisecond) + require.NotNil(t, getSignedRecord(t, h2, h1p)) + + // change addr on host2 and ensure host 1 gets a pus + lad = ma.StringCast("/ip4/127.0.0.1/tcp/1235") + require.NoError(t, h2.Network().Listen(lad)) + require.Contains(t, h2.Addrs(), lad) + emitAddrChangeEvt(t, h2) + + require.Eventually(t, func() bool { + addrs := h1.Peerstore().Addrs(h2p) + for _, ad := range addrs { + if ad.Equal(lad) { + return true + } + } + return false + }, 5*time.Second, 500*time.Millisecond) + testHasCertifiedAddrs(t, h1, h2p, h2.Addrs()) + + // change addr on host2 again + lad2 := ma.StringCast("/ip4/127.0.0.1/tcp/1236") + require.NoError(t, h2.Network().Listen(lad2)) + require.Contains(t, h2.Addrs(), lad2) + emitAddrChangeEvt(t, h2) + + require.Eventually(t, func() bool { + addrs := h1.Peerstore().Addrs(h2p) + for _, ad := range addrs { + if ad.Equal(lad2) { + return true + } + } + return false + }, 5*time.Second, 500*time.Millisecond) + testHasCertifiedAddrs(t, h2, h1p, h1.Addrs()) +} From 513e13d0d26b519bd7e8da9922ce9e00b1665e3f Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Wed, 3 Jun 2020 14:31:16 +0530 Subject: [PATCH 4/5] changes as per review --- p2p/protocol/identify/id.go | 41 +++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 734682b3b6..a3b2e3c14e 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -3,6 +3,7 @@ package identify import ( "context" "fmt" + "io" "runtime/debug" "sync" "time" @@ -44,8 +45,11 @@ const LibP2PVersion = "ipfs/0.1.0" // Deprecated: Set this with the UserAgent option. var ClientVersion = "github.com/libp2p/go-libp2p" -var legacyIDSize = 2 * 1024 // 2k Bytes -var signedIDSize = 8 * 1024 // 8K +var ( + legacyIDSize = 2 * 1024 // 2k Bytes + signedIDSize = 8 * 1024 // 8K + maxMessages = 10 +) func init() { bi, ok := debug.ReadBuildInfo() @@ -407,28 +411,35 @@ func (ids *IDService) handleIdentifyResponse(s network.Stream) { c := s.Conn() r := ggio.NewDelimitedReader(s, signedIDSize) - mes := pb.Identify{} - if err := r.ReadMsg(&mes); err != nil { + mes := &pb.Identify{} + + if err := readAllIDMessages(r, mes); err != nil { log.Warning("error reading identify message: ", err) s.Reset() return } - if mes.More { - m := &pb.Identify{} - if err := r.ReadMsg(m); err != nil { - log.Warning("error reading identify message: ", err) - s.Reset() - return - } - mes.SignedPeerRecord = m.SignedPeerRecord - } - defer func() { go helpers.FullClose(s) }() log.Debugf("%s received message from %s %s", s.Protocol(), c.RemotePeer(), c.RemoteMultiaddr()) - ids.consumeMessage(&mes, c) + ids.consumeMessage(mes, c) +} + +func readAllIDMessages(r ggio.Reader, finalMsg proto.Message) error { + mes := &pb.Identify{} + for i := 0; i < maxMessages; i++ { + switch err := r.ReadMsg(mes); err { + case io.EOF: + return nil + case nil: + proto.Merge(finalMsg, mes) + default: + return err + } + } + + return fmt.Errorf("too many parts") } func (ids *IDService) getSnapshot() *identifySnapshot { From b22add866accb455ca7a79db12bd5f62d2603287 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 3 Jun 2020 15:41:08 -0700 Subject: [PATCH 5/5] fix: remove more field We no longer need it now that we keep reading till the stream closes. --- p2p/protocol/identify/id.go | 1 - p2p/protocol/identify/pb/identify.pb.go | 80 ++++++------------------- p2p/protocol/identify/pb/identify.proto | 7 --- 3 files changed, 18 insertions(+), 70 deletions(-) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index a3b2e3c14e..37effbe7f6 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -464,7 +464,6 @@ func (ids *IDService) writeChunkedIdentifyMsg(c network.Conn, snapshot *identify return writer.WriteMsg(mes) } mes.SignedPeerRecord = nil - mes.More = true if err := writer.WriteMsg(mes); err != nil { return err } diff --git a/p2p/protocol/identify/pb/identify.pb.go b/p2p/protocol/identify/pb/identify.pb.go index 506959c58c..a9f28d6e15 100644 --- a/p2p/protocol/identify/pb/identify.pb.go +++ b/p2p/protocol/identify/pb/identify.pb.go @@ -5,7 +5,6 @@ package identify_pb import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -100,10 +99,6 @@ type Identify struct { Protocols []string `protobuf:"bytes,3,rep,name=protocols" json:"protocols,omitempty"` // a delta update is incompatible with everything else. If this field is included, none of the others can appear. Delta *Delta `protobuf:"bytes,7,opt,name=delta" json:"delta,omitempty"` - // more is set to true by a peer to indicate to the receiver that the signed record is absent in the current message - // and the peer should read the next message from the stream to fetch it. - // This is done because messages with signed records can exceed the legacy message size of 2K bytes. - More bool `protobuf:"varint,9,opt,name=more" json:"more"` // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. @@ -197,13 +192,6 @@ func (m *Identify) GetDelta() *Delta { return nil } -func (m *Identify) GetMore() bool { - if m != nil { - return m.More - } - return false -} - func (m *Identify) GetSignedPeerRecord() []byte { if m != nil { return m.SignedPeerRecord @@ -219,27 +207,24 @@ func init() { func init() { proto.RegisterFile("identify.proto", fileDescriptor_83f1e7e6b485409f) } var fileDescriptor_83f1e7e6b485409f = []byte{ - // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xcd, 0x4a, 0xf3, 0x40, - 0x14, 0x86, 0xbf, 0xe9, 0xcf, 0x67, 0x73, 0x12, 0x5a, 0x99, 0xd5, 0x20, 0x52, 0x63, 0x37, 0x0e, - 0x82, 0x29, 0x78, 0x07, 0x16, 0x37, 0xe2, 0xa6, 0x8c, 0xe0, 0x56, 0x9a, 0xcc, 0x69, 0x1c, 0x48, - 0x32, 0x65, 0x32, 0x15, 0x7a, 0x87, 0xc5, 0x95, 0x57, 0x20, 0xd2, 0x2b, 0x91, 0x9e, 0xda, 0x3f, - 0xdd, 0xe5, 0x3c, 0x3c, 0x99, 0xf3, 0x9e, 0x17, 0xba, 0x46, 0x63, 0xe5, 0xcd, 0x74, 0x91, 0xcc, - 0x9c, 0xf5, 0x96, 0x87, 0xfb, 0x39, 0x3d, 0xbb, 0xc9, 0x8d, 0x7f, 0x9d, 0xa7, 0x49, 0x66, 0xcb, - 0x61, 0x6e, 0x73, 0x3b, 0x24, 0x27, 0x9d, 0x4f, 0x69, 0xa2, 0x81, 0xbe, 0x36, 0xff, 0x0e, 0x9e, - 0xa0, 0x7d, 0x8f, 0x85, 0x9f, 0xf0, 0x2b, 0xe8, 0x4d, 0xb4, 0x46, 0xfd, 0x42, 0x3c, 0xb3, 0x45, - 0x2d, 0x58, 0xdc, 0x94, 0x81, 0xea, 0x12, 0x1e, 0x6f, 0x29, 0xbf, 0x84, 0xc8, 0x95, 0x07, 0x56, - 0x83, 0xac, 0xd0, 0x95, 0x3b, 0x65, 0xf0, 0xde, 0x80, 0xce, 0xc3, 0x4f, 0x26, 0x2e, 0xa1, 0xb7, - 0x95, 0x9f, 0xd1, 0xd5, 0xc6, 0x56, 0xa2, 0x1d, 0x33, 0x19, 0xa8, 0xdf, 0x98, 0x0f, 0x20, 0x9a, - 0xe4, 0x58, 0xf9, 0xad, 0xf6, 0x9f, 0xb4, 0x23, 0xc6, 0xcf, 0x21, 0x98, 0xcd, 0xd3, 0xc2, 0x64, - 0x8f, 0xb8, 0x10, 0x2c, 0x66, 0x32, 0x52, 0x7b, 0xc0, 0x63, 0x08, 0x0b, 0x53, 0x7b, 0xac, 0xee, - 0xb4, 0x76, 0x9b, 0x68, 0x91, 0x3a, 0x44, 0xeb, 0x1d, 0x36, 0xad, 0xd1, 0xbd, 0xa1, 0x5e, 0x03, - 0xd1, 0xa2, 0x27, 0x8e, 0x18, 0xed, 0xd8, 0x9d, 0xd7, 0xa4, 0xf3, 0xf6, 0x80, 0x4b, 0x68, 0xeb, - 0x75, 0x63, 0xe2, 0x24, 0x66, 0x32, 0xbc, 0xe5, 0xc9, 0x41, 0xfb, 0x09, 0x75, 0xa9, 0x36, 0x02, - 0x17, 0xd0, 0x2a, 0xad, 0x43, 0x11, 0xc4, 0x4c, 0x76, 0x46, 0xad, 0xe5, 0xe7, 0xc5, 0x3f, 0x45, - 0x84, 0x5f, 0xc3, 0x69, 0x6d, 0xf2, 0x0a, 0xf5, 0x18, 0xd1, 0x29, 0xcc, 0xac, 0xd3, 0xa2, 0x43, - 0x49, 0xfe, 0xf0, 0x51, 0xb4, 0x5c, 0xf5, 0xd9, 0xc7, 0xaa, 0xcf, 0xbe, 0x56, 0x7d, 0xf6, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xed, 0x85, 0x1b, 0xfc, 0x01, 0x00, 0x00, + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4a, 0xc3, 0x40, + 0x14, 0x86, 0x99, 0xd6, 0x6a, 0xf3, 0x12, 0x5a, 0x99, 0xd5, 0x2c, 0x24, 0xc4, 0x6c, 0x1c, 0x5c, + 0x64, 0xe1, 0x0d, 0x14, 0x37, 0xe2, 0xa6, 0x8c, 0xe0, 0x56, 0x92, 0xbc, 0x67, 0x19, 0x48, 0x33, + 0x65, 0x32, 0x0a, 0xbd, 0x95, 0xc7, 0x70, 0xe9, 0x11, 0x24, 0x27, 0x91, 0x4c, 0x4d, 0x93, 0xea, + 0x72, 0x3e, 0x3e, 0xe6, 0x7f, 0xff, 0x0f, 0x0b, 0x8d, 0x54, 0x3b, 0xfd, 0xba, 0xcb, 0xb6, 0xd6, + 0x38, 0xc3, 0xc3, 0xe1, 0x5d, 0xa4, 0x4f, 0x30, 0xbb, 0xa7, 0xca, 0xe5, 0xfc, 0x0a, 0x96, 0x39, + 0x22, 0xe1, 0x8b, 0x97, 0x4a, 0x53, 0x35, 0x82, 0x25, 0x53, 0x19, 0xa8, 0x85, 0xc7, 0xab, 0x9e, + 0xf2, 0x4b, 0x88, 0xec, 0x66, 0x64, 0x4d, 0xbc, 0x15, 0xda, 0xcd, 0x41, 0x49, 0x3f, 0x26, 0x30, + 0x7f, 0xf8, 0x0d, 0xe1, 0x12, 0x96, 0xbd, 0xfc, 0x4c, 0xb6, 0xd1, 0xa6, 0x16, 0xb3, 0x84, 0xc9, + 0x40, 0xfd, 0xc5, 0x3c, 0x85, 0x28, 0x5f, 0x53, 0xed, 0x7a, 0xed, 0xd4, 0x6b, 0x47, 0x8c, 0x5f, + 0x40, 0xb0, 0x7d, 0x2b, 0x2a, 0x5d, 0x3e, 0xd2, 0x4e, 0xb0, 0x84, 0xc9, 0x48, 0x0d, 0x80, 0x27, + 0x10, 0x56, 0xba, 0x71, 0x54, 0xdf, 0x22, 0xda, 0xfd, 0x69, 0x91, 0x1a, 0xa3, 0x2e, 0xc3, 0x14, + 0x0d, 0xd9, 0x77, 0xc2, 0x0e, 0x88, 0x13, 0xff, 0xc5, 0x11, 0xf3, 0x19, 0x87, 0x7a, 0x53, 0x5f, + 0x6f, 0x00, 0x5c, 0xc2, 0x0c, 0xbb, 0xc5, 0xc4, 0x59, 0xc2, 0x64, 0x78, 0xc3, 0xb3, 0xd1, 0x9c, + 0x99, 0xdf, 0x52, 0xed, 0x05, 0x7e, 0x0d, 0xe7, 0x8d, 0x5e, 0xd7, 0x84, 0x2b, 0x22, 0xab, 0xa8, + 0x34, 0x16, 0xc5, 0xdc, 0xe7, 0xfd, 0xe3, 0x77, 0xd1, 0x67, 0x1b, 0xb3, 0xaf, 0x36, 0x66, 0xdf, + 0x6d, 0xcc, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x03, 0xc8, 0x41, 0xb3, 0x01, 0x00, 0x00, } func (m *Delta) Marshal() (dAtA []byte, err error) { @@ -311,14 +296,6 @@ func (m *Identify) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - i-- - if m.More { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 if m.SignedPeerRecord != nil { i -= len(m.SignedPeerRecord) copy(dAtA[i:], m.SignedPeerRecord) @@ -464,7 +441,6 @@ func (m *Identify) Size() (n int) { l = len(m.SignedPeerRecord) n += 1 + l + sovIdentify(uint64(l)) } - n += 2 if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -892,26 +868,6 @@ func (m *Identify) Unmarshal(dAtA []byte) error { m.SignedPeerRecord = []byte{} } iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIdentify - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.More = bool(v != 0) default: iNdEx = preIndex skippy, err := skipIdentify(dAtA[iNdEx:]) diff --git a/p2p/protocol/identify/pb/identify.proto b/p2p/protocol/identify/pb/identify.proto index f81d7a0e93..afc85253f6 100644 --- a/p2p/protocol/identify/pb/identify.proto +++ b/p2p/protocol/identify/pb/identify.proto @@ -2,8 +2,6 @@ syntax = "proto2"; package identify.pb; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - message Delta { // new protocols now serviced by the peer. repeated string added_protocols = 1; @@ -39,11 +37,6 @@ message Identify { // a delta update is incompatible with everything else. If this field is included, none of the others can appear. optional Delta delta = 7; - // more is set to true by a peer to indicate to the receiver that the signed record is absent in the current message - // and the peer should read the next message from the stream to fetch it. - // This is done because messages with signed records can exceed the legacy message size of 2K bytes. - optional bool more = 9 [(gogoproto.nullable) = false]; - // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers.