From 32675a8471167c13d569f1ff26c28a0e9d1e8bd2 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Fri, 31 May 2024 16:06:46 +0200 Subject: [PATCH] implementing comments --- waku/factory/node_factory.nim | 8 +------- waku/node/peer_manager/peer_manager.nim | 5 ----- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index 58026663e..f3cbb7fe7 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -117,16 +117,10 @@ proc setupProtocols( ## Optionally include persistent message storage. ## No protocols are started yet. - var shardCount: uint32 - if conf.pubsubTopics.len > 0: - shardCount = uint32(conf.pubsubTopics.len) - else: - shardCount = uint32(conf.shards.len) - node.mountMetadata(conf.clusterId).isOkOr: return err("failed to mount waku metadata protocol: " & error) - node.mountSharding(conf.clusterId, shardCount).isOkOr: + node.mountSharding(conf.clusterId, uint32(conf.pubsubTopics.len)).isOkOr: return err("failed to mount waku sharding: " & error) # Mount relay on all nodes diff --git a/waku/node/peer_manager/peer_manager.nim b/waku/node/peer_manager/peer_manager.nim index 679041580..798b4a14c 100644 --- a/waku/node/peer_manager/peer_manager.nim +++ b/waku/node/peer_manager/peer_manager.nim @@ -348,11 +348,6 @@ proc onConnEvent(pm: PeerManager, peerId: PeerID, event: ConnEvent) {.async.} = discard proc onPeerMetadata(pm: PeerManager, peerId: PeerId) {.async.} = - # To prevent metadata protocol from breaking prev nodes, by now we only - # disconnect if the clusterid is specified. - if pm.wakuMetadata.clusterId == 0: - return - let res = catch: await pm.switch.dial(peerId, WakuMetadataCodec)