mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-29 13:00:06 +00:00
remove requirement for relay when mounting RLN
This commit is contained in:
parent
cad22fbfc8
commit
f460815ee4
@ -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 Rln"
|
||||
)
|
||||
|
||||
let rln = (await Rln.new(rlnConf, registrationHandler)).valueOr:
|
||||
raise newException(CatchableError, "failed to mount Rln: " & error)
|
||||
if (rlnConf.userMessageLimit > rln.groupManager.rlnRelayMaxMessageLimit):
|
||||
error "rln-relay-user-message-limit can't exceed the MAX_MESSAGE_LIMIT in the rln contract"
|
||||
|
||||
node.rln = rln
|
||||
|
||||
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.rln = rln
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user