fix: store-query issue in v0.37.0

This commit is contained in:
darshankabariya 2025-12-08 23:56:38 +05:30
parent 867c758451
commit 8133e545be
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22
4 changed files with 25 additions and 10 deletions

View File

@ -34,7 +34,7 @@ proc defaultTestWakuConfBuilder*(): WakuConfBuilder =
@[parseIpAddress("1.1.1.1"), parseIpAddress("1.0.0.1")]
)
builder.withNatStrategy("any")
builder.withMaxConnections(200)
builder.withMaxConnections(300)
builder.withRelayServiceRatio("50:50")
builder.withMaxMessageSize("1024 KiB")
builder.withClusterId(DefaultClusterId)

View File

@ -207,8 +207,8 @@ type WakuNodeConf* = object
maxConnections* {.
desc:
"Maximum allowed number of libp2p connections. (Default: 200) can't set it to less than 200",
defaultValue: 200,
"Maximum allowed number of libp2p connections. (Default: 300) can't set it to less than 300",
defaultValue: 300,
name: "max-connections"
.}: int

View File

@ -585,12 +585,16 @@ proc build*(
warn "Peer persistence not specified, defaulting to false"
false
let maxConnections =
if builder.maxConnections.isSome():
builder.maxConnections.get()
else:
warn "Max Connections was not specified, defaulting to 300"
300
var maxConnections: int
if builder.maxConnections.isSome():
var mc = builder.maxConnections.get() # mutable to enforce minimum
if mc < 300:
warn "max-connections less than 300; using default 300", provided = mc
mc = 300
maxConnections = mc
else:
warn "Max Connections was not specified, defaulting to 300"
maxConnections = 300
# TODO: Do the git version thing here
let agentString = builder.agentString.get("nwaku")
@ -660,7 +664,7 @@ proc build*(
agentString: agentString,
colocationLimit: colocationLimit,
maxRelayPeers: builder.maxRelayPeers,
relayServiceRatio: builder.relayServiceRatio.get("60:40"),
relayServiceRatio: builder.relayServiceRatio.get("50:50"),
rateLimit: rateLimit,
circuitRelayClient: builder.circuitRelayClient.get(false),
staticNodes: builder.staticNodes,

View File

@ -231,8 +231,19 @@ proc validateNoEmptyStrings(wakuConf: WakuConf): Result[void, string] =
return ok()
proc validateMaxConnectionsAndRatio(wakuConf: WakuConf): Result[void, string] =
if wakuConf.maxConnections < 300:
return
err("max-connections must be at least 300, provided " & $wakuConf.maxConnections)
if wakuConf.relayServiceRatio != "50:50":
return err(
"relay-service-ratio must be exactly 50:50, provided " & wakuConf.relayServiceRatio
)
ok()
proc validate*(wakuConf: WakuConf): Result[void, string] =
?wakuConf.validateNodeKey()
?wakuConf.shardingConf.validateShards(wakuConf.subscribeShards)
?wakuConf.validateNoEmptyStrings()
?wakuConf.validateMaxConnectionsAndRatio()
return ok()