From 91e658aeb6891828f79bc247bf1f23250751afb5 Mon Sep 17 00:00:00 2001 From: Adam Babik Date: Fri, 21 Feb 2020 16:22:25 +0100 Subject: [PATCH] bump Whisper to 6.2.1 (#1869) --- VERSION | 2 +- go.mod | 2 +- go.sum | 4 ++-- .../status-im/status-go/whisper/v6/metrics.go | 16 ++++++++++++++++ .../status-im/status-go/whisper/v6/whisper.go | 4 ++++ vendor/modules.txt | 2 +- 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 301092317..620104d82 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.46.0 +0.46.1 diff --git a/go.mod b/go.mod index b72b68966..6f76fed8e 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/status-im/migrate/v4 v4.6.2-status.2 github.com/status-im/rendezvous v1.3.0 github.com/status-im/status-go/extkeys v1.1.0 - github.com/status-im/status-go/whisper/v6 v6.2.0 + github.com/status-im/status-go/whisper/v6 v6.2.1 github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501 github.com/stretchr/testify v1.4.0 github.com/syndtr/goleveldb v1.0.0 diff --git a/go.sum b/go.sum index 6bb18b919..a6072fb55 100644 --- a/go.sum +++ b/go.sum @@ -617,8 +617,8 @@ github.com/status-im/rendezvous v1.3.0/go.mod h1:+hzjuP+j/XzLPeF6E50b88pWOTLdTcw github.com/status-im/status-go/extkeys v1.0.0/go.mod h1:GdqJbrcpkNm5ZsSCpp+PdMxnXx+OcRBdm3PI0rs1FpU= github.com/status-im/status-go/extkeys v1.1.0 h1:QgnXlMvhlFyRu+GdpPn1Ve22IidnDdslFB/Py6HWj78= github.com/status-im/status-go/extkeys v1.1.0/go.mod h1:nT/T2+G4L/6qPVIIfI3oT8dQSVyn7fQYY8G3yL3PIGY= -github.com/status-im/status-go/whisper/v6 v6.2.0 h1:7QB5Ztlcn7n5WO3gKa4KnIoCvnIa0rVMM810lHCK2ws= -github.com/status-im/status-go/whisper/v6 v6.2.0/go.mod h1:csqMoPMkCPW1NJO56HJzNTWAl9UMdetnQzkPbPjsAC4= +github.com/status-im/status-go/whisper/v6 v6.2.1 h1:rqqEX0seJPMj1JOAp1A5wmdR/oSzQJBrhme6p40UUbE= +github.com/status-im/status-go/whisper/v6 v6.2.1/go.mod h1:csqMoPMkCPW1NJO56HJzNTWAl9UMdetnQzkPbPjsAC4= github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501 h1:oa0KU5jJRNtXaM/P465MhvSFo/HM2O8qi2DDuPcd7ro= github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501/go.mod h1:RYo/itke1oU5k/6sj9DNM3QAwtE5rZSgg5JnkOv83hk= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= diff --git a/vendor/github.com/status-im/status-go/whisper/v6/metrics.go b/vendor/github.com/status-im/status-go/whisper/v6/metrics.go index 09b3af10f..0f0b80ba3 100644 --- a/vendor/github.com/status-im/status-go/whisper/v6/metrics.go +++ b/vendor/github.com/status-im/status-go/whisper/v6/metrics.go @@ -39,6 +39,19 @@ var ( Name: "whisper_rate_limits_exceeded_total", Help: "Number of times the Waku rate limits were exceeded", }, []string{"type"}) + // bridging + bridgeSent = prom.NewCounter(prom.CounterOpts{ + Name: "whisper_bridge_sent_total", + Help: "Number of envelopes bridged from Whisper", + }) + bridgeReceivedSucceed = prom.NewCounter(prom.CounterOpts{ + Name: "whisper_bridge_received_success_total", + Help: "Number of envelopes bridged to Whisper and successfully added", + }) + bridgeReceivedFailed = prom.NewCounter(prom.CounterOpts{ + Name: "whisper_bridge_received_failure_total", + Help: "Number of envelopes bridged to Whisper and failed to be added", + }) ) func init() { @@ -49,4 +62,7 @@ func init() { prom.MustRegister(envelopesSizeMeter) prom.MustRegister(rateLimitsProcessed) prom.MustRegister(rateLimitsExceeded) + prom.MustRegister(bridgeSent) + prom.MustRegister(bridgeReceivedSucceed) + prom.MustRegister(bridgeReceivedFailed) } diff --git a/vendor/github.com/status-im/status-go/whisper/v6/whisper.go b/vendor/github.com/status-im/status-go/whisper/v6/whisper.go index f0c306fc6..22944e09d 100644 --- a/vendor/github.com/status-im/status-go/whisper/v6/whisper.go +++ b/vendor/github.com/status-im/status-go/whisper/v6/whisper.go @@ -301,12 +301,14 @@ func (whisper *Whisper) readBridgeLoop() { case env := <-out: _, err := whisper.addAndBridge(env, false, true) if err != nil { + bridgeReceivedFailed.Inc() log.Warn( "failed to add a bridged envelope", "ID", env.Hash().Bytes(), "err", err, ) } else { + bridgeReceivedSucceed.Inc() log.Debug( "bridged envelope successfully", "ID", env.Hash().Bytes(), @@ -1375,8 +1377,10 @@ func (whisper *Whisper) addAndBridge(envelope *Envelope, isP2P bool, bridged boo // In particular, if a node is a lightweight node, // it should not bridge any envelopes. if !isP2P && !bridged && whisper.bridge != nil { + log.Debug("bridging envelope from Whisper", "hash", envelope.Hash().Hex()) _, in := whisper.bridge.Pipe() in <- envelope + bridgeSent.Inc() } } return true, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 6412b187a..4830617a8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -374,7 +374,7 @@ github.com/status-im/rendezvous/protocol github.com/status-im/rendezvous/server # github.com/status-im/status-go/extkeys v1.1.0 github.com/status-im/status-go/extkeys -# github.com/status-im/status-go/whisper/v6 v6.2.0 +# github.com/status-im/status-go/whisper/v6 v6.2.1 github.com/status-im/status-go/whisper/v6 # github.com/status-im/tcp-shaker v0.0.0-20191114194237-215893130501 github.com/status-im/tcp-shaker