chore: reduce unnecessary logging (#991)

This commit is contained in:
Hanno Cornelius 2022-06-08 11:20:18 +02:00 committed by GitHub
parent 1b29dcda7b
commit 0847eec6e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -107,6 +107,11 @@ proc loadFromStorage(pm: PeerManager) =
##################
proc onConnEvent(pm: PeerManager, peerId: PeerID, event: ConnEvent) {.async.} =
if not pm.peerStore.addressBook.contains(peerId):
## We only consider connection events if we
## already track some addresses for this peer
return
case event.kind
of ConnEventKind.Connected:
pm.peerStore.connectionBook[peerId] = Connected

View File

@ -500,7 +500,7 @@ when defined(rln):
## if contentTopic is empty, then validation takes place for All the messages published on the given pubsubTopic
## the message validation logic is according to https://rfc.vac.dev/spec/17/
proc validator(topic: string, message: messages.Message): Future[pubsub.ValidationResult] {.async.} =
debug "rln-relay topic validator is called"
trace "rln-relay topic validator is called"
let msg = WakuMessage.init(message.data)
if msg.isOk():
let
@ -509,7 +509,7 @@ when defined(rln):
# check the contentTopic
if (wakumessage.contentTopic != "") and (contentTopic != "") and (wakumessage.contentTopic != contentTopic):
debug "content topic did not match:", contentTopic=wakumessage.contentTopic, payload=payload
trace "content topic did not match:", contentTopic=wakumessage.contentTopic, payload=payload
return pubsub.ValidationResult.Accept
# validate the message
@ -1044,8 +1044,9 @@ when isMainModule:
# 2/7 Retrieve dynamic bootstrap nodes
proc retrieveDynamicBootstrapNodes(conf: WakuNodeConf): SetupResult[seq[RemotePeerInfo]] =
# DNS discovery
if conf.dnsDiscovery and conf.dnsDiscoveryUrl != "":
# DNS discovery
debug "Discovering nodes using Waku DNS discovery", url=conf.dnsDiscoveryUrl
var nameServers: seq[TransportAddress]
@ -1066,6 +1067,8 @@ when isMainModule:
.mapErr(proc (e: cstring): string = $e)
else:
warn "Failed to init Waku DNS discovery"
ok(newSeq[RemotePeerInfo]()) # Return an empty seq by default
# 3/7 Initialize node
proc initNode(conf: WakuNodeConf,

View File

@ -619,7 +619,7 @@ proc resume*(ws: WakuStore, peerList: Option[seq[RemotePeerInfo]] = none(seq[Rem
# if no peerList is set then query from one of the peers stored in the peer manager
let peerOpt = ws.peerManager.selectPeer(WakuStoreCodec)
if peerOpt.isNone():
error "no suitable remote peers"
warn "no suitable remote peers"
waku_store_errors.inc(labelValues = [dialFailure])
return err("no suitable remote peers")