mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-08-01 13:03:30 +00:00
remove requirement for relay when mounting RLN
This commit is contained in:
parent
bf60d61def
commit
dffc85d085
@ -193,16 +193,17 @@ proc mountRlnRelay*(
|
||||
) {.async.} =
|
||||
info "mounting rln relay"
|
||||
|
||||
if node.wakuRelay.isNil():
|
||||
raise newException(
|
||||
CatchableError, "WakuRelay protocol is not mounted, cannot mount WakuRln"
|
||||
)
|
||||
|
||||
let rlnRelay = (await WakuRln.new(rlnConf, registrationHandler)).valueOr:
|
||||
raise newException(CatchableError, "failed to mount WakuRln: " & error)
|
||||
if (rlnConf.userMessageLimit > rlnRelay.groupManager.rlnRelayMaxMessageLimit):
|
||||
error "rln-relay-user-message-limit can't exceed the MAX_MESSAGE_LIMIT in the rln contract"
|
||||
|
||||
node.wakuRlnRelay = rlnRelay
|
||||
|
||||
if node.wakuRelay.isNil():
|
||||
info "WakuRelay not mounted; RLN mounted without relay validator"
|
||||
return
|
||||
|
||||
## Bridges RLN's protocol-agnostic message validation into a relay
|
||||
## (gossipsub) validator. The core decision is made by
|
||||
## `validateMessageAndUpdateLog`; this maps the result to
|
||||
@ -262,5 +263,3 @@ proc mountRlnRelay*(
|
||||
# register rln validator as default validator
|
||||
info "Registering RLN validator"
|
||||
node.wakuRelay.addValidator(validator, "RLN validation failed")
|
||||
|
||||
node.wakuRlnRelay = rlnRelay
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user