From 0aab3e238bb903547e580793d8eca8740909cd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rich=CE=9Brd?= Date: Tue, 3 Aug 2021 16:40:22 -0400 Subject: [PATCH] chore: bump go-waku (#2292) --- go.mod | 4 +- go.sum | 27 +---- .../go-waku/waku/v2/node/wakunode2.go | 6 +- .../go-waku/waku/v2/node/wakuoptions.go | 3 +- .../waku/v2/protocol/filter/waku_filter.go | 2 +- .../v2/protocol/lightpush/waku_lightpush.go | 7 +- .../waku/v2/protocol/pb/waku_store.pb.go | 108 ++++++++++++------ .../waku/v2/protocol/pb/waku_store.proto | 10 +- .../waku/v2/protocol/relay/waku_relay.go | 7 +- .../waku/v2/protocol/store/waku_store.go | 31 ++--- .../go-waku/waku/v2/protocol/utils.go | 15 +++ .../status-im/go-waku/waku/v2/utils/time.go | 7 ++ .../status-im/go-wakurelay-pubsub/pubsub.go | 38 +++++- .../go-wakurelay-pubsub/wakurelaysub.go | 32 +++++- vendor/modules.txt | 4 +- wakuv2/api.go | 3 +- 16 files changed, 206 insertions(+), 98 deletions(-) create mode 100644 vendor/github.com/status-im/go-waku/waku/v2/protocol/utils.go create mode 100644 vendor/github.com/status-im/go-waku/waku/v2/utils/time.go diff --git a/go.mod b/go.mod index 325c4c0eb..4d7808942 100644 --- a/go.mod +++ b/go.mod @@ -46,8 +46,8 @@ require ( github.com/russolsen/same v0.0.0-20160222130632-f089df61f51d // indirect github.com/russolsen/transit v0.0.0-20180705123435-0794b4c4505a github.com/status-im/doubleratchet v3.0.0+incompatible - github.com/status-im/go-waku v0.0.0-20210711181138-a2ff7f3df962 - github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210711180556-9afd35dadd3f + github.com/status-im/go-waku v0.0.0-20210729163508-c9d3334f2d0e + github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a github.com/status-im/markdown v0.0.0-20201022101546-c0cbdd5763bf github.com/status-im/migrate/v4 v4.6.2-status.2 github.com/status-im/rendezvous v1.3.2 diff --git a/go.sum b/go.sum index 9604632bb..79f3f1cae 100644 --- a/go.sum +++ b/go.sum @@ -329,7 +329,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= @@ -476,7 +475,6 @@ github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqg github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8= github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= @@ -487,7 +485,6 @@ github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBR github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ds-sql v0.2.0 h1:ZUHUbU5IydNuBWzcRMOZYkBUwTg+L56o23fEVcbWC7o= github.com/ipfs/go-ds-sql v0.2.0/go.mod h1:/c47NpRiHobwn+8F8EpW0yBy8d3Mx/j/tIlrVN1e1Ec= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= @@ -784,7 +781,6 @@ github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mat/besticon v0.0.0-20210314201728-1579f269edb7 h1:nxEXqXZcqWABJ8BudZJwrkdfKqCsSsGeo5IPQCbDKTw= @@ -839,7 +835,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -968,7 +963,6 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= @@ -996,7 +990,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= @@ -1017,7 +1010,6 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -1089,25 +1081,19 @@ github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/status-im/doubleratchet v3.0.0+incompatible h1:aJ1ejcSERpSzmWZBgtfYtiU2nF0Q8ZkGyuEPYETXkCY= @@ -1116,10 +1102,10 @@ github.com/status-im/go-ethereum v1.10.4-status.2 h1:uvcD2U7skYqPQviARFb4w3wZyFS github.com/status-im/go-ethereum v1.10.4-status.2/go.mod h1:GvIhpdCOgMHI6i5xVPEZOrv/qSMeOFHbZh77AoyZUoE= github.com/status-im/go-multiaddr-ethv4 v1.2.0 h1:OT84UsUzTCwguqCpJqkrCMiL4VZ1SvUtH9a5MsZupBk= github.com/status-im/go-multiaddr-ethv4 v1.2.0/go.mod h1:2VQ3C+9zEurcceasz12gPAtmEzCeyLUGPeKLSXYQKHo= -github.com/status-im/go-waku v0.0.0-20210711181138-a2ff7f3df962 h1:z1v+E3hRUajYxUcOVu60DOlNCcSmD0HKQQTIUdKeLos= -github.com/status-im/go-waku v0.0.0-20210711181138-a2ff7f3df962/go.mod h1:5FwivzCf7JsJDiAEfJ4KMukZLzoIWkxaQkUKrDbw/LI= -github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210711180556-9afd35dadd3f h1:/KXMnxtAe0ZrbErvgZPkKilpLCmd7g1CIKQ4x17Al5I= -github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210711180556-9afd35dadd3f/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE= +github.com/status-im/go-waku v0.0.0-20210729163508-c9d3334f2d0e h1:WlCBk7mwXa8tVIOQedx0whIXk9xT4lIKv3UWWABGWpI= +github.com/status-im/go-waku v0.0.0-20210729163508-c9d3334f2d0e/go.mod h1:plJBn9iDLcklnq2KKf/bBeuRNsKck8QMdr3yoJnh3hM= +github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a h1:eCna/q/PuZVqtmOMBqytw9yzZwMNKpao4au0OJDvesI= +github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E= github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= @@ -1219,7 +1205,6 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= @@ -1297,7 +1282,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= @@ -1602,7 +1586,6 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1627,7 +1610,6 @@ google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= @@ -1659,7 +1641,6 @@ gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+a gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= diff --git a/vendor/github.com/status-im/go-waku/waku/v2/node/wakunode2.go b/vendor/github.com/status-im/go-waku/waku/v2/node/wakunode2.go index 31564f7f9..3572cbe7f 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/node/wakunode2.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/node/wakunode2.go @@ -377,7 +377,6 @@ func (w *WakuNode) startStore() { w.opts.store.Start(w.ctx, w.host, peerChan) w.peerListeners = append(w.peerListeners, peerChan) w.opts.store.Resume(string(relay.GetTopic(nil)), nil) - } func (w *WakuNode) AddStorePeer(address string) (*peer.ID, error) { @@ -627,7 +626,7 @@ func (node *WakuNode) UnsubscribeFilter(ctx context.Context, request pb.FilterRe } for _, rId := range idsToRemove { - for id, _ := range node.filters { + for id := range node.filters { if id == rId { delete(node.filters, id) break @@ -694,8 +693,7 @@ func (w *WakuNode) DialPeer(address string) error { return err } - w.host.Connect(w.ctx, *info) - return nil + return w.host.Connect(w.ctx, *info) } func (w *WakuNode) ClosePeerByAddress(address string) error { diff --git a/vendor/github.com/status-im/go-waku/waku/v2/node/wakuoptions.go b/vendor/github.com/status-im/go-waku/waku/v2/node/wakuoptions.go index 9585d15d4..2ff140211 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/node/wakuoptions.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/node/wakuoptions.go @@ -10,7 +10,6 @@ import ( "github.com/libp2p/go-libp2p-core/crypto" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr-net" - "github.com/status-im/go-waku/waku/v2/protocol/filter" "github.com/status-im/go-waku/waku/v2/protocol/store" wakurelay "github.com/status-im/go-wakurelay-pubsub" ) @@ -30,7 +29,7 @@ type WakuNodeParameters struct { enableStore bool storeMsgs bool store *store.WakuStore - filter *filter.WakuFilter + // filter *filter.WakuFilter keepAliveInterval time.Duration diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/filter/waku_filter.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/filter/waku_filter.go index 85af5c384..95c6481a8 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/filter/waku_filter.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/filter/waku_filter.go @@ -199,7 +199,7 @@ func NewWakuFilter(ctx context.Context, host host.Host, handler MessagePushHandl wf.pushHandler = handler wf.peerChan = peerChan - wf.h.SetStreamHandler(WakuFilterProtocolId, wf.onRequest) + wf.h.SetStreamHandlerMatch(WakuFilterProtocolId, protocol.PrefixTextMatch(WakuFilterCodec), wf.onRequest) go wf.FilterListener() go wf.peerListener() diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/lightpush/waku_lightpush.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/lightpush/waku_lightpush.go index 9b97699d2..83d1719a5 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/lightpush/waku_lightpush.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/lightpush/waku_lightpush.go @@ -20,7 +20,8 @@ import ( var log = logging.Logger("waku_lightpush") -const WakuLightPushProtocolId = libp2pProtocol.ID("/vac/waku/lightpush/2.0.0-beta1") +const WakuLightPushCodec = "/vac/waku/lightpush/2.0.0-beta1" +const WakuLightPushProtocolId = libp2pProtocol.ID(WakuLightPushCodec) var ( ErrNoPeersAvailable = errors.New("no suitable remote peers") @@ -39,7 +40,7 @@ func NewWakuLightPush(ctx context.Context, h host.Host, relay *relay.WakuRelay) wakuLP.ctx = ctx wakuLP.h = h - wakuLP.h.SetStreamHandler(WakuLightPushProtocolId, wakuLP.onRequest) + wakuLP.h.SetStreamHandlerMatch(WakuLightPushProtocolId, protocol.PrefixTextMatch(WakuLightPushCodec), wakuLP.onRequest) log.Info("Light Push protocol started") return wakuLP @@ -91,7 +92,7 @@ func (wakuLP *WakuLightPush) onRequest(s network.Stream) { err = writer.WriteMsg(responsePushRPC) if err != nil { log.Error("error writing response", err) - s.Reset() + _ = s.Reset() } else { log.Info(fmt.Sprintf("%s: response sent to %s", s.Conn().LocalPeer().String(), s.Conn().RemotePeer().String())) } diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.pb.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.pb.go index b1f1389f8..ad6809ddd 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.pb.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.pb.go @@ -45,6 +45,31 @@ func (PagingInfo_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor_ca6891f77a46e680, []int{1, 0} } +type HistoryResponse_Error int32 + +const ( + HistoryResponse_NONE HistoryResponse_Error = 0 + HistoryResponse_INVALID_CURSOR HistoryResponse_Error = 1 +) + +var HistoryResponse_Error_name = map[int32]string{ + 0: "NONE", + 1: "INVALID_CURSOR", +} + +var HistoryResponse_Error_value = map[string]int32{ + "NONE": 0, + "INVALID_CURSOR": 1, +} + +func (x HistoryResponse_Error) String() string { + return proto.EnumName(HistoryResponse_Error_name, int32(x)) +} + +func (HistoryResponse_Error) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_ca6891f77a46e680, []int{4, 0} +} + type Index struct { Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` ReceiverTime float64 `protobuf:"fixed64,2,opt,name=receiverTime,proto3" json:"receiverTime,omitempty"` @@ -266,11 +291,13 @@ func (m *HistoryQuery) GetEndTime() float64 { } type HistoryResponse struct { - Messages []*WakuMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=pagingInfo,proto3" json:"pagingInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // the first field is reserved for future use + Messages []*WakuMessage `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,3,opt,name=pagingInfo,proto3" json:"pagingInfo,omitempty"` + Error HistoryResponse_Error `protobuf:"varint,4,opt,name=error,proto3,enum=pb.HistoryResponse_Error" json:"error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HistoryResponse) Reset() { *m = HistoryResponse{} } @@ -312,6 +339,13 @@ func (m *HistoryResponse) GetPagingInfo() *PagingInfo { return nil } +func (m *HistoryResponse) GetError() HistoryResponse_Error { + if m != nil { + return m.Error + } + return HistoryResponse_NONE +} + type HistoryRPC struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Query *HistoryQuery `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` @@ -369,6 +403,7 @@ func (m *HistoryRPC) GetResponse() *HistoryResponse { func init() { proto.RegisterEnum("pb.PagingInfo_Direction", PagingInfo_Direction_name, PagingInfo_Direction_value) + proto.RegisterEnum("pb.HistoryResponse_Error", HistoryResponse_Error_name, HistoryResponse_Error_value) proto.RegisterType((*Index)(nil), "pb.Index") proto.RegisterType((*PagingInfo)(nil), "pb.PagingInfo") proto.RegisterType((*ContentFilter)(nil), "pb.ContentFilter") @@ -382,34 +417,37 @@ func init() { } var fileDescriptor_ca6891f77a46e680 = []byte{ - // 457 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x6b, 0x13, 0x41, - 0x14, 0x75, 0x92, 0x26, 0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- 0xf1, 0x1f, 0x06, 0xb0, 0x11, 0x3c, 0x5f, 0xe2, 0x0b, 0x00, 0x4d, 0xb7, 0x35, 0x19, 0x7b, 0x25, - 0x0a, 0x1f, 0x7b, 0xe0, 0x91, 0x55, 0x81, 0x47, 0x30, 0xb8, 0x6d, 0xb2, 0xf6, 0x17, 0x4f, 0x9b, - 0x8b, 0xbb, 0x3b, 0xe0, 0xeb, 0x36, 0xbe, 0x81, 0x91, 0xf6, 0xf6, 0xdd, 0x7b, 0x09, 0x17, 0x4f, - 0x3b, 0xd4, 0xcd, 0x64, 0xbc, 0x25, 0x65, 0x43, 0xf7, 0x37, 0x8e, 0xff, 0x07, 0x00, 0x00, 0xff, - 0xff, 0x03, 0x43, 0x7e, 0x9e, 0x47, 0x03, 0x00, 0x00, + // 509 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x6f, 0x6b, 0x13, 0x41, + 0x10, 0xc6, 0xbb, 0xf9, 0xd7, 0xdc, 0x24, 0xa6, 0x71, 0x04, 0x39, 0x8b, 0x4a, 0x3c, 0xb0, 0x04, + 0x84, 0x2b, 0xa4, 0x20, 0xf8, 0x32, 0x26, 0x2d, 0x06, 0x35, 0xa9, 0xdb, 0x6a, 0x5f, 0x86, 0xcb, + 0xdd, 0x18, 0x96, 0xda, 0xdb, 0xeb, 0xee, 0x9e, 0x5a, 0x5f, 0xfb, 0x6d, 0xfc, 0x1e, 0x7e, 0x01, + 0xbf, 0x90, 0xdc, 0x66, 0xf3, 0x17, 0xc1, 0x97, 0xf3, 0xcc, 0xef, 0xf2, 0x3c, 0x33, 0xb3, 0x81, + 0xf6, 0xb7, 0xe8, 0x3a, 0x9f, 0x6a, 0x23, 0x15, 0x85, 0x99, 0x92, 0x46, 0x62, 0x29, 0x9b, 0x1d, + 0xa2, 0x55, 0x6f, 0x48, 0xeb, 0x68, 0xee, 0xf4, 0x20, 0x86,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, 0x7b, 0x83, 0xed, 0x8d, 0x14, 0xf6, 0xb8, 0x7c, 0xd1, 0xc6, 0x63, 0xa8, 0x2b, + 0x97, 0xca, 0xcd, 0xf6, 0xe0, 0x1f, 0x81, 0xf9, 0x0a, 0x9a, 0xd5, 0xec, 0x9f, 0xee, 0xe4, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0xcf, 0xa2, 0x96, 0xa0, 0x03, 0x00, 0x00, } diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.proto b/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.proto index e717091a1..7e4c879d3 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.proto +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/pb/waku_store.proto @@ -33,8 +33,14 @@ message HistoryQuery { } message HistoryResponse { - repeated WakuMessage messages = 1; - PagingInfo pagingInfo = 2; // used for pagination + // the first field is reserved for future use + repeated WakuMessage messages = 2; + PagingInfo pagingInfo = 3; + enum Error { + NONE = 0; + INVALID_CURSOR = 1; + } + Error error = 4; } message HistoryRPC { diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/relay/waku_relay.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/relay/waku_relay.go index 5a8fa05a4..fa2a684f3 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/relay/waku_relay.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/relay/waku_relay.go @@ -9,6 +9,7 @@ import ( logging "github.com/ipfs/go-log" "github.com/libp2p/go-libp2p-core/host" + "github.com/status-im/go-waku/waku/v2/protocol" "github.com/status-im/go-waku/waku/v2/protocol/pb" wakurelay "github.com/status-im/go-wakurelay-pubsub" ) @@ -36,7 +37,7 @@ func NewWakuRelay(ctx context.Context, h host.Host, opts ...wakurelay.Option) (* w.wakuRelayTopics = make(map[Topic]*wakurelay.Topic) w.relaySubs = make(map[Topic]*wakurelay.Subscription) - ps, err := wakurelay.NewWakuRelaySub(ctx, h, opts...) + ps, err := wakurelay.NewWakuRelaySubWithMatcherFunc(ctx, h, protocol.PrefixTextMatch, opts...) if err != nil { return nil, err } @@ -56,7 +57,7 @@ func (w *WakuRelay) Topics() []Topic { w.topicsMutex.Lock() var result []Topic - for topic, _ := range w.topics { + for topic := range w.topics { result = append(result, topic) } return result @@ -109,7 +110,7 @@ func (w *WakuRelay) Publish(ctx context.Context, message *pb.WakuMessage, topic // Publish a `WakuMessage` to a PubSub topic. if w.pubsub == nil { - return nil, errors.New("PubSub hasn't been set.") + return nil, errors.New("PubSub hasn't been set") } if message == nil { diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/store/waku_store.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/store/waku_store.go index 16e5f50a3..bf60ae1db 100644 --- a/vendor/github.com/status-im/go-waku/waku/v2/protocol/store/waku_store.go +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/store/waku_store.go @@ -30,9 +30,9 @@ import ( var log = logging.Logger("wakustore") -const WakuStoreProtocolId = libp2pProtocol.ID("/vac/waku/store/2.0.0-beta3") +const WakuStoreCodec = "/vac/waku/store/2.0.0-beta3" +const WakuStoreProtocolId = libp2pProtocol.ID(WakuStoreCodec) const MaxPageSize = 100 // Maximum number of waku messages in each page -const DefaultContentTopic = "/waku/2/default-content/proto" var ( ErrNoPeersAvailable = errors.New("no suitable remote peers") @@ -185,7 +185,7 @@ func (w *WakuStore) FindMessages(query *pb.HistoryQuery) *pb.HistoryResponse { type StoredMessage struct { ID []byte PubsubTopic string - ReceiverTime int64 + ReceiverTime float64 Message *pb.WakuMessage } @@ -202,10 +202,10 @@ type IndexedWakuMessage struct { } type WakuStore struct { - ctx context.Context - MsgC chan *protocol.Envelope - messages []IndexedWakuMessage - messageSet map[[32]byte]struct{} + ctx context.Context + MsgC chan *protocol.Envelope + messages []IndexedWakuMessage + seen map[[32]byte]struct{} messagesMutex sync.Mutex @@ -221,6 +221,7 @@ func NewWakuStore(shouldStoreMessages bool, p MessageProvider) *WakuStore { wakuStore.MsgC = make(chan *protocol.Envelope) wakuStore.msgProvider = p wakuStore.storeMsgs = shouldStoreMessages + wakuStore.seen = make(map[[32]byte]struct{}) return wakuStore } @@ -247,7 +248,7 @@ func (store *WakuStore) Start(ctx context.Context, h host.Host, peerChan chan *e return } - store.h.SetStreamHandler(WakuStoreProtocolId, store.onRequest) + store.h.SetStreamHandlerMatch(WakuStoreProtocolId, protocol.PrefixTextMatch(WakuStoreCodec), store.onRequest) go store.storeIncomingMessages(ctx) @@ -258,7 +259,7 @@ func (store *WakuStore) Start(ctx context.Context, h host.Host, peerChan chan *e storedMessages, err := store.msgProvider.GetAll() if err != nil { - log.Error("could not load DBProvider messages") + log.Error("could not load DBProvider messages", err) stats.RecordWithTags(ctx, []tag.Mutator{tag.Insert(metrics.KeyStoreErrorType, "store_load_failure")}, metrics.Errors.M(1)) return } @@ -283,11 +284,11 @@ func (store *WakuStore) storeMessageWithIndex(pubsubTopic string, idx *pb.Index, var k [32]byte copy(k[:], idx.Digest) - if _, ok := store.messageSet[k]; ok { + if _, ok := store.seen[k]; ok { return } - store.messageSet[k] = struct{}{} + store.seen[k] = struct{}{} store.messages = append(store.messages, IndexedWakuMessage{msg: msg, index: idx, pubsubTopic: pubsubTopic}) } @@ -348,7 +349,7 @@ func (store *WakuStore) onRequest(s network.Stream) { err = writer.WriteMsg(historyResponseRPC) if err != nil { log.Error("error writing response", err) - s.Reset() + _ = s.Reset() } else { log.Info(fmt.Sprintf("%s: Response sent to %s", s.Conn().LocalPeer().String(), s.Conn().RemotePeer().String())) } @@ -362,7 +363,7 @@ func computeIndex(msg *pb.WakuMessage) (*pb.Index, error) { digest := sha256.Sum256(data) return &pb.Index{ Digest: digest[:], - ReceiverTime: float64(time.Now().UnixNano()), + ReceiverTime: utils.GetUnixEpoch(), SenderTime: msg.Timestamp, }, nil } @@ -477,7 +478,9 @@ func (store *WakuStore) queryFrom(ctx context.Context, q *pb.HistoryQuery, selec } defer connOpt.Close() - defer connOpt.Reset() + defer func() { + _ = connOpt.Reset() + }() historyRequest := &pb.HistoryRPC{Query: q, RequestId: hex.EncodeToString(requestId)} diff --git a/vendor/github.com/status-im/go-waku/waku/v2/protocol/utils.go b/vendor/github.com/status-im/go-waku/waku/v2/protocol/utils.go new file mode 100644 index 000000000..8f5382751 --- /dev/null +++ b/vendor/github.com/status-im/go-waku/waku/v2/protocol/utils.go @@ -0,0 +1,15 @@ +package protocol + +import "strings" + +func FulltextMatch(expectedProtocol string) func(string) bool { + return func(receivedProtocol string) bool { + return receivedProtocol == expectedProtocol + } +} + +func PrefixTextMatch(prefix string) func(string) bool { + return func(receivedProtocol string) bool { + return strings.HasPrefix(receivedProtocol, prefix) + } +} diff --git a/vendor/github.com/status-im/go-waku/waku/v2/utils/time.go b/vendor/github.com/status-im/go-waku/waku/v2/utils/time.go new file mode 100644 index 000000000..2d7b0aba1 --- /dev/null +++ b/vendor/github.com/status-im/go-waku/waku/v2/utils/time.go @@ -0,0 +1,7 @@ +package utils + +import "time" + +func GetUnixEpoch() float64 { + return float64(time.Now().UnixNano()) / float64(time.Second) +} diff --git a/vendor/github.com/status-im/go-wakurelay-pubsub/pubsub.go b/vendor/github.com/status-im/go-wakurelay-pubsub/pubsub.go index 666c3369e..3ad8db242 100644 --- a/vendor/github.com/status-im/go-wakurelay-pubsub/pubsub.go +++ b/vendor/github.com/status-im/go-wakurelay-pubsub/pubsub.go @@ -221,8 +221,7 @@ type RPC struct { type Option func(*PubSub) error -// NewPubSub returns a new PubSub management object. -func NewPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option) (*PubSub, error) { +func createPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option) (*PubSub, error) { ps := &PubSub{ host: h, ctx: ctx, @@ -286,6 +285,16 @@ func NewPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option return nil, err } + return ps, nil +} + +// NewPubSub returns a new PubSub management object. +func NewPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option) (*PubSub, error) { + ps, err := createPubSub(ctx, h, rt, opts...) + if err != nil { + return nil, err + } + rt.Attach(ps) for _, id := range rt.Protocols() { @@ -302,6 +311,31 @@ func NewPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option return ps, nil } +type MatchFunction func(string) func(string) bool + +// NewPubSubWithMatcherFunc returns a new PubSub management object, using a matcher function for the protocol id +func NewPubSubWithMatcherFunc(ctx context.Context, h host.Host, rt PubSubRouter, match MatchFunction, opts ...Option) (*PubSub, error) { + ps, err := createPubSub(ctx, h, rt, opts...) + if err != nil { + return nil, err + } + + rt.Attach(ps) + + for _, id := range rt.Protocols() { + h.SetStreamHandlerMatch(id, match(string(id)), ps.handleNewStream) + } + h.Network().Notify((*PubSubNotif)(ps)) + + ps.val.Start(ps) + + go ps.processLoop(ctx) + + (*PubSubNotif)(ps).Initialize() + + return ps, nil +} + // MsgIdFunction returns a unique ID for the passed Message, and PubSub can be customized to use any // implementation of this function by configuring it with the Option from WithMessageIdFn. type MsgIdFunction func(pmsg *pb.Message) string diff --git a/vendor/github.com/status-im/go-wakurelay-pubsub/wakurelaysub.go b/vendor/github.com/status-im/go-wakurelay-pubsub/wakurelaysub.go index 764cd20a3..9d7eb7824 100644 --- a/vendor/github.com/status-im/go-wakurelay-pubsub/wakurelaysub.go +++ b/vendor/github.com/status-im/go-wakurelay-pubsub/wakurelaysub.go @@ -175,10 +175,7 @@ func msgIdFn(pmsg *pb.Message) string { return string(hash[:]) } -// NewWakuRelaySub returns a new PubSub object using WakuRelaySubRouter as the router. -// It has the folowing options set as default: WithMessageSignaturePolicy(StrictNoSign), -// WithNoAuthor, and WithMessageIdFn that hashes the message content -func NewWakuRelaySub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, error) { +func createWakuRelaySub(ctx context.Context, h host.Host) *WakuRelaySubRouter { rt := &WakuRelaySubRouter{ peers: make(map[peer.ID]protocol.ID), mesh: make(map[string]map[peer.ID]struct{}), @@ -210,6 +207,15 @@ func NewWakuRelaySub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, tagTracer: newTagTracer(h.ConnManager()), } + return rt +} + +// NewWakuRelaySub returns a new PubSub object using WakuRelaySubRouter as the router. +// It has the folowing options set as default: WithMessageSignaturePolicy(StrictNoSign), +// WithNoAuthor, and WithMessageIdFn that hashes the message content +func NewWakuRelaySub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, error) { + rt := createWakuRelaySub(ctx, h) + // use the withInternalTracer option to hook up the tag tracer opts = append(opts, withInternalTracer(rt.tagTracer)) @@ -221,6 +227,24 @@ func NewWakuRelaySub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, return NewPubSub(ctx, h, rt, opts...) } +// NewWakuRelaySubWithMatcherFunc returns a new PubSub object using WakuRelaySubRouter as the router. +// It has the folowing options set as default: WithMessageSignaturePolicy(StrictNoSign), +// WithNoAuthor, and WithMessageIdFn that hashes the message content +// Allows setting a function for protocol id matching +func NewWakuRelaySubWithMatcherFunc(ctx context.Context, h host.Host, match MatchFunction, opts ...Option) (*PubSub, error) { + rt := createWakuRelaySub(ctx, h) + + // use the withInternalTracer option to hook up the tag tracer + opts = append(opts, withInternalTracer(rt.tagTracer)) + + // default options required by WakuRelay + opts = append(opts, WithMessageSignaturePolicy(StrictNoSign)) + opts = append(opts, WithNoAuthor()) + opts = append(opts, WithMessageIdFn(msgIdFn)) + + return NewPubSubWithMatcherFunc(ctx, h, rt, match, opts...) +} + // WithPeerScore is a gossipsub router option that enables peer scoring. func WithPeerScore(params *PeerScoreParams, thresholds *PeerScoreThresholds) Option { return func(ps *PubSub) error { diff --git a/vendor/modules.txt b/vendor/modules.txt index 8b4dd66df..72baadbcc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -426,7 +426,7 @@ github.com/spacemonkeygo/spacelog github.com/status-im/doubleratchet # github.com/status-im/go-multiaddr-ethv4 v1.2.0 github.com/status-im/go-multiaddr-ethv4 -# github.com/status-im/go-waku v0.0.0-20210711181138-a2ff7f3df962 +# github.com/status-im/go-waku v0.0.0-20210729163508-c9d3334f2d0e github.com/status-im/go-waku/waku/v2/metrics github.com/status-im/go-waku/waku/v2/node github.com/status-im/go-waku/waku/v2/protocol @@ -436,7 +436,7 @@ github.com/status-im/go-waku/waku/v2/protocol/pb github.com/status-im/go-waku/waku/v2/protocol/relay github.com/status-im/go-waku/waku/v2/protocol/store github.com/status-im/go-waku/waku/v2/utils -# github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210711180556-9afd35dadd3f +# github.com/status-im/go-wakurelay-pubsub v0.4.3-0.20210729162817-adc68830282a github.com/status-im/go-wakurelay-pubsub github.com/status-im/go-wakurelay-pubsub/pb # github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 diff --git a/wakuv2/api.go b/wakuv2/api.go index c3f81a475..1f2220690 100644 --- a/wakuv2/api.go +++ b/wakuv2/api.go @@ -28,6 +28,7 @@ import ( "github.com/status-im/go-waku/waku/v2/node" "github.com/status-im/go-waku/waku/v2/protocol/pb" + "github.com/status-im/go-waku/waku/v2/utils" "github.com/status-im/status-go/wakuv2/common" @@ -247,7 +248,7 @@ func (api *PublicWakuAPI) Post(ctx context.Context, req NewMessage) (hexutil.Byt Payload: payload, Version: version, ContentTopic: req.Topic.String(), - Timestamp: float64(api.w.CurrentTime().UnixNano()) / 1000000000, + Timestamp: utils.GetUnixEpoch(), } hash, err := api.w.Send(wakuMsg)