fix(rln-relay): waitFor startup, otherwise valid proofs will be marked invalid (#1920)

This commit is contained in:
Aaryamann Challani
2023-08-22 17:47:06 +05:30
committed by GitHub
parent 0ac8a7f0cd
commit 6c6302f9e1
3 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -515,7 +515,7 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
rlnRelayCredentialsPassword: conf.rlnRelayCredentialsPassword
)
await node.mountRlnRelay(rlnConf,
waitFor node.mountRlnRelay(rlnConf,
spamHandler=some(spamHandler))
let membershipIndex = node.wakuRlnRelay.groupManager.membershipIndex.get()
+1 -1
View File
@@ -408,7 +408,7 @@ proc setupProtocols(node: WakuNode,
)
try:
await node.mountRlnRelay(rlnConf)
waitFor node.mountRlnRelay(rlnConf)
except CatchableError:
return err("failed to mount waku RLN relay protocol: " & getCurrentExceptionMsg())
+1 -4
View File
@@ -731,11 +731,8 @@ when defined(rln):
if node.wakuRelay.isNil():
raise newException(CatchableError, "WakuRelay protocol is not mounted, cannot mount WakuRlnRelay")
# TODO: check whether the pubsub topic is supported at the relay level
# if rlnConf.rlnRelayPubsubTopic notin node.wakuRelay.defaultPubsubTopics:
# error "The relay protocol does not support the configured pubsub topic for WakuRlnRelay"
let rlnRelayRes = await WakuRlnRelay.new(rlnConf,
let rlnRelayRes = waitFor WakuRlnRelay.new(rlnConf,
registrationHandler)
if rlnRelayRes.isErr():
raise newException(CatchableError, "failed to mount WakuRlnRelay: " & rlnRelayRes.error)