Skip to content

Commit

Permalink
completely remove pubsubTopics config param
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Jan 29, 2025
1 parent 287e9b1 commit ec906b6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion apps/liteprotocoltester/liteprotocoltester.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
4 changes: 0 additions & 4 deletions examples/wakustealthcommitments/node_spec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions waku/factory/external_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
24 changes: 0 additions & 24 deletions waku/factory/waku.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec906b6

Please sign in to comment.