From ec906b646f5cdd6aa39e024bb4f5e686d695dc18 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Wed, 29 Jan 2025 01:24:28 +0100 Subject: [PATCH] completely remove pubsubTopics config param --- .../liteprotocoltester/liteprotocoltester.nim | 1 - examples/wakustealthcommitments/node_spec.nim | 4 ---- waku/factory/external_config.nim | 7 ------ waku/factory/waku.nim | 24 ------------------- 4 files changed, 36 deletions(-) diff --git a/apps/liteprotocoltester/liteprotocoltester.nim b/apps/liteprotocoltester/liteprotocoltester.nim index 5f6ec4ee08..f9ebd14a31 100644 --- a/apps/liteprotocoltester/liteprotocoltester.nim +++ b/apps/liteprotocoltester/liteprotocoltester.nim @@ -99,7 +99,6 @@ when isMainModule: wakuConf.dnsAddrs = true wakuConf.dnsAddrsNameServers = @[parseIpAddress("8.8.8.8"), parseIpAddress("1.1.1.1")] - wakuConf.pubsubTopics = conf.pubsubTopics wakuConf.contentTopics = conf.contentTopics wakuConf.clusterId = conf.clusterId ## TODO: Depending on the tester needs we might extend here with shards, clusterId, etc... diff --git a/examples/wakustealthcommitments/node_spec.nim b/examples/wakustealthcommitments/node_spec.nim index dbab8a3b22..435a98d2f0 100644 --- a/examples/wakustealthcommitments/node_spec.nim +++ b/examples/wakustealthcommitments/node_spec.nim @@ -26,10 +26,6 @@ proc setup*(): Waku = var conf = confRes.get() let twnClusterConf = ClusterConf.TheWakuNetworkConf() - if len(conf.shards) != 0: - conf.pubsubTopics = conf.shards.mapIt(twnClusterConf.pubsubTopics[it.uint16]) - else: - conf.pubsubTopics = twnClusterConf.pubsubTopics # Override configuration conf.maxMessageSize = twnClusterConf.maxMessageSize diff --git a/waku/factory/external_config.nim b/waku/factory/external_config.nim index 3ba24d54d8..2c12337f8e 100644 --- a/waku/factory/external_config.nim +++ b/waku/factory/external_config.nim @@ -334,13 +334,6 @@ hence would have reachability issues.""", name: "num-shards-in-network" .}: uint32 - pubsubTopics* {. - desc: - "Deprecated. Default pubsub topic to subscribe to. Argument may be repeated.", - defaultValue: @[], - name: "pubsub-topic" - .}: seq[string] - shards* {. desc: "Shards index to subscribe to [0..NUM_SHARDS_IN_NETWORK-1]. Argument may be repeated.", diff --git a/waku/factory/waku.nim b/waku/factory/waku.nim index 37b5b37289..d09ab6ada0 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -190,30 +190,6 @@ proc new*( logging.setupLog(confCopy.logLevel, confCopy.logFormat) - # TODO: remove after pubsubtopic config gets removed - var shards = newSeq[uint16]() - if confCopy.pubsubTopics.len > 0: - let shardsRes = topicsToRelayShards(confCopy.pubsubTopics) - if shardsRes.isErr(): - error "failed to parse pubsub topic, please format according to static shard specification", - error = shardsRes.error - return err("failed to parse pubsub topic: " & $shardsRes.error) - - let shardsOpt = shardsRes.get() - - if shardsOpt.isSome(): - let relayShards = shardsOpt.get() - if relayShards.clusterId != confCopy.clusterId: - error "clusterId of the pubsub topic should match the node's cluster. e.g. --pubsub-topic=/waku/2/rs/22/1 and --cluster-id=22", - nodeCluster = confCopy.clusterId, pubsubCluster = relayShards.clusterId - return err( - "clusterId of the pubsub topic should match the node's cluster. e.g. --pubsub-topic=/waku/2/rs/22/1 and --cluster-id=22" - ) - - for shard in relayShards.shardIds: - shards.add(shard) - confCopy.shards = shards - case confCopy.clusterId # cluster-id=1 (aka The Waku Network)