diff --git a/build/Dockerfile.client b/build/Dockerfile.client
index 0e80bdb70..dfd5ee50a 100644
--- a/build/Dockerfile.client
+++ b/build/Dockerfile.client
@@ -1,4 +1,4 @@
-ARG GOLANG_IMAGE_VERSION=golang:1.18.3-alpine3.16
+ARG GOLANG_IMAGE_VERSION=golang:1.19-alpine3.16
FROM ${GOLANG_IMAGE_VERSION} AS builder
diff --git a/build/Dockerfile.localdev b/build/Dockerfile.localdev
index c7c64dbe2..7595f8240 100644
--- a/build/Dockerfile.localdev
+++ b/build/Dockerfile.localdev
@@ -1,4 +1,4 @@
-ARG GOLANG_IMAGE_VERSION=golang:1.18.3-alpine3.16
+ARG GOLANG_IMAGE_VERSION=golang:1.19-alpine3.16
FROM ${GOLANG_IMAGE_VERSION} AS builder
diff --git a/build/docs/CHANGELOG.md b/build/docs/CHANGELOG.md
index 430602cba..11352afd8 100644
--- a/build/docs/CHANGELOG.md
+++ b/build/docs/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [0.0.0.41] - 2023-05-08
+
+- Updated Dockerfiles using outdated go version to 1.19
+
## [0.0.0.40] - 2023-05-04
- Added `network_id` parameter to the node config files
diff --git a/go.mod b/go.mod
index 4dd8e56e2..b573fbff3 100644
--- a/go.mod
+++ b/go.mod
@@ -6,9 +6,9 @@ require (
github.com/ProtonMail/go-ecvrf v0.0.1
github.com/golang/mock v1.6.0
github.com/ory/dockertest v3.3.5+incompatible
- github.com/stretchr/testify v1.8.1
- golang.org/x/crypto v0.5.0
- golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
+ github.com/stretchr/testify v1.8.2
+ golang.org/x/crypto v0.6.0
+ golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
gonum.org/v1/gonum v0.12.0
google.golang.org/protobuf v1.30.0
)
@@ -25,7 +25,9 @@ require (
github.com/jordanorelli/lexnum v0.0.0-20141216151731-460eeb125754
github.com/korovkin/limiter v0.0.0-20230307205149-3d4b2b34c99d
github.com/labstack/echo/v4 v4.9.1
- github.com/libp2p/go-libp2p v0.25.1
+ github.com/libp2p/go-libp2p v0.26.3
+ github.com/libp2p/go-libp2p-kad-dht v0.23.0
+ github.com/libp2p/go-libp2p-pubsub v0.9.3
github.com/looplab/fsm v1.0.1
github.com/manifoldco/promptui v0.9.0
github.com/mitchellh/mapstructure v1.5.0
@@ -67,7 +69,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0
github.com/sirupsen/logrus v1.9.0 // indirect
- go.opencensus.io v0.23.0 // indirect
+ go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.7.0 // indirect
gotest.tools v2.2.0+incompatible // indirect
)
@@ -87,6 +89,7 @@ require (
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-logr/logr v1.2.3 // indirect
+ github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
@@ -109,23 +112,32 @@ require (
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
+ github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
- github.com/ipfs/go-cid v0.3.2 // indirect
+ github.com/ipfs/boxo v0.8.0 // indirect
+ github.com/ipfs/go-cid v0.4.0 // indirect
+ github.com/ipfs/go-datastore v0.6.0 // indirect
+ github.com/ipfs/go-ipfs-util v0.0.2 // indirect
+ github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
+ github.com/ipld/go-ipld-prime v0.20.0 // indirect
github.com/jackc/puddle/v2 v2.1.2 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
+ github.com/jbenet/goprocess v0.1.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/cpuid/v2 v2.2.1 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect
github.com/lib/pq v1.10.2 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
+ github.com/libp2p/go-libp2p-kbucket v0.5.0 // indirect
+ github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
@@ -146,33 +158,36 @@ require (
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
- github.com/multiformats/go-multicodec v0.7.0 // indirect
+ github.com/multiformats/go-multicodec v0.8.1 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-multistream v0.4.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.5.1 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
+ github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
+ github.com/polydawn/refmt v0.89.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
- github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
- github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
- github.com/quic-go/qtls-go1-20 v0.1.0 // indirect
- github.com/quic-go/quic-go v0.32.0 // indirect
- github.com/quic-go/webtransport-go v0.5.1 // indirect
+ github.com/quic-go/qtls-go1-19 v0.2.1 // indirect
+ github.com/quic-go/qtls-go1-20 v0.1.1 // indirect
+ github.com/quic-go/quic-go v0.33.0 // indirect
+ github.com/quic-go/webtransport-go v0.5.2 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
- github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
+ github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
+ go.opentelemetry.io/otel v1.14.0 // indirect
+ go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/dig v1.15.0 // indirect
go.uber.org/fx v1.18.2 // indirect
go.uber.org/zap v1.24.0 // indirect
- golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
+ golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -209,7 +224,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
- github.com/mattn/go-isatty v0.0.16 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
@@ -222,7 +237,7 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/mod v0.7.0 // indirect
- golang.org/x/sys v0.5.0 // indirect
+ golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
golang.org/x/tools v0.3.0 // indirect
diff --git a/go.sum b/go.sum
index 3dfff7ed6..08fa9551d 100644
--- a/go.sum
+++ b/go.sum
@@ -186,7 +186,7 @@ github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtV
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
-github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
+github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
@@ -211,8 +211,11 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -232,6 +235,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
+github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
@@ -344,11 +348,11 @@ github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE0
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
-github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
-github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
@@ -387,6 +391,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
+github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4=
+github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/vault/api v1.9.0 h1:ab7dI6W8DuCY7yCU8blo0UCYl2oHre/dloCmzMWg9w8=
@@ -404,12 +410,23 @@ github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7P
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc=
github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
-github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc=
-github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw=
+github.com/ipfs/boxo v0.8.0 h1:UdjAJmHzQHo/j3g3b1bAcAXCj/GM6iTwvSlBDvPBNBs=
+github.com/ipfs/boxo v0.8.0/go.mod h1:RIsi4CnTyQ7AUsNn5gXljJYZlQrHBMnJp94p73liFiA=
+github.com/ipfs/go-cid v0.4.0 h1:a4pdZq0sx6ZSxbCizebnKiMCx/xI/aBBFlB73IgH4rA=
+github.com/ipfs/go-cid v0.4.0/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
+github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk=
+github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8=
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=
+github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8=
+github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ=
+github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8=
+github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo=
+github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g=
github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY=
github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI=
+github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g=
+github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
@@ -454,8 +471,11 @@ github.com/jackc/puddle/v2 v2.1.2 h1:0f7vaaXINONKTsxYDn4otOAiJanX/BMeAtY//BXqzlg
github.com/jackc/puddle/v2 v2.1.2/go.mod h1:2lpufsF5mRHO6SuZkm0fNYxM6SWHfvyFj62KwNzgels=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
+github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk=
github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk=
+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/jordanorelli/lexnum v0.0.0-20141216151731-460eeb125754 h1:ovgRFhVUYZWz6KnWPrnV7HBxrK0ErOeyXtlVvh0Rr5k=
github.com/jordanorelli/lexnum v0.0.0-20141216151731-460eeb125754/go.mod h1:f1WdQhB98V35bULPsZUMFP9U1XWhpaHrO6myMijgMhU=
@@ -484,8 +504,8 @@ github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kE
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.2.1 h1:U33DW0aiEj633gHYw3LoDNfkDiYnE5Q8M/TKJn2f2jI=
-github.com/klauspost/cpuid/v2 v2.2.1/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
+github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=
+github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -499,7 +519,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
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/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
@@ -523,10 +543,18 @@ github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38y
github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic=
github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM=
github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro=
-github.com/libp2p/go-libp2p v0.25.1 h1:YK+YDCHpYyTvitKWVxa5PfElgIpOONU01X5UcLEwJGA=
-github.com/libp2p/go-libp2p v0.25.1/go.mod h1:xnK9/1d9+jeQCVvi/f1g12KqtVi/jP/SijtKV1hML3g=
+github.com/libp2p/go-libp2p v0.26.3 h1:6g/psubqwdaBqNNoidbRKSTBEYgaOuKBhHl8Q5tO+PM=
+github.com/libp2p/go-libp2p v0.26.3/go.mod h1:x75BN32YbwuY0Awm2Uix4d4KOz+/4piInkp4Wr3yOo8=
github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw=
github.com/libp2p/go-libp2p-asn-util v0.2.0/go.mod h1:WoaWxbHKBymSN41hWSq/lGKJEca7TNm58+gGJi2WsLI=
+github.com/libp2p/go-libp2p-kad-dht v0.23.0 h1:sxE6LxLopp79eLeV695n7+c77V/Vn4AMF28AdM/XFqM=
+github.com/libp2p/go-libp2p-kad-dht v0.23.0/go.mod h1:oO5N308VT2msnQI6qi5M61wzPmJYg7Tr9e16m5n7uDU=
+github.com/libp2p/go-libp2p-kbucket v0.5.0 h1:g/7tVm8ACHDxH29BGrpsQlnNeu+6OF1A9bno/4/U1oA=
+github.com/libp2p/go-libp2p-kbucket v0.5.0/go.mod h1:zGzGCpQd78b5BNTDGHNDLaTt9aDK/A02xeZp9QeFC4U=
+github.com/libp2p/go-libp2p-pubsub v0.9.3 h1:ihcz9oIBMaCK9kcx+yHWm3mLAFBMAUsM4ux42aikDxo=
+github.com/libp2p/go-libp2p-pubsub v0.9.3/go.mod h1:RYA7aM9jIic5VV47WXu4GkcRxRhrdElWf8xtyli+Dzc=
+github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0=
+github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk=
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0=
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
@@ -567,8 +595,9 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
-github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
@@ -606,6 +635,7 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
+github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
@@ -623,14 +653,16 @@ github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/e
github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo=
github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI=
github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8=
-github.com/multiformats/go-multicodec v0.7.0 h1:rTUjGOwjlhGHbEMbPoSUJowG1spZTVsITRANCjKTUAQ=
-github.com/multiformats/go-multicodec v0.7.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
+github.com/multiformats/go-multicodec v0.8.1 h1:ycepHwavHafh3grIbR1jIXnKCsFm0fqsfEOsJ8NtKE8=
+github.com/multiformats/go-multicodec v0.8.1/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k=
github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew=
+github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108=
github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc=
github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo=
github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q=
github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
+github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
@@ -653,6 +685,8 @@ github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc=
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
+github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
+github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
@@ -663,7 +697,6 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=
github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -673,6 +706,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pokt-network/smt v0.4.0 h1:fodLphes/EtQw+nr6Zc5giSJdnjIkM2BY6cGTOfTaqo=
github.com/pokt-network/smt v0.4.0/go.mod h1:rUeZeXkK4ifRpLhZghwa1epw855ZpzbD/2sv7q/K+q8=
+github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
+github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
@@ -707,21 +742,18 @@ github.com/quasilyte/go-ruleguard/dsl v0.3.21 h1:vNkC6fC6qMLzCOGbnIHOd5ixUGgTbp3
github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
-github.com/quic-go/qtls-go1-18 v0.2.0 h1:5ViXqBZ90wpUcZS0ge79rf029yx0dYB0McyPJwqqj7U=
-github.com/quic-go/qtls-go1-18 v0.2.0/go.mod h1:moGulGHK7o6O8lSPSZNoOwcLvJKJ85vVNc7oJFD65bc=
-github.com/quic-go/qtls-go1-19 v0.2.0 h1:Cvn2WdhyViFUHoOqK52i51k4nDX8EwIh5VJiVM4nttk=
-github.com/quic-go/qtls-go1-19 v0.2.0/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI=
-github.com/quic-go/qtls-go1-20 v0.1.0 h1:d1PK3ErFy9t7zxKsG3NXBJXZjp/kMLoIb3y/kV54oAI=
-github.com/quic-go/qtls-go1-20 v0.1.0/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM=
-github.com/quic-go/quic-go v0.32.0 h1:lY02md31s1JgPiiyfqJijpu/UX/Iun304FI3yUqX7tA=
-github.com/quic-go/quic-go v0.32.0/go.mod h1:/fCsKANhQIeD5l76c2JFU+07gVE3KaA0FP+0zMWwfwo=
-github.com/quic-go/webtransport-go v0.5.1 h1:1eVb7WDWCRoaeTtFHpFBJ6WDN1bSrPrRoW6tZgSw0Ow=
-github.com/quic-go/webtransport-go v0.5.1/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU=
+github.com/quic-go/qtls-go1-19 v0.2.1 h1:aJcKNMkH5ASEJB9FXNeZCyTEIHU1J7MmHyz1Q1TSG1A=
+github.com/quic-go/qtls-go1-19 v0.2.1/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI=
+github.com/quic-go/qtls-go1-20 v0.1.1 h1:KbChDlg82d3IHqaj2bn6GfKRj84Per2VGf5XV3wSwQk=
+github.com/quic-go/qtls-go1-20 v0.1.1/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM=
+github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0=
+github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA=
+github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk=
+github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU=
github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk=
github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
-github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
+github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
@@ -770,10 +802,12 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
-github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
+github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
+github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
+github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
@@ -813,8 +847,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
@@ -826,6 +861,7 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
+github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
@@ -835,6 +871,10 @@ github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49u
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
+github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ=
+github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw=
+github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k=
+github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -849,10 +889,15 @@ 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/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
-go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
-go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
+go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
+go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
+go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
+go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
+go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
+go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
@@ -863,11 +908,14 @@ go.uber.org/fx v1.18.2/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY=
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
+go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
@@ -894,8 +942,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
-golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
+golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
+golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -906,8 +954,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o=
-golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
+golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w=
+golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -998,8 +1046,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
-golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE=
-golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M=
+golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec=
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=
@@ -1095,8 +1143,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -1140,6 +1188,8 @@ golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+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=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
diff --git a/internal/testutil/map.go b/internal/testutil/map.go
new file mode 100644
index 000000000..55ef6617f
--- /dev/null
+++ b/internal/testutil/map.go
@@ -0,0 +1,13 @@
+package testutil
+
+func GetKeys[K comparable, V any](keyMap map[K]V) []K {
+ var (
+ idx = 0
+ keys = make([]K, len(keyMap))
+ )
+ for key := range keyMap {
+ keys[idx] = key
+ idx++
+ }
+ return keys
+}
diff --git a/p2p/CHANGELOG.md b/p2p/CHANGELOG.md
index 9f4a72ff1..723e84b14 100644
--- a/p2p/CHANGELOG.md
+++ b/p2p/CHANGELOG.md
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [0.0.0.50] - 2023-05-08
+
+- Removed unused `Transport` interface
+- Moved and renamed `raintree.RainTreeConfig` to `util.RouterConfig`
+- Renamed `protocol.DefaultTopicStr` to `protocol.BackgroundTopicStr`
+- Added `protocol.PeerDiscoveryNamespace`
+- Added kademlia peer discovery baseline test
+- Added background router (kad + gossipsub)
+- Updated P2P README
+
## [0.0.0.49] - 2023-04-28
- Extracted a couple of shared helpers (e.g. `stringLogArrayMarshaler`, `MarshalZerologArray`)
diff --git a/p2p/README.md b/p2p/README.md
index f9c595f22..8263cd563 100644
--- a/p2p/README.md
+++ b/p2p/README.md
@@ -4,6 +4,7 @@ This document is meant to be a supplement to the living specification of [1.0 Po
## Table of Contents
+- [Definitions](#definitions)
- [Interface](#interface)
- [Implementation](#implementation)
- [Code Architecture - P2P Module](#code-architecture---p2p-module)
@@ -15,21 +16,39 @@ This document is meant to be a supplement to the living specification of [1.0 Po
- [Helpers](#helpers)
- [Test Generators](#test-generators)
+## Definitions
+
+### "gossip"
+
+When used generally, shorthand for "message propogation"; **not to be confused with "gossipsub"**.
+
+### "gossipsub"
+
+A specific ["pubsub"](https://pkg.go.dev/github.com/libp2p/go-libp2p-pubsub) router implementation/protocol which uses information (referred to internally as 'gossip' by LibP2P, **distinct from our definition**) about which peers have seen which messages to facilitate "gossip" (as per our definition).
+
+### "raintree gossip"
+
+A structured "gossip" protocol (and implementation) which uses the raintree algorithm for peer selection. Used between all staked actors to optimize for "gossip" speed.
+
+### "background gossip"
+
+A "gossip" protocol (implementation TBD) which facilitates "gossip" to all P2P participants, including non-staked actors (e.g. full-nodes).
+
## Interface
This module aims to implement the interface specified in `pocket/shared/modules/p2p_module.go` using the specification above.
## Implementation
-### Code Architecture - P2P Module
+### P2P Module Architecture
```mermaid
flowchart TD
subgraph P2P["P2P Module"]
- L(Listener)
+ L(Host)
H(Handler)
B(Bus)
- NM(Network Module)
+ NM(Routers)
L --> H
H <--> NM
end
@@ -48,45 +67,162 @@ flowchart TD
class PN pocket_network
```
-### Code Architecture - Network Module
+`Routers` is where [RainTree](https://github.com/pokt-network/pocket/files/9853354/raintree.pdf) (or the simpler basic approach) is implemented. See `raintree/router.go` for the specific implementation of RainTree, but please refer to the [specifications](https://github.com/pokt-network/pocket-network-protocol/tree/main/p2p) for more details.
+
+### Raintree Router Architecture
_DISCUSS(team): If you feel this needs a diagram, please reach out to the team for additional details._
_TODO(olshansky, BenVan): Link to RainTree visualizations once it is complete._
+### Message Propagation
+
+Given `Local P2P Module` has a message that it needs to propagate:
+
+
+ - 1a.
Raintree Router
selects targets from the Pokt Peerstore
, which only includes staked actors
+ - 1b.
Background Router
selects targets from the libp2p Peerstore
, which includes all P2P participants
+ - 2. Libp2p
Host
manages opening and closing streams to targeted peers
+ - 3.
Remote P2P module
's (i.e. receiver's) handleStream
is called (having been registered via setStreamHandler()
)
+ - 4a.
handleStream
propagates message via Raintree Router
+ - 4b.
handleStream
propagates message via Background Router
+ - 5a. Repeat step 1a from
Remote P2P Module
's perspective targeting its next peers
+ - 5b. Repeat step 1b from
Remote P2P Module
's perspective targeting its next peers
+
+
+```mermaid
+flowchart TD
+ subgraph lMod[Local P2P Module]
+ subgraph lHost[Libp2p `Host`]
+ end
+ subgraph lRT[Raintree Router]
+ subgraph lRTPS[Raintree Peerstore]
+ lStakedPS([staked actors only])
+ end
+
+ subgraph lPM[PeerManager]
+ end
+ lPM --> lRTPS
+ end
+
+ subgraph lBG[Background Router]
+ subgraph lBGPS[Background Peerstore]
+ lNetPS([all P2P participants])
+ end
+
+ subgraph lGossipSub[GossipSub]
+ end
+
+ subgraph lDHT[Kademlia DHT]
+ end
+
+ lGossipSub --> lBGPS
+ lDHT --> lBGPS
+ end
+
+ lRT --1a--> lHost
+ lBG --1b--> lHost
+ end
+
+subgraph rMod[Remote P2P Module]
+subgraph rHost[Libp2p `Host`]
+end
+subgraph rRT[Raintree Router]
+subgraph rPS[Raintree Peerstore]
+rStakedPS([staked actors only])
+end
+
+subgraph rPM[PeerManager]
+end
+
+rPM --> rStakedPS
+end
+
+subgraph rBG[Background Router]
+subgraph rBGPS[Background Peerstore]
+rNetPS([all P2P participants])
+end
+
+subgraph rGossipSub[GossipSub]
+end
+
+subgraph rDHT[Kademlia DHT]
+end
+
+rGossipSub --> rBGPS
+rDHT --> rBGPS
+end
+
+rHost -. "3 (setStreamHandler())" .-> hs[[handleStream]]
+
+hs --4a--> rRT
+hs --4b--> rBG
+rBG --"5a (cont. propagation)"--> rHost
+linkStyle 11 stroke:#ff3
+rRT --"5b (cont. propagation)"--> rHost
+linkStyle 12 stroke:#ff3
+end
+
+lHost --2--> rHost
+```
+
The `Network Module` is where [RainTree](https://github.com/pokt-network/pocket/files/9853354/raintree.pdf) (or the simpler basic approach) is implemented. See `raintree/network.go` for the specific implementation of RainTree, but please refer to the [specifications](https://github.com/pokt-network/pocket-network-protocol/tree/main/p2p) for more details.
### Code Organization
```bash
p2p
-├── README.md # Self link to this README
-├── transport.go # Varying implementations of the `Transport` (e.g. TCP, Passthrough) for network communication
-├── module.go # The implementation of the P2P Interface
+├── background
+│ ├── kad_discovery_baseline_test.go # Libp2p peer discovery via kademalia baseline example
+│ ├── router.go # `BackgroundRouter` implementation of `Router` interface
+│ └── router_test.go # `BackgroundRouter` functional tests
+├── bootstrap.go # `p2pModule` bootstrap related method(s)
+├── CHANGELOG.md
+├── event_handler.go
+├── module.go # `p2pModule` definition
+├── module_raintree_test.go # `p2pModule` & `RainTreeRouter` functional tests (routing)
+├── module_test.go # `p2pModule` & `RainTreeRouter` integration tests
+├── peer_test.go # `PeerList` unit test(s)
+├── protocol
+│ └── protocol.go # Common, pokt protocol-specific constants
+├── providers
+│ ├── current_height_provider
+│ ├── peerstore_provider
+│ └── providers.go
├── raintree
-│ ├── addrbook_utils.go # AddrBook utilities
-│ ├── peers_manager.go # peersManager implementation
-│ ├── peers_manager_test.go # peersManager unit tests
-│ ├── network_test.go # network unit tests
-│ ├── network.go # Implementation of the Network interface using RainTree's specification
-│ ├── utils.go
-│ └── types
-│ └── proto
-│ └── raintree.proto
-├── raintree_integration_test.go # RainTree unit tests
-├── raintree_integration_utils_test.go # Test suite for RainTree
-├── stdnetwork # This can eventually be deprecated once raintree is verified.
-│ └── network.go # Implementation of the Network interface using Golang's std networking lib
-├── telemetry
-│ ├── metrics.go
+│ ├── nonce_deduper.go
+│ ├── nonce_deduper_test.go
+│ ├── peers_manager.go # `rainTreePeersManager` implementation of `PeersManager` interface
+│ ├── peers_manager_test.go
+│ ├── peerstore_utils.go # Raintree routing helpers
+│ ├── router.go # `RainTreeRouter` implementation of `Router` interface
+│ ├── router_test.go # `RainTreeRouter` functional tests
+│ ├── target.go # `target` definition
+│ ├── types
+│ │ └── proto
+│ │ └── raintree.proto
+│ └── utils_test.go
+├── README.md
+├── transport_encryption_test.go # Libp2p transport security integration test
├── types
-│ ├── addr_book.go # addrBook definition
-│ ├── addr_book_map.go # addrBookMap definition
-│ ├── addr_list.go # addrList definition
-│ ├── network.go # Network Interface definition
-│ ├── network_peer.go # networkPeer definition
-│ ├── proto # Proto3 messages for generated types
-│ ├── target.go # target definition
-└── utils.go
+│ ├── errors.go
+│ ├── libp2p_mocks.go
+│ ├── mocks
+│ ├── network_peer.go # `NetworkPeer` implementation of `Peer` interface
+│ ├── peer.go # `Peer` interface & `PeerList` definitions
+│ ├── peer_manager.go # `PeerManager` interface & `SortedPeerManager` implementation definitions
+│ ├── peerstore.go # `Peerstore` interface & `PeerAddrMap` implementation definitions
+│ ├── peers_view.go # `PeersView` interface & `sortedPeersView` implementation definitions
+│ ├── peers_view_test.go
+│ ├── raintree.pb.go
+│ └── router.go # `Router` interface definition
+├── utils
+│ ├── config.go # `RouterConfig` definition
+│ ├── host.go # Helpers for working with libp2p hosts
+│ ├── logging.go # Helpers for logging
+│ ├── peer_conversion.go # Helpers for converting between "native" and libp2p peer representations
+│ ├── url_conversion.go # Helpers for converting between "native" and libp2p network address representations
+│ └── url_conversion_test.go
+└── utils_test.go
```
## Testing
diff --git a/p2p/background/kad_discovery_baseline_test.go b/p2p/background/kad_discovery_baseline_test.go
new file mode 100644
index 000000000..f91611a3e
--- /dev/null
+++ b/p2p/background/kad_discovery_baseline_test.go
@@ -0,0 +1,131 @@
+package background
+
+import (
+ "context"
+ "crypto/rand"
+ "fmt"
+ "testing"
+ "time"
+
+ "github.com/libp2p/go-libp2p"
+ dht "github.com/libp2p/go-libp2p-kad-dht"
+ libp2pCrypto "github.com/libp2p/go-libp2p/core/crypto"
+ libp2pHost "github.com/libp2p/go-libp2p/core/host"
+ libp2pPeer "github.com/libp2p/go-libp2p/core/peer"
+ "github.com/multiformats/go-multiaddr"
+ "github.com/stretchr/testify/require"
+
+ "github.com/pokt-network/pocket/runtime/defaults"
+)
+
+const dhtUpdateSleepDuration = time.Millisecond * 500
+
+func TestLibp2pKademliaPeerDiscovery(t *testing.T) {
+ ctx := context.Background()
+
+ addr1, host1, _ := setupHostAndDiscovery(t, ctx, defaults.DefaultP2PPort, nil)
+
+ bootstrapAddr, err := multiaddr.NewMultiaddr(fmt.Sprintf("%s/p2p/%s", addr1, host1.ID().String()))
+ require.NoError(t, err)
+
+ addr2, host2, _ := setupHostAndDiscovery(t, ctx, defaults.DefaultP2PPort+1, bootstrapAddr)
+ addr3, host3, _ := setupHostAndDiscovery(t, ctx, defaults.DefaultP2PPort+2, bootstrapAddr)
+
+ expectedPeerIDs := []libp2pPeer.ID{host1.ID(), host2.ID(), host3.ID()}
+
+ // TECHDEBT: consider using `host.ConnManager().Notifee()` to avoid sleeping here
+ // delay assertions for 500ms
+ // NB: wait for peer discovery to complete
+ time.Sleep(dhtUpdateSleepDuration)
+
+ // assert that host2 has host3 in its peerstore
+ host2DiscoveredAddrs := host2.Peerstore().Addrs(host3.ID())
+ require.Greaterf(t, len(host2DiscoveredAddrs), 0, "did not discover host3")
+ require.Equalf(t, addr3.String(), host2DiscoveredAddrs[0].String(), "did not discover host3")
+ require.ElementsMatchf(t, expectedPeerIDs, host2.Peerstore().Peers(), "host2 peer IDs don't match")
+
+ // assert that host3 has host2 in its peerstore
+ host3DiscoveredHost2Addrs := host3.Peerstore().Addrs(host2.ID())
+ require.Greaterf(t, len(host3DiscoveredHost2Addrs), 0, "host3 did not discover host2")
+ require.Equalf(t, addr2.String(), host3DiscoveredHost2Addrs[0].String(), "host3 did not discover host2")
+ require.ElementsMatchf(t, expectedPeerIDs, host3.Peerstore().Peers(), "host3 peer IDs don't match")
+
+ // add another peer to network...
+ addr4, host4, _ := setupHostAndDiscovery(t, ctx, defaults.DefaultP2PPort+3, bootstrapAddr)
+ expectedPeerIDs = append(expectedPeerIDs, host4.ID())
+
+ // TECHDEBT: consider using `host.ConnManager().Notifee()` to avoid sleeping here
+ time.Sleep(time.Millisecond * 500)
+
+ // new host discovers existing hosts...
+ host4DiscoveredHost2Addrs := host4.Peerstore().Addrs(host2.ID())
+ require.Greaterf(t, len(host4DiscoveredHost2Addrs), 0, "host4 did not discover host2")
+ require.Equalf(t, addr2.String(), host4DiscoveredHost2Addrs[0].String(), "host4 did not discover host2")
+
+ host4DiscoveredHost3Addrs := host4.Peerstore().Addrs(host3.ID())
+ require.Greaterf(t, len(host4DiscoveredHost3Addrs), 0, "host4 did not discover host3")
+ require.Equalf(t, addr3.String(), host4DiscoveredHost3Addrs[0].String(), "host4 did not discover host3")
+
+ // existing hosts discovers host host...
+ host2DiscoveredHost4Addrs := host2.Peerstore().Addrs(host4.ID())
+ require.Greaterf(t, len(host2DiscoveredHost4Addrs), 0, "host2 did not discover host4")
+ require.Equalf(t, addr4.String(), host2DiscoveredHost4Addrs[0].String(), "host2 did not discover host4")
+
+ host3DiscoveredHost4Addrs := host3.Peerstore().Addrs(host4.ID())
+ require.Greaterf(t, len(host3DiscoveredHost4Addrs), 0, "host3 did not discover host4")
+ require.Equalf(t, addr4.String(), host3DiscoveredHost4Addrs[0].String(), "host3 did not discover host4")
+
+ require.ElementsMatchf(t, expectedPeerIDs, host4.Peerstore().Peers(), "host4 peer IDs don't match")
+}
+
+//nolint:unparam // DHT must exist but is otherwise "unused" (i.e. its API)
+func setupHostAndDiscovery(t *testing.T,
+ ctx context.Context,
+ port uint32,
+ bootstrapAddr multiaddr.Multiaddr,
+) (
+ multiaddr.Multiaddr,
+ libp2pHost.Host,
+ *dht.IpfsDHT,
+) {
+ t.Helper()
+
+ // CONSIDERATION: perhaps testing with libp2p mocknet would be sufficient
+ // listen on loopback interface
+ addr, err := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", port))
+ require.NoError(t, err)
+
+ host, err := setupHost(t, addr)
+ require.NoError(t, err)
+
+ kadDHT := setupDHT(t, ctx, host, bootstrapAddr)
+ return addr, host, kadDHT
+}
+
+func setupHost(t *testing.T, addr multiaddr.Multiaddr) (libp2pHost.Host, error) {
+ t.Helper()
+
+ privKey, _, err := libp2pCrypto.GenerateEd25519Key(rand.Reader)
+ require.NoError(t, err)
+
+ return libp2p.New(
+ libp2p.ListenAddrs(addr),
+ libp2p.Identity(privKey),
+ )
+}
+
+func setupDHT(t *testing.T, ctx context.Context, host libp2pHost.Host, bootstrapAddr multiaddr.Multiaddr) *dht.IpfsDHT {
+ t.Helper()
+
+ kadDHT, err := dht.New(ctx, host, dht.Mode(dht.ModeAutoServer))
+ require.NoError(t, err)
+
+ if bootstrapAddr != nil {
+ peerInfo, err := libp2pPeer.AddrInfoFromP2pAddr(bootstrapAddr)
+ require.NoError(t, err)
+
+ err = host.Connect(ctx, *peerInfo)
+ require.NoError(t, err)
+ }
+ return kadDHT
+}
diff --git a/p2p/background/router.go b/p2p/background/router.go
new file mode 100644
index 000000000..ac3f0286b
--- /dev/null
+++ b/p2p/background/router.go
@@ -0,0 +1,173 @@
+// TECHDEBT(olshansky): Delete this once we are fully comfortable with RainTree moving forward.
+
+package background
+
+import (
+ "context"
+ "fmt"
+
+ dht "github.com/libp2p/go-libp2p-kad-dht"
+ pubsub "github.com/libp2p/go-libp2p-pubsub"
+ libp2pHost "github.com/libp2p/go-libp2p/core/host"
+
+ "github.com/pokt-network/pocket/logger"
+ "github.com/pokt-network/pocket/p2p/config"
+ "github.com/pokt-network/pocket/p2p/protocol"
+ typesP2P "github.com/pokt-network/pocket/p2p/types"
+ "github.com/pokt-network/pocket/p2p/utils"
+ cryptoPocket "github.com/pokt-network/pocket/shared/crypto"
+ "github.com/pokt-network/pocket/shared/modules"
+ "github.com/pokt-network/pocket/shared/modules/base_modules"
+)
+
+var (
+ _ typesP2P.Router = &backgroundRouter{}
+ _ modules.IntegratableModule = &backgroundRouter{}
+)
+
+// backgroundRouter implements `typesP2P.Router` for use with all P2P participants.
+type backgroundRouter struct {
+ base_modules.IntegratableModule
+
+ logger *modules.Logger
+ // host represents a libp2p network node, it encapsulates a libp2p peerstore
+ // & connection manager. `libp2p.New` configures and starts listening
+ // according to options.
+ // (see: https://pkg.go.dev/github.com/libp2p/go-libp2p#section-readme)
+ host libp2pHost.Host
+ // gossipSub is used for broadcast communication
+ // (i.e. multiple, unidentified receivers)
+ // TECHDEBT: investigate diff between randomSub and gossipSub
+ gossipSub *pubsub.PubSub
+ // topic is similar to pubsub but received messages are filtered by a "topic" string.
+ // Published messages are also given the respective topic before broadcast.
+ topic *pubsub.Topic
+ // subscription provides an interface to continuously read messages from.
+ subscription *pubsub.Subscription
+ // kadDHT is a kademlia distributed hash table used for routing and peer discovery.
+ kadDHT *dht.IpfsDHT
+ // TECHDEBT: `pstore` will likely be removed in future refactoring / simplification
+ // of the `Router` interface.
+ // pstore is the background router's peerstore.
+ pstore typesP2P.Peerstore
+}
+
+// NewBackgroundRouter returns a `backgroundRouter` as a `typesP2P.Router`
+// interface using the given configuration.
+func NewBackgroundRouter(bus modules.Bus, cfg *config.BackgroundConfig) (typesP2P.Router, error) {
+ // TECHDEBT(#595): add ctx to interface methods and propagate down.
+ ctx := context.TODO()
+
+ networkLogger := logger.Global.CreateLoggerForModule("backgroundRouter")
+ networkLogger.Info().Msg("Initializing background router")
+
+ // seed initial peerstore with current on-chain peer info (i.e. staked actors)
+ pstore, err := cfg.PeerstoreProvider.GetStakedPeerstoreAtHeight(
+ cfg.CurrentHeightProvider.CurrentHeight(),
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ // CONSIDERATION: If switching to `NewRandomSub`, there will be a max size
+ gossipSub, err := pubsub.NewGossipSub(ctx, cfg.Host)
+ if err != nil {
+ return nil, fmt.Errorf("creating gossip pubsub: %w", err)
+ }
+
+ dhtMode := dht.ModeAutoServer
+ // NB: don't act as a bootstrap node in peer discovery in client debug mode
+ if isClientDebugMode(bus) {
+ dhtMode = dht.ModeClient
+ }
+
+ kadDHT, err := dht.New(ctx, cfg.Host, dht.Mode(dhtMode))
+ if err != nil {
+ return nil, fmt.Errorf("creating DHT: %w", err)
+ }
+
+ topic, err := gossipSub.Join(protocol.BackgroundTopicStr)
+ if err != nil {
+ return nil, fmt.Errorf("joining background topic: %w", err)
+ }
+
+ // INVESTIGATE: `WithBufferSize` `SubOpt`:
+ // > WithBufferSize is a Subscribe option to customize the size of the subscribe
+ // > output buffer. The default length is 32 but it can be configured to avoid
+ // > dropping messages if the consumer is not reading fast enough.
+ // (see: https://pkg.go.dev/github.com/libp2p/go-libp2p-pubsub#WithBufferSize)
+ subscription, err := topic.Subscribe()
+ if err != nil {
+ return nil, fmt.Errorf("subscribing to background topic: %w", err)
+ }
+
+ rtr := &backgroundRouter{
+ host: cfg.Host,
+ gossipSub: gossipSub,
+ kadDHT: kadDHT,
+ topic: topic,
+ subscription: subscription,
+ logger: networkLogger,
+ pstore: pstore,
+ }
+
+ return rtr, nil
+}
+
+// Broadcast implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) Broadcast(data []byte) error {
+ // TECHDEBT(#595): add ctx to interface methods and propagate down.
+ return rtr.topic.Publish(context.TODO(), data)
+}
+
+// Send implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) Send(data []byte, address cryptoPocket.Address) error {
+ peer := rtr.pstore.GetPeer(address)
+ if peer == nil {
+ return fmt.Errorf("peer with address %s not in peerstore", address)
+ }
+
+ if err := utils.Libp2pSendToPeer(rtr.host, data, peer); err != nil {
+ return err
+ }
+ return nil
+}
+
+// HandleNetworkData implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) HandleNetworkData(data []byte) ([]byte, error) {
+ return data, nil // intentional passthrough
+}
+
+// GetPeerstore implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) GetPeerstore() typesP2P.Peerstore {
+ return rtr.pstore
+}
+
+// AddPeer implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) AddPeer(peer typesP2P.Peer) error {
+ // Noop if peer with the pokt address already exists in the peerstore.
+ // TECHDEBT: add method(s) to update peers.
+ if p := rtr.pstore.GetPeer(peer.GetAddress()); p != nil {
+ return nil
+ }
+
+ if err := utils.AddPeerToLibp2pHost(rtr.host, peer); err != nil {
+ return err
+ }
+
+ return rtr.pstore.AddPeer(peer)
+}
+
+// RemovePeer implements the respective `typesP2P.Router` interface method.
+func (rtr *backgroundRouter) RemovePeer(peer typesP2P.Peer) error {
+ if err := utils.RemovePeerFromLibp2pHost(rtr.host, peer); err != nil {
+ return err
+ }
+
+ return rtr.pstore.RemovePeer(peer.GetAddress())
+}
+
+// isClientDebugMode returns the value of `ClientDebugMode` in the base config
+func isClientDebugMode(bus modules.Bus) bool {
+ return bus.GetRuntimeMgr().GetConfig().ClientDebugMode
+}
diff --git a/p2p/background/router_test.go b/p2p/background/router_test.go
new file mode 100644
index 000000000..eee09ddde
--- /dev/null
+++ b/p2p/background/router_test.go
@@ -0,0 +1,376 @@
+package background
+
+import (
+ "context"
+ "fmt"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/golang/mock/gomock"
+ libp2pCrypto "github.com/libp2p/go-libp2p/core/crypto"
+ libp2pHost "github.com/libp2p/go-libp2p/core/host"
+ libp2pNetwork "github.com/libp2p/go-libp2p/core/network"
+ libp2pPeer "github.com/libp2p/go-libp2p/core/peer"
+ mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
+ "github.com/multiformats/go-multiaddr"
+ "github.com/stretchr/testify/require"
+
+ "github.com/pokt-network/pocket/internal/testutil"
+ "github.com/pokt-network/pocket/p2p/config"
+ typesP2P "github.com/pokt-network/pocket/p2p/types"
+ mock_types "github.com/pokt-network/pocket/p2p/types/mocks"
+ "github.com/pokt-network/pocket/p2p/utils"
+ "github.com/pokt-network/pocket/runtime/configs"
+ "github.com/pokt-network/pocket/runtime/defaults"
+ cryptoPocket "github.com/pokt-network/pocket/shared/crypto"
+ mockModules "github.com/pokt-network/pocket/shared/modules/mocks"
+)
+
+// https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2
+const testIP6ServiceURL = "[2a00:1450:4005:802::2004]:8080"
+
+// TECHDEBT(#609): move & de-dup.
+var testLocalServiceURL = fmt.Sprintf("127.0.0.1:%d", defaults.DefaultP2PPort)
+
+func TestBackgroundRouter_AddPeer(t *testing.T) {
+ testRouter := newTestRouter(t, nil)
+ libp2pPStore := testRouter.host.Peerstore()
+
+ // NB: assert initial state
+ require.Equal(t, 1, testRouter.pstore.Size())
+
+ existingPeer := testRouter.pstore.GetPeerList()[0]
+ require.NotNil(t, existingPeer)
+
+ existingPeerInfo, err := utils.Libp2pAddrInfoFromPeer(existingPeer)
+ require.NoError(t, err)
+
+ existingPeerstoreAddrs := libp2pPStore.Addrs(existingPeerInfo.ID)
+ require.Len(t, existingPeerstoreAddrs, 1)
+
+ existingPeerMultiaddr, err := utils.Libp2pMultiaddrFromServiceURL(existingPeer.GetServiceURL())
+ require.NoError(t, err)
+ require.Equal(t, existingPeerstoreAddrs[0].String(), existingPeerMultiaddr.String())
+
+ newPublicKey, err := cryptoPocket.GeneratePublicKey()
+ newPoktAddr := newPublicKey.Address()
+ require.NoError(t, err)
+
+ newPeer := &typesP2P.NetworkPeer{
+ PublicKey: newPublicKey,
+ Address: newPoktAddr,
+ ServiceURL: testIP6ServiceURL,
+ }
+ newPeerInfo, err := utils.Libp2pAddrInfoFromPeer(newPeer)
+ require.NoError(t, err)
+ newPeerMultiaddr := newPeerInfo.Addrs[0]
+
+ // NB: add to address book
+ err = testRouter.AddPeer(newPeer)
+ require.NoError(t, err)
+
+ require.Len(t, testRouter.pstore, 2)
+ require.Equal(t, testRouter.pstore.GetPeer(existingPeer.GetAddress()), existingPeer)
+ require.Equal(t, testRouter.pstore.GetPeer(newPeer.Address), newPeer)
+
+ existingPeerstoreAddrs = libp2pPStore.Addrs(existingPeerInfo.ID)
+ newPeerstoreAddrs := libp2pPStore.Addrs(newPeerInfo.ID)
+ require.Len(t, existingPeerstoreAddrs, 1)
+ require.Len(t, newPeerstoreAddrs, 1)
+ require.Equal(t, newPeerstoreAddrs[0].String(), newPeerMultiaddr.String())
+}
+
+func TestBackgroundRouter_RemovePeer(t *testing.T) {
+ testRouter := newTestRouter(t, nil)
+ peerstore := testRouter.host.Peerstore()
+
+ // NB: assert initial state
+ require.Len(t, testRouter.pstore, 1)
+
+ existingPeer := testRouter.pstore.GetPeerList()[0]
+ require.NotNil(t, existingPeer)
+
+ existingPeerInfo, err := utils.Libp2pAddrInfoFromPeer(existingPeer)
+ require.NoError(t, err)
+
+ existingPeerstoreAddrs := peerstore.Addrs(existingPeerInfo.ID)
+ require.Len(t, existingPeerstoreAddrs, 1)
+
+ existingPeerMultiaddr, err := utils.Libp2pMultiaddrFromServiceURL(existingPeer.GetServiceURL())
+ require.NoError(t, err)
+ require.Equal(t, existingPeerstoreAddrs[0].String(), existingPeerMultiaddr.String())
+
+ err = testRouter.RemovePeer(existingPeer)
+ require.NoError(t, err)
+
+ require.Len(t, testRouter.pstore, 0)
+
+ // NB: libp2p peerstore implementations only remove peer keys and metadata
+ // but continue to resolve multiaddrs until their respective TTLs expire.
+ // (see: https://github.com/libp2p/go-libp2p/blob/v0.25.1/p2p/host/peerstore/pstoremem/peerstore.go#L108)
+ // (see: https://github.com/libp2p/go-libp2p/blob/v0.25.1/p2p/host/peerstore/pstoreds/peerstore.go#L187)
+
+ existingPeerstoreAddrs = peerstore.Addrs(existingPeerInfo.ID)
+ require.Len(t, existingPeerstoreAddrs, 1)
+}
+
+func TestBackgroundRouter_Broadcast(t *testing.T) {
+ const (
+ numPeers = 4
+ testMsg = "test messsage"
+ testTimeoutDuration = time.Second * 5
+ )
+
+ var (
+ ctx = context.Background()
+ // mutex preventing concurrent writes to `seenMessages`
+ seenMessagesMutext sync.Mutex
+ // map used as a set to collect IDs of peers which have received a message
+ seenMessages = make(map[string]struct{})
+ bootstrapWaitgroup = sync.WaitGroup{}
+ broadcastWaitgroup = sync.WaitGroup{}
+ broadcastDone = make(chan struct{}, 1)
+ testTimeout = time.After(testTimeoutDuration)
+ // NB: peerIDs are stringified
+ actualPeerIDs []string
+ expectedPeerIDs = make([]string, numPeers)
+ testHosts = make([]libp2pHost.Host, 0)
+ libp2pMockNet = mocknet.New()
+ )
+
+ // setup 4 libp2p hosts to listen for incoming streams from the test backgroundRouter
+ for i := 0; i < numPeers; i++ {
+ broadcastWaitgroup.Add(1)
+ bootstrapWaitgroup.Add(1)
+
+ privKey, selfPeer := newTestPeer(t)
+ host := newTestHost(t, libp2pMockNet, privKey)
+ testHosts = append(testHosts, host)
+ expectedPeerIDs[i] = host.ID().String()
+ rtr := newRouterWithSelfPeerAndHost(t, selfPeer, host)
+ go readSubscription(t, ctx, &broadcastWaitgroup, rtr, &seenMessagesMutext, seenMessages)
+ }
+
+ // bootstrap off of arbitrary testHost
+ privKey, selfPeer := newTestPeer(t)
+
+ // set up a test backgroundRouter
+ testRouterHost := newTestHost(t, libp2pMockNet, privKey)
+ testRouter := newRouterWithSelfPeerAndHost(t, selfPeer, testRouterHost)
+ testHosts = append(testHosts, testRouterHost)
+
+ // simulate network links between each to every other
+ // (i.e. fully-connected network)
+ err := libp2pMockNet.LinkAll()
+ require.NoError(t, err)
+
+ // setup notifee/notify BEFORE bootstrapping
+ notifee := &libp2pNetwork.NotifyBundle{
+ ConnectedF: func(_ libp2pNetwork.Network, _ libp2pNetwork.Conn) {
+ t.Logf("connected!")
+ bootstrapWaitgroup.Done()
+ },
+ }
+ testRouter.host.Network().Notify(notifee)
+
+ bootstrap(t, ctx, testHosts)
+
+ // broadcasting in a go routine so that we can wait for bootstrapping to
+ // complete before broadcasting.
+ go func() {
+ // wait for hosts to listen and peer discovery
+ bootstrapWaitgroup.Wait()
+ // INVESTIGATE: look for a more idiomatic way to wait for DHT peer discovery to complete
+ //
+ // `bootstrapWaitgroup` isn't quite sufficient; I suspect the DHT
+ // needs more time but am unaware of a notify/notifee interface (or
+ // something similar) at that level.
+ time.Sleep(time.Millisecond * 250)
+
+ // broadcast message
+ t.Log("broadcasting...")
+ err := testRouter.Broadcast([]byte(testMsg))
+ require.NoError(t, err)
+
+ // wait for broadcast to be received by all peers
+ broadcastWaitgroup.Wait()
+ broadcastDone <- struct{}{}
+ }()
+
+ // waitgroup broadcastDone or timeout
+ select {
+ case <-testTimeout:
+ t.Fatalf(
+ "timed out waiting for all expected messages: got %d; wanted %d",
+ len(seenMessages),
+ numPeers,
+ )
+ case <-broadcastDone:
+ }
+
+ actualPeerIDs = testutil.GetKeys[string](seenMessages)
+ require.ElementsMatchf(t, expectedPeerIDs, actualPeerIDs, "peerIDs don't match")
+}
+
+// bootstrap connects each host to one other except for the arbitrarily chosen "bootstrap host"
+func bootstrap(t *testing.T, ctx context.Context, testHosts []libp2pHost.Host) {
+ t.Helper()
+
+ t.Log("bootstrapping...")
+ bootstrapHost := testHosts[0]
+ bootstrapAddr := bootstrapHost.Addrs()[0]
+ for _, h := range testHosts {
+ if h.ID() == bootstrapHost.ID() {
+ continue
+ }
+
+ p2pAddr, err := multiaddr.NewMultiaddr(fmt.Sprintf("/p2p/%s", bootstrapHost.ID()))
+ require.NoError(t, err)
+
+ addrInfo := libp2pPeer.AddrInfo{
+ ID: bootstrapHost.ID(),
+ Addrs: []multiaddr.Multiaddr{
+ bootstrapAddr.Encapsulate(p2pAddr),
+ },
+ }
+
+ t.Logf("connecting to %s...", addrInfo.ID.String())
+ err = h.Connect(ctx, addrInfo)
+ require.NoError(t, err)
+ }
+}
+
+// TECHDEBT(#609): move & de-duplicate
+func newTestRouter(t *testing.T, libp2pMockNet mocknet.Mocknet) *backgroundRouter {
+ t.Helper()
+
+ privKey, selfPeer := newTestPeer(t)
+
+ if libp2pMockNet == nil {
+ libp2pMockNet = mocknet.New()
+ }
+
+ host := newMockNetHostFromPeer(t, libp2pMockNet, privKey, selfPeer)
+ t.Cleanup(func() {
+ err := host.Close()
+ require.NoError(t, err)
+ })
+
+ return newRouterWithSelfPeerAndHost(t, selfPeer, host)
+}
+
+func newRouterWithSelfPeerAndHost(t *testing.T, selfPeer typesP2P.Peer, host libp2pHost.Host) *backgroundRouter {
+ t.Helper()
+
+ ctrl := gomock.NewController(t)
+ runtimeMgrMock := mockModules.NewMockRuntimeMgr(ctrl)
+ runtimeMgrMock.EXPECT().GetConfig().Return(&configs.Config{
+ P2P: &configs.P2PConfig{
+ IsClientOnly: false,
+ },
+ })
+
+ consensusMock := mockModules.NewMockConsensusModule(ctrl)
+ consensusMock.EXPECT().CurrentHeight().Return(uint64(1)).AnyTimes()
+
+ pstore := make(typesP2P.PeerAddrMap)
+ pstoreProviderMock := mock_types.NewMockPeerstoreProvider(ctrl)
+ pstoreProviderMock.EXPECT().GetStakedPeerstoreAtHeight(gomock.Any()).Return(pstore, nil).AnyTimes()
+
+ busMock := mockModules.NewMockBus(ctrl)
+ busMock.EXPECT().GetConsensusModule().Return(consensusMock).AnyTimes()
+ busMock.EXPECT().GetRuntimeMgr().Return(runtimeMgrMock).AnyTimes()
+
+ err := pstore.AddPeer(selfPeer)
+ require.NoError(t, err)
+
+ router, err := NewBackgroundRouter(busMock, &config.BackgroundConfig{
+ Addr: selfPeer.GetAddress(),
+ PeerstoreProvider: pstoreProviderMock,
+ CurrentHeightProvider: consensusMock,
+ Host: host,
+ })
+ require.NoError(t, err)
+
+ libp2pNet, ok := router.(*backgroundRouter)
+ require.Truef(t, ok, "unexpected router type: %T", router)
+
+ return libp2pNet
+}
+
+// TECHDEBT(#609): move & de-duplicate
+func newTestPeer(t *testing.T) (cryptoPocket.PrivateKey, *typesP2P.NetworkPeer) {
+ t.Helper()
+
+ privKey, err := cryptoPocket.GeneratePrivateKey()
+ require.NoError(t, err)
+
+ return privKey, &typesP2P.NetworkPeer{
+ PublicKey: privKey.PublicKey(),
+ Address: privKey.Address(),
+ ServiceURL: testLocalServiceURL,
+ }
+}
+
+func newMockNetHostFromPeer(
+ t *testing.T,
+ mockNet mocknet.Mocknet,
+ privKey cryptoPocket.PrivateKey,
+ peer *typesP2P.NetworkPeer,
+) libp2pHost.Host {
+ t.Helper()
+
+ libp2pPrivKey, err := libp2pCrypto.UnmarshalEd25519PrivateKey(privKey.Bytes())
+ require.NoError(t, err)
+
+ libp2pMultiAddr, err := utils.Libp2pMultiaddrFromServiceURL(peer.ServiceURL)
+ require.NoError(t, err)
+
+ host, err := mockNet.AddPeer(libp2pPrivKey, libp2pMultiAddr)
+ require.NoError(t, err)
+
+ return host
+}
+
+func newTestHost(t *testing.T, mockNet mocknet.Mocknet, privKey cryptoPocket.PrivateKey) libp2pHost.Host {
+ t.Helper()
+
+ // listen on random port on loopback interface
+ peer := &typesP2P.NetworkPeer{
+ PublicKey: privKey.PublicKey(),
+ Address: privKey.Address(),
+ ServiceURL: testLocalServiceURL,
+ }
+
+ // construct mock host
+ return newMockNetHostFromPeer(t, mockNet, privKey, peer)
+}
+
+func readSubscription(
+ t *testing.T,
+ ctx context.Context,
+ broadcastWaitGroup *sync.WaitGroup,
+ rtr *backgroundRouter,
+ mu *sync.Mutex,
+ seenMsgs map[string]struct{},
+) {
+ t.Helper()
+
+ for {
+ if err := ctx.Err(); err != nil {
+ if err != context.Canceled || err != context.DeadlineExceeded {
+ require.NoError(t, err)
+ }
+ return
+ }
+
+ _, err := rtr.subscription.Next(ctx)
+ require.NoError(t, err)
+
+ mu.Lock()
+ broadcastWaitGroup.Done()
+ seenMsgs[rtr.host.ID().String()] = struct{}{}
+ mu.Unlock()
+ }
+}
diff --git a/p2p/config/config.go b/p2p/config/config.go
new file mode 100644
index 000000000..22628da52
--- /dev/null
+++ b/p2p/config/config.go
@@ -0,0 +1,86 @@
+package config
+
+import (
+ "fmt"
+ "github.com/libp2p/go-libp2p/core/host"
+ "github.com/pokt-network/pocket/p2p/providers"
+ "github.com/pokt-network/pocket/shared/crypto"
+ "go.uber.org/multierr"
+)
+
+// baseConfig implements `RouterConfig` using the given libp2p host and current
+// height and peerstore providers. Intended for internal use by other `RouterConfig`
+// implementations with common config parameters.
+//
+// NB: intentionally *not* embedding `baseConfig` to improve readability of usages
+// of would-be embedders (e.g. `BackgroundConfig`).
+type baseConfig struct {
+ Host host.Host
+ Addr crypto.Address
+ CurrentHeightProvider providers.CurrentHeightProvider
+ PeerstoreProvider providers.PeerstoreProvider
+}
+
+// BackgroundConfig implements `RouterConfig` for use with `BackgroundRouter`.
+type BackgroundConfig struct {
+ Host host.Host
+ Addr crypto.Address
+ CurrentHeightProvider providers.CurrentHeightProvider
+ PeerstoreProvider providers.PeerstoreProvider
+}
+
+// RainTreeConfig implements `RouterConfig` for use with `RainTreeRouter`.
+type RainTreeConfig struct {
+ Host host.Host
+ Addr crypto.Address
+ CurrentHeightProvider providers.CurrentHeightProvider
+ PeerstoreProvider providers.PeerstoreProvider
+
+ MaxNonces uint64
+}
+
+// IsValid implements the respective member of the `RouterConfig` interface.
+func (cfg *baseConfig) IsValid() (err error) {
+ if cfg.Addr == nil {
+ err = multierr.Append(err, fmt.Errorf("pokt address not configured"))
+ }
+
+ if cfg.CurrentHeightProvider == nil {
+ err = multierr.Append(err, fmt.Errorf("current height provider not configured"))
+ }
+
+ if cfg.Host == nil {
+ err = multierr.Append(err, fmt.Errorf("host not configured"))
+ }
+
+ if cfg.PeerstoreProvider == nil {
+ err = multierr.Append(err, fmt.Errorf("peerstore provider not configured"))
+ }
+ return err
+}
+
+// IsValid implements the respective member of the `RouterConfig` interface.
+func (cfg *BackgroundConfig) IsValid() (err error) {
+ baseCfg := baseConfig{
+ Host: cfg.Host,
+ Addr: cfg.Addr,
+ CurrentHeightProvider: cfg.CurrentHeightProvider,
+ PeerstoreProvider: cfg.PeerstoreProvider,
+ }
+ return multierr.Append(err, baseCfg.IsValid())
+}
+
+// IsValid implements the respective member of the `RouterConfig` interface.
+func (cfg *RainTreeConfig) IsValid() (err error) {
+ if cfg.MaxNonces == 0 {
+ err = multierr.Append(err, fmt.Errorf("max nonces must be greater than 0"))
+ }
+
+ baseCfg := baseConfig{
+ Host: cfg.Host,
+ Addr: cfg.Addr,
+ CurrentHeightProvider: cfg.CurrentHeightProvider,
+ PeerstoreProvider: cfg.PeerstoreProvider,
+ }
+ return multierr.Append(err, baseCfg.IsValid())
+}
diff --git a/p2p/module.go b/p2p/module.go
index 093e12e1f..d515d4230 100644
--- a/p2p/module.go
+++ b/p2p/module.go
@@ -14,6 +14,7 @@ import (
"google.golang.org/protobuf/types/known/anypb"
"github.com/pokt-network/pocket/logger"
+ "github.com/pokt-network/pocket/p2p/config"
"github.com/pokt-network/pocket/p2p/protocol"
"github.com/pokt-network/pocket/p2p/providers"
"github.com/pokt-network/pocket/p2p/providers/current_height_provider"
@@ -286,13 +287,12 @@ func (m *p2pModule) setupCurrentHeightProvider() error {
func (m *p2pModule) setupRouter() (err error) {
m.router, err = raintree.NewRainTreeRouter(
m.GetBus(),
- &raintree.RainTreeConfig{
+ &config.RainTreeConfig{
Addr: m.address,
CurrentHeightProvider: m.currentHeightProvider,
- Host: m.host,
- Hostname: m.cfg.Hostname,
- MaxMempoolCount: m.cfg.MaxMempoolCount,
PeerstoreProvider: m.pstoreProvider,
+ Host: m.host,
+ MaxNonces: m.cfg.MaxNonces,
},
)
return err
diff --git a/p2p/module_test.go b/p2p/module_test.go
index 111b4e4f7..ebaef0682 100644
--- a/p2p/module_test.go
+++ b/p2p/module_test.go
@@ -172,6 +172,7 @@ func TestP2pModule_WithHostOption_Restart(t *testing.T) {
PrivateKey: privKey.String(),
P2P: &configs.P2PConfig{
PrivateKey: privKey.String(),
+ MaxNonces: defaults.DefaultP2PMaxNonces,
},
}).AnyTimes()
mockBus.EXPECT().GetRuntimeMgr().Return(mockRuntimeMgr).AnyTimes()
diff --git a/p2p/protocol/protocol.go b/p2p/protocol/protocol.go
index 26f0b7b3c..81737e9a8 100644
--- a/p2p/protocol/protocol.go
+++ b/p2p/protocol/protocol.go
@@ -7,7 +7,11 @@ const (
// to a remote peer and setting the stream handler for the local peer.
// Libp2p APIs use this to distinguish which multiplexed protocols/streams to consider.
PoktProtocolID = protocol.ID("pokt/v1.0.0")
- // DefaultTopicStr is a "default" pubsub topic string used when
+ // BackgroundTopicStr is a "default" pubsub topic string used when
// subscribing and broadcasting.
- DefaultTopicStr = "pokt/default"
+ BackgroundTopicStr = "pokt/background"
+ // PeerDiscoveryNamespace used by both advertiser and discoverer to rendezvous
+ // during peer discovery. Advertiser(s) and discoverer(s) MUST have matching
+ // discovery namespaces to find one another.
+ PeerDiscoveryNamespace = "pokt/peer_discovery"
)
diff --git a/p2p/raintree/peers_manager_test.go b/p2p/raintree/peers_manager_test.go
index b3a3b716a..9e3d13520 100644
--- a/p2p/raintree/peers_manager_test.go
+++ b/p2p/raintree/peers_manager_test.go
@@ -14,9 +14,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/pokt-network/pocket/internal/testutil"
+ "github.com/pokt-network/pocket/p2p/config"
typesP2P "github.com/pokt-network/pocket/p2p/types"
mocksP2P "github.com/pokt-network/pocket/p2p/types/mocks"
"github.com/pokt-network/pocket/runtime/configs"
+ "github.com/pokt-network/pocket/runtime/defaults"
cryptoPocket "github.com/pokt-network/pocket/shared/crypto"
mockModules "github.com/pokt-network/pocket/shared/modules/mocks"
)
@@ -96,11 +98,12 @@ func TestRainTree_Peerstore_HandleUpdate(t *testing.T) {
libp2pMockNet, err := mocknet.WithNPeers(1)
require.NoError(t, err)
- rtCfg := &RainTreeConfig{
+ rtCfg := &config.RainTreeConfig{
Host: libp2pMockNet.Hosts()[0],
Addr: pubKey.Address(),
PeerstoreProvider: pstoreProviderMock,
CurrentHeightProvider: currentHeightProviderMock,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
}
router, err := NewRainTreeRouter(mockBus, rtCfg)
@@ -163,7 +166,7 @@ func BenchmarkPeerstoreUpdates(b *testing.B) {
hostMock := mocksP2P.NewMockHost(ctrl)
hostMock.EXPECT().Peerstore().Return(libp2pPStore).AnyTimes()
- rtCfg := &RainTreeConfig{
+ rtCfg := &config.RainTreeConfig{
Host: hostMock,
Addr: pubKey.Address(),
PeerstoreProvider: pstoreProviderMock,
@@ -287,11 +290,12 @@ func testRainTreeMessageTargets(t *testing.T, expectedMsgProp *ExpectedRainTreeM
hostMock := mocksP2P.NewMockHost(ctrl)
hostMock.EXPECT().Peerstore().Return(libp2pPStore).AnyTimes()
- rtCfg := &RainTreeConfig{
+ rtCfg := &config.RainTreeConfig{
Host: hostMock,
Addr: []byte{expectedMsgProp.orig},
PeerstoreProvider: pstoreProviderMock,
CurrentHeightProvider: currentHeightProviderMock,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
}
router, err := NewRainTreeRouter(busMock, rtCfg)
diff --git a/p2p/raintree/router.go b/p2p/raintree/router.go
index 05a05c141..00e608b71 100644
--- a/p2p/raintree/router.go
+++ b/p2p/raintree/router.go
@@ -5,10 +5,10 @@ import (
"log"
libp2pHost "github.com/libp2p/go-libp2p/core/host"
- "go.uber.org/multierr"
"google.golang.org/protobuf/proto"
"github.com/pokt-network/pocket/logger"
+ "github.com/pokt-network/pocket/p2p/config"
"github.com/pokt-network/pocket/p2p/providers"
"github.com/pokt-network/pocket/p2p/providers/peerstore_provider"
typesP2P "github.com/pokt-network/pocket/p2p/types"
@@ -29,16 +29,7 @@ var (
_ rainTreeFactory = &rainTreeRouter{}
)
-type rainTreeFactory = modules.FactoryWithConfig[typesP2P.Router, *RainTreeConfig]
-
-type RainTreeConfig struct {
- Addr cryptoPocket.Address
- CurrentHeightProvider providers.CurrentHeightProvider
- Host libp2pHost.Host
- Hostname string
- MaxMempoolCount uint64
- PeerstoreProvider providers.PeerstoreProvider
-}
+type rainTreeFactory = modules.FactoryWithConfig[typesP2P.Router, *config.RainTreeConfig]
type rainTreeRouter struct {
base_modules.IntegratableModule
@@ -50,32 +41,29 @@ type rainTreeRouter struct {
// (see: https://pkg.go.dev/github.com/libp2p/go-libp2p#section-readme)
host libp2pHost.Host
// selfAddr is the pocket address representing this host.
- selfAddr cryptoPocket.Address
- // hostname is the network hostname from the config
- hostname string
+ selfAddr cryptoPocket.Address
peersManager *rainTreePeersManager
pstoreProvider peerstore_provider.PeerstoreProvider
currentHeightProvider providers.CurrentHeightProvider
nonceDeduper *mempool.GenericFIFOSet[uint64, uint64]
}
-func NewRainTreeRouter(bus modules.Bus, cfg *RainTreeConfig) (typesP2P.Router, error) {
+func NewRainTreeRouter(bus modules.Bus, cfg *config.RainTreeConfig) (typesP2P.Router, error) {
return new(rainTreeRouter).Create(bus, cfg)
}
-func (*rainTreeRouter) Create(bus modules.Bus, cfg *RainTreeConfig) (typesP2P.Router, error) {
+func (*rainTreeRouter) Create(bus modules.Bus, cfg *config.RainTreeConfig) (typesP2P.Router, error) {
routerLogger := logger.Global.CreateLoggerForModule("router")
routerLogger.Info().Msg("Initializing rainTreeRouter")
- if err := cfg.isValid(); err != nil {
+ if err := cfg.IsValid(); err != nil {
return nil, err
}
rtr := &rainTreeRouter{
host: cfg.Host,
selfAddr: cfg.Addr,
- hostname: cfg.Hostname,
- nonceDeduper: mempool.NewGenericFIFOSet[uint64, uint64](int(cfg.MaxMempoolCount)),
+ nonceDeduper: mempool.NewGenericFIFOSet[uint64, uint64](int(cfg.MaxNonces)),
pstoreProvider: cfg.PeerstoreProvider,
currentHeightProvider: cfg.CurrentHeightProvider,
logger: routerLogger,
@@ -168,7 +156,8 @@ func (rtr *rainTreeRouter) sendInternal(data []byte, address cryptoPocket.Addres
}
// debug logging
- utils.LogOutgoingMsg(rtr.logger, rtr.hostname, peer)
+ hostname := rtr.getHostname()
+ utils.LogOutgoingMsg(rtr.logger, hostname, peer)
if err := utils.Libp2pSendToPeer(rtr.host, data, peer); err != nil {
rtr.logger.Debug().Err(err).Msg("from libp2pSendInternal")
@@ -320,17 +309,6 @@ func (rtr *rainTreeRouter) setupPeerManager(pstore typesP2P.Peerstore) (err erro
return err
}
-func (cfg RainTreeConfig) isValid() (err error) {
- if cfg.Host == nil {
- err = multierr.Append(err, fmt.Errorf("host not configured"))
- }
-
- if cfg.PeerstoreProvider == nil {
- err = multierr.Append(err, fmt.Errorf("peerstore provider not configured"))
- }
-
- if cfg.CurrentHeightProvider == nil {
- err = multierr.Append(err, fmt.Errorf("current height provider not configured"))
- }
- return err
+func (rtr *rainTreeRouter) getHostname() string {
+ return rtr.GetBus().GetRuntimeMgr().GetConfig().P2P.Hostname
}
diff --git a/p2p/raintree/router_test.go b/p2p/raintree/router_test.go
index 9b8281d12..6c404a0f2 100644
--- a/p2p/raintree/router_test.go
+++ b/p2p/raintree/router_test.go
@@ -10,6 +10,7 @@ import (
libp2pHost "github.com/libp2p/go-libp2p/core/host"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
+ "github.com/pokt-network/pocket/p2p/config"
typesP2P "github.com/pokt-network/pocket/p2p/types"
"github.com/pokt-network/pocket/p2p/utils"
"github.com/pokt-network/pocket/runtime/defaults"
@@ -52,11 +53,12 @@ func TestRainTreeRouter_AddPeer(t *testing.T) {
peerstoreProviderMock := mockPeerstoreProvider(ctrl, pstore)
currentHeightProviderMock := mockCurrentHeightProvider(ctrl, 0)
- rtCfg := &RainTreeConfig{
+ rtCfg := &config.RainTreeConfig{
Host: host,
Addr: selfAddr,
PeerstoreProvider: peerstoreProviderMock,
CurrentHeightProvider: currentHeightProviderMock,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
}
router, err := NewRainTreeRouter(busMock, rtCfg)
@@ -114,11 +116,12 @@ func TestRainTreeRouter_RemovePeer(t *testing.T) {
busMock := mockBus(ctrl)
peerstoreProviderMock := mockPeerstoreProvider(ctrl, pstore)
currentHeightProviderMock := mockCurrentHeightProvider(ctrl, 0)
- rtCfg := &RainTreeConfig{
+ rtCfg := &config.RainTreeConfig{
Host: host,
Addr: selfAddr,
PeerstoreProvider: peerstoreProviderMock,
CurrentHeightProvider: currentHeightProviderMock,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
}
router, err := NewRainTreeRouter(busMock, rtCfg)
diff --git a/p2p/transport_encryption_test.go b/p2p/transport_encryption_test.go
index c897224ac..83d280626 100644
--- a/p2p/transport_encryption_test.go
+++ b/p2p/transport_encryption_test.go
@@ -40,6 +40,7 @@ func TestP2pModule_Insecure_Error(t *testing.T) {
Hostname: hostname,
Port: defaults.DefaultP2PPort,
ConnectionType: types.ConnectionType_TCPConnection,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
},
}).AnyTimes()
diff --git a/p2p/types/router.go b/p2p/types/router.go
index 14c3fd2d8..b14c45866 100644
--- a/p2p/types/router.go
+++ b/p2p/types/router.go
@@ -26,3 +26,9 @@ type Router interface {
// by the application layer.
HandleNetworkData(data []byte) ([]byte, error)
}
+
+// RouterConfig is used to configure `Router` implementations and to test a
+// given configuration's validity.
+type RouterConfig interface {
+ IsValid() error
+}
diff --git a/p2p/types/transport.go b/p2p/types/transport.go
deleted file mode 100644
index 3b60f8e96..000000000
--- a/p2p/types/transport.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package types
-
-import "github.com/pokt-network/pocket/runtime/configs"
-
-//go:generate mockgen -source=$GOFILE -destination=./mocks/transport_mock.go github.com/pokt-network/pocket/p2p/types Transport
-
-type Transport interface {
- IsListener() bool
- ReadAll() ([]byte, error)
- Read([]byte) (int, error)
- Write([]byte) (int, error)
- Close() error
-}
-
-type ConnectionFactory func(cfg *configs.P2PConfig, url string) (Transport, error)
diff --git a/p2p/utils_test.go b/p2p/utils_test.go
index c40b95210..3ed4e50cd 100644
--- a/p2p/utils_test.go
+++ b/p2p/utils_test.go
@@ -23,6 +23,7 @@ import (
"github.com/pokt-network/pocket/runtime"
"github.com/pokt-network/pocket/runtime/configs"
"github.com/pokt-network/pocket/runtime/configs/types"
+ "github.com/pokt-network/pocket/runtime/defaults"
"github.com/pokt-network/pocket/runtime/genesis"
"github.com/pokt-network/pocket/runtime/test_artifacts"
coreTypes "github.com/pokt-network/pocket/shared/core/types"
@@ -166,6 +167,7 @@ func createMockRuntimeMgrs(t *testing.T, numValidators int) []modules.RuntimeMgr
PrivateKey: valKeys[i].String(),
Port: uint32(port),
ConnectionType: types.ConnectionType_EmptyConnection,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
},
}
diff --git a/runtime/configs/config.go b/runtime/configs/config.go
index 74b5d6091..897fe0eac 100644
--- a/runtime/configs/config.go
+++ b/runtime/configs/config.go
@@ -129,9 +129,9 @@ func NewDefaultConfig(options ...func(*Config)) *Config {
BlockStorePath: defaults.DefaultPersistenceBlockStorePath,
},
P2P: &P2PConfig{
- Port: defaults.DefaultP2PPort,
- ConnectionType: defaults.DefaultP2PConnectionType,
- MaxMempoolCount: defaults.DefaultP2PMaxMempoolCount,
+ Port: defaults.DefaultP2PPort,
+ ConnectionType: defaults.DefaultP2PConnectionType,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
},
Telemetry: &TelemetryConfig{
Enabled: defaults.DefaultTelemetryEnabled,
diff --git a/runtime/configs/proto/p2p_config.proto b/runtime/configs/proto/p2p_config.proto
index 1ce193bcb..e01cea09a 100644
--- a/runtime/configs/proto/p2p_config.proto
+++ b/runtime/configs/proto/p2p_config.proto
@@ -11,7 +11,7 @@ message P2PConfig {
string hostname = 2;
uint32 port = 3;
conn.ConnectionType connection_type = 4;
- uint64 max_mempool_count = 5; // this is used to limit the number of nonces that can be stored in the mempool, after which a FIFO mechanism is used to remove the oldest nonces and make space for the new ones
+ uint64 max_nonces = 5; // used to limit the number of nonces that can be stored before a FIFO mechanism is used to remove the oldest nonces and make space for the new ones
bool is_client_only = 6;
string bootstrap_nodes_csv = 7; // string in the format "http://somenode:50832,http://someothernode:50832". Refer to `p2p/module_test.go` for additional details.
}
diff --git a/runtime/defaults/defaults.go b/runtime/defaults/defaults.go
index 40e17e0d4..b2b31c530 100644
--- a/runtime/defaults/defaults.go
+++ b/runtime/defaults/defaults.go
@@ -49,11 +49,11 @@ var (
DefaultPersistencePostgresURL = "postgres://postgres:postgres@pocket-db:5432/postgres"
DefaultPersistenceBlockStorePath = "/var/blockstore"
// p2p
- DefaultUseLibp2p = false
- DefaultP2PPort = uint32(42069)
- DefaultP2PUseRainTree = true
- DefaultP2PConnectionType = types.ConnectionType_TCPConnection
- DefaultP2PMaxMempoolCount = uint64(1e5)
+ DefaultUseLibp2p = false
+ DefaultP2PPort = uint32(42069)
+ DefaultP2PUseRainTree = true
+ DefaultP2PConnectionType = types.ConnectionType_TCPConnection
+ DefaultP2PMaxNonces = uint64(1e5)
// telemetry
DefaultTelemetryEnabled = true
DefaultTelemetryAddress = "0.0.0.0:9000"
diff --git a/runtime/docs/CHANGELOG.md b/runtime/docs/CHANGELOG.md
index c17f6e118..4e20f69bc 100644
--- a/runtime/docs/CHANGELOG.md
+++ b/runtime/docs/CHANGELOG.md
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [0.0.0.38] - 2023-05-08
+
+- Renamed `P2PConfig#MaxMempoolCount` to `P2PConfig#MaxNonces`
+- Renamed `DefaultP2PMaxMempoolCount` to `DefaultP2PMaxNonces`
+
## [0.0.0.37] - 2023-05-04
- Add `network_id` field to the configs and give the default value of `"localnet"`
diff --git a/runtime/manager_test.go b/runtime/manager_test.go
index 4a66cb1d4..1e740b219 100644
--- a/runtime/manager_test.go
+++ b/runtime/manager_test.go
@@ -4208,11 +4208,11 @@ func TestNewManagerFromReaders(t *testing.T) {
HealthCheckPeriod: "30s",
},
P2P: &configs.P2PConfig{
- PrivateKey: "0ca1a40ddecdab4f5b04fa0bfed1d235beaa2b8082e7554425607516f0862075dfe357de55649e6d2ce889acf15eb77e94ab3c5756fe46d3c7538d37f27f115e",
- Hostname: "node1.consensus",
- Port: defaults.DefaultP2PPort,
- ConnectionType: configTypes.ConnectionType_TCPConnection,
- MaxMempoolCount: 1e5,
+ PrivateKey: "0ca1a40ddecdab4f5b04fa0bfed1d235beaa2b8082e7554425607516f0862075dfe357de55649e6d2ce889acf15eb77e94ab3c5756fe46d3c7538d37f27f115e",
+ Hostname: "node1.consensus",
+ Port: defaults.DefaultP2PPort,
+ ConnectionType: configTypes.ConnectionType_TCPConnection,
+ MaxNonces: 1e5,
},
Telemetry: &configs.TelemetryConfig{
Enabled: true,
@@ -4240,7 +4240,7 @@ func TestNewManagerFromReaders(t *testing.T) {
},
},
{
- name: "unset MaxMempoolCount should fallback to default value",
+ name: "unset MaxNonces should fallback to default value",
args: args{
configReader: strings.NewReader(string(`{
"p2p": {
@@ -4256,11 +4256,11 @@ func TestNewManagerFromReaders(t *testing.T) {
want: &Manager{
config: &configs.Config{
P2P: &configs.P2PConfig{
- PrivateKey: "4ff3292ff14213149446f8208942b35439cb4b2c5e819f41fb612e880b5614bdd6cea8706f6ee6672c1e013e667ec8c46231e0e7abcf97ba35d89fceb8edae45",
- Hostname: "node1.consensus",
- Port: 42069,
- ConnectionType: configTypes.ConnectionType_TCPConnection,
- MaxMempoolCount: defaults.DefaultP2PMaxMempoolCount,
+ PrivateKey: "4ff3292ff14213149446f8208942b35439cb4b2c5e819f41fb612e880b5614bdd6cea8706f6ee6672c1e013e667ec8c46231e0e7abcf97ba35d89fceb8edae45",
+ Hostname: "node1.consensus",
+ Port: 42069,
+ ConnectionType: configTypes.ConnectionType_TCPConnection,
+ MaxNonces: defaults.DefaultP2PMaxNonces,
},
Keybase: defaultCfg.Keybase,
},