From 9778b45c6753c23993b0f3d7a2d051a167670164 Mon Sep 17 00:00:00 2001 From: fryorcraken <110212804+fryorcraken@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:11:18 +1100 Subject: [PATCH] chore!: remove pubsub topics arguments (#3350) Use `--shards` instead. --- waku/factory/external_config.nim | 7 ------- waku/factory/waku.nim | 25 ------------------------- 2 files changed, 32 deletions(-) diff --git a/waku/factory/external_config.nim b/waku/factory/external_config.nim index 100d1b644..41fc25582 100644 --- a/waku/factory/external_config.nim +++ b/waku/factory/external_config.nim @@ -344,13 +344,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 854df8dde..91f3cee2e 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -177,31 +177,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 - - # Why can't I replace this block with a concise `.valueOr`? confCopy = block: let res = applyPresetConfiguration(confCopy) if res.isErr():