diff --git a/tests/testlib/wakunode.nim b/tests/testlib/wakunode.nim index 58b13bb471..732256ee23 100644 --- a/tests/testlib/wakunode.nim +++ b/tests/testlib/wakunode.nim @@ -33,7 +33,7 @@ proc defaultTestWakuNodeConf*(): WakuNodeConf = maxConnections: 50, maxMessageSize: "1024 KiB", clusterId: 1.uint32, - topics: @["/waku/2/rs/1/0"], + pubsubTopics: @["/waku/2/rs/1/0"], relay: true, storeMessageDbUrl: "sqlite://store.sqlite3", ) @@ -59,7 +59,7 @@ proc newTestWakuNode*( discv5UdpPort = none(Port), agentString = none(string), clusterId: uint32 = 1.uint32, - topics: seq[string] = @["/waku/2/rs/1/0"], + pubsubTopics: seq[string] = @["/waku/2/rs/1/0"], peerStoreCapacity = none(int), ): WakuNode = var resolvedExtIp = extIp @@ -74,7 +74,7 @@ proc newTestWakuNode*( var conf = defaultTestWakuNodeConf() conf.clusterId = clusterId - conf.topics = topics + conf.pubsubTopics = pubsubTopics if dns4DomainName.isSome() and extIp.isNone(): # If there's an error resolving the IP, an exception is thrown and test fails @@ -101,7 +101,7 @@ proc newTestWakuNode*( var enrBuilder = EnrBuilder.init(nodeKey) - enrBuilder.withShardedTopics(topics).isOkOr: + enrBuilder.withShardedTopics(pubsubTopics).isOkOr: raise newException(Defect, "Invalid record: " & error) enrBuilder.withIpAddressAndPorts( diff --git a/waku/factory/external_config.nim b/waku/factory/external_config.nim index a31f31afa7..89bae81356 100644 --- a/waku/factory/external_config.nim +++ b/waku/factory/external_config.nim @@ -297,13 +297,6 @@ type WakuNodeConf* = object name: "keep-alive" .}: bool - topics* {. - desc: - "Default topic to subscribe to. Argument may be repeated. Deprecated! Please use pubsub-topic and/or content-topic instead.", - defaultValue: @["/waku/2/default-waku/proto"], - name: "topic" - .}: seq[string] - pubsubTopics* {. desc: "Default pubsub topic to subscribe to. Argument may be repeated.", name: "pubsub-topic" diff --git a/waku/factory/internal_config.nim b/waku/factory/internal_config.nim index 51829a39b3..8b8a45f600 100644 --- a/waku/factory/internal_config.nim +++ b/waku/factory/internal_config.nim @@ -32,7 +32,7 @@ proc enrConfiguration*( let shards: seq[uint16] = # no shards configured if conf.shards.len == 0: - toSeq(0 ..< conf.topics.len).mapIt(uint16(it)) + toSeq(0 ..< conf.pubsubTopics.len).mapIt(uint16(it)) # some shards configured else: toSeq(conf.shards.mapIt(uint16(it))) diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index 9973036ccf..c2c3db0fd9 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -140,15 +140,9 @@ proc setupProtocols( peerExchangeHandler = some(handlePeerExchange) if conf.relay: - let pubsubTopics = - if conf.pubsubTopics.len > 0 or conf.contentTopics.len > 0: - # TODO autoshard content topics only once. - # Already checked for errors in app.init - let shards = - conf.contentTopics.mapIt(node.wakuSharding.getShard(it).expect("Valid Shard")) - conf.pubsubTopics & shards - else: - conf.topics + let shards = + conf.contentTopics.mapIt(node.wakuSharding.getShard(it).expect("Valid Shard")) + let pubsubTopics = conf.pubsubTopics & shards let parsedMaxMsgSize = parseMsgSize(conf.maxMessageSize).valueOr: return err("failed to parse 'max-num-bytes-msg-size' param: " & $error)