Skip to content

Commit

Permalink
chore: backward compitibility
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya committed Jan 20, 2025
1 parent 16caad0 commit 03609a2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions waku/factory/node_factory.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,18 @@ proc initNode(
relayRatio = (maxRelayPeers.float / maxConnections.float) * 100
serviceRatio = 100 - relayRatio

# Override the relayServiceRatio in config
conf.relayServiceRatio = $relayRatio & ":" & $serviceRatio

builder.withPeerManagerConfig(
maxConnections = conf.maxConnections,
relayServiceRatio = $relayRatio & ":" & $serviceRatio,
shardAware = conf.relayShardedPeerManagement,
)
error "maxRelayPeers is deprecated. It is recommended to use relayServiceRatio instead. If relayServiceRatio is not set, it will be automatically calculated based on maxConnections and maxRelayPeers."

builder.withPeerManagerConfig(
maxConnections = conf.maxConnections,
relayServiceRatio = conf.relayServiceRatio,
shardAware = conf.relayShardedPeerManagement,
)
else:
builder.withPeerManagerConfig(
maxConnections = conf.maxConnections,
relayServiceRatio = conf.relayServiceRatio,
shardAware = conf.relayShardedPeerManagement,
)
builder.withRateLimit(conf.rateLimits)
builder.withCircuitRelay(relay)

Expand Down

0 comments on commit 03609a2

Please sign in to comment.