diff --git a/libp2p/protocols/identify.nim b/libp2p/protocols/identify.nim index 3c7ce2381..8a5aa273a 100644 --- a/libp2p/protocols/identify.nim +++ b/libp2p/protocols/identify.nim @@ -87,7 +87,7 @@ proc decodeMsg*(buf: seq[byte]): Option[IdentifyInfo] = iinfo.protoVersion = some(protoVersion) if r6.get(): iinfo.agentVersion = some(agentVersion) - trace "decodeMsg: decoded message", pubkey = ($pubKey).shortLog, + debug "decodeMsg: decoded message", pubkey = ($pubKey).shortLog, addresses = $iinfo.addrs, protocols = $iinfo.protos, observable_address = $iinfo.observedAddr, proto_version = $iinfo.protoVersion, diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index f6a0bf102..7e24d4447 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -181,7 +181,7 @@ proc init*(_: type[GossipSubParams]): GossipSubParams = decayInterval: 1.seconds, decayToZero: 0.01, retainScore: 10.seconds, - appSpecificWeight: 1.0, + appSpecificWeight: 0.0, ipColocationFactorWeight: 0.0, ipColocationFactorThreshold: 1.0, behaviourPenaltyWeight: -1.0, @@ -621,6 +621,8 @@ proc updateScores(g: GossipSub) = # avoid async for peer, stats in g.peerStats.mpairs: trace "updating peer score", peer + var n_topics = 0 + var is_grafted = 0 if not peer.connected: if now > stats.expire: @@ -631,11 +633,13 @@ proc updateScores(g: GossipSub) = # avoid async # Per topic for topic, topicParams in g.topicParams: var info = stats.topicInfos.getOrDefault(topic) + inc n_topics # Scoring var topicScore = 0'f64 if info.inMesh: + inc is_grafted info.meshTime = now - info.graftTime if info.meshTime > topicParams.meshMessageDeliveriesActivation: info.meshMessageDeliveriesActive = true @@ -701,7 +705,7 @@ proc updateScores(g: GossipSub) = # avoid async if peer.behaviourPenalty < g.parameters.decayToZero: peer.behaviourPenalty = 0 - trace "updated peer's score", peer, score = peer.score + debug "updated peer's score", peer, score = peer.score, n_topics, is_grafted for peer in evicting: g.peerStats.del(peer) diff --git a/libp2p/switch.nim b/libp2p/switch.nim index 61255f9a5..e396d7bb3 100644 --- a/libp2p/switch.nim +++ b/libp2p/switch.nim @@ -258,11 +258,6 @@ proc upgradeIncoming(s: Switch, conn: Connection) {.async, gcsafe.} = for muxer in s.muxers.values: ms.addHandler(muxer.codecs, muxer) - # add the mounted protocols - # notice this should be kept in sync ... - for handler in s.ms.handlers: - ms.handlers &= handler - # handle subsequent secure requests await ms.handle(sconn) diff --git a/libp2p/utility.nim b/libp2p/utility.nim index 70b034dac..94307d139 100644 --- a/libp2p/utility.nim +++ b/libp2p/utility.nim @@ -35,10 +35,3 @@ func shortLog*(item: string): string = result &= item[0..