Skip to content

Commit

Permalink
fix(rln-relay): waitFor startup, otherwise valid proofs will be marke…
Browse files Browse the repository at this point in the history
…d invalid (#1920)
  • Loading branch information
rymnc authored Aug 22, 2023
1 parent 0ac8a7f commit 6c6302f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/wakunode2/app.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
5 changes: 1 addition & 4 deletions waku/node/waku_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c6302f

Please sign in to comment.