Skip to content

Commit 4d314b3

Browse files
setting num-shards-in-network to 0 by default (#3748)
Co-authored-by: darshankabariya <darshan@status.im>
1 parent b2e46b6 commit 4d314b3

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/wakunode2/test_cli_args.nim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import
2323
suite "Waku external config - default values":
2424
test "Default sharding value":
2525
## Setup
26-
let defaultShardingMode = AutoSharding
27-
let defaultNumShardsInCluster = 1.uint16
28-
let defaultSubscribeShards = @[0.uint16]
26+
let defaultShardingMode = StaticSharding
27+
let defaultSubscribeShards: seq[uint16] = @[]
2928

3029
## Given
3130
let preConfig = defaultWakuNodeConf().get()
@@ -37,7 +36,6 @@ suite "Waku external config - default values":
3736
## Then
3837
let conf = res.get()
3938
check conf.shardingConf.kind == defaultShardingMode
40-
check conf.shardingConf.numShardsInCluster == defaultNumShardsInCluster
4139
check conf.subscribeShards == defaultSubscribeShards
4240

4341
test "Default shards value in static sharding":
@@ -212,7 +210,7 @@ suite "Waku external config - Shards":
212210
let vRes = wakuConf.validate()
213211
assert vRes.isOk(), $vRes.error
214212

215-
test "Imvalid shard is passed without num shards":
213+
test "Any shard is valid without num shards in static sharding mode":
216214
## Setup
217215

218216
## Given
@@ -222,7 +220,9 @@ suite "Waku external config - Shards":
222220
let res = wakuNodeConf.toWakuConf()
223221

224222
## Then
225-
assert res.isErr(), "Invalid shard was accepted"
223+
let wakuConf = res.get()
224+
let vRes = wakuConf.validate()
225+
assert vRes.isOk(), $vRes.error
226226

227227
suite "Waku external config - store retention policy":
228228
test "Default retention policy":

tools/confutils/cli_args.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ hence would have reachability issues.""",
333333
numShardsInNetwork* {.
334334
desc:
335335
"Enables autosharding and set number of shards in the cluster, set to `0` to use static sharding",
336-
defaultValue: 1,
336+
defaultValue: 0,
337337
name: "num-shards-in-network"
338338
.}: uint16
339339

0 commit comments

Comments
 (0)