mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-04-21 15:43:07 +00:00
fix: add lastEpoch when using zerokit, and missing return (#1210)
This commit is contained in:
parent
52a397ab82
commit
7e8a7ccc71
@ -147,6 +147,7 @@ when defined(rlnzerokit):
|
|||||||
contentTopic*: string
|
contentTopic*: string
|
||||||
# the log of nullifiers and Shamir shares of the past messages grouped per epoch
|
# the log of nullifiers and Shamir shares of the past messages grouped per epoch
|
||||||
nullifierLog*: Table[Epoch, seq[ProofMetadata]]
|
nullifierLog*: Table[Epoch, seq[ProofMetadata]]
|
||||||
|
lastEpoch*: Epoch # the epoch of the last published rln message
|
||||||
validMerkleRoots*: Deque[MerkleNode] # An array of valid merkle roots, which are updated in a FIFO fashion
|
validMerkleRoots*: Deque[MerkleNode] # An array of valid merkle roots, which are updated in a FIFO fashion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1158,7 +1158,7 @@ proc mount(node: WakuNode,
|
|||||||
info "WakuRLNRelay is mounted successfully", pubsubtopic=conf.rlnRelayPubsubTopic, contentTopic=conf.rlnRelayContentTopic
|
info "WakuRLNRelay is mounted successfully", pubsubtopic=conf.rlnRelayPubsubTopic, contentTopic=conf.rlnRelayContentTopic
|
||||||
return ok(true)
|
return ok(true)
|
||||||
else: # mount the rln relay protocol in the on-chain/dynamic mode
|
else: # mount the rln relay protocol in the on-chain/dynamic mode
|
||||||
info " setting up waku-rln-relay in on-chain mode... "
|
echo " setting up waku-rln-relay in on-chain mode... "
|
||||||
|
|
||||||
# read related inputs to run rln-relay in on-chain mode and do type conversion when needed
|
# read related inputs to run rln-relay in on-chain mode and do type conversion when needed
|
||||||
let
|
let
|
||||||
@ -1174,7 +1174,7 @@ proc mount(node: WakuNode,
|
|||||||
# if there is a credential file, then no new credentials are generated, instead the content of the file is read and used to mount rln-relay
|
# if there is a credential file, then no new credentials are generated, instead the content of the file is read and used to mount rln-relay
|
||||||
if conf.rlnRelayCredPath != "":
|
if conf.rlnRelayCredPath != "":
|
||||||
let rlnRelayCredPath = joinPath(conf.rlnRelayCredPath, RlnCredentialsFilename)
|
let rlnRelayCredPath = joinPath(conf.rlnRelayCredPath, RlnCredentialsFilename)
|
||||||
debug "rln-relay credential path", rlnRelayCredPath=rlnRelayCredPath
|
debug "rln-relay credential path", rlnRelayCredPath
|
||||||
# check if there is an rln-relay credential file in the supplied path
|
# check if there is an rln-relay credential file in the supplied path
|
||||||
if fileExists(rlnRelayCredPath):
|
if fileExists(rlnRelayCredPath):
|
||||||
# retrieve rln-relay credential
|
# retrieve rln-relay credential
|
||||||
@ -1185,6 +1185,7 @@ proc mount(node: WakuNode,
|
|||||||
ethAccountPrivKeyOpt = ethAccountPrivKeyOpt, pubsubTopic = conf.rlnRelayPubsubTopic, contentTopic = conf.rlnRelayContentTopic, spamHandler = spamHandler, registrationHandler = registrationHandler)
|
ethAccountPrivKeyOpt = ethAccountPrivKeyOpt, pubsubTopic = conf.rlnRelayPubsubTopic, contentTopic = conf.rlnRelayContentTopic, spamHandler = spamHandler, registrationHandler = registrationHandler)
|
||||||
if res.isErr:
|
if res.isErr:
|
||||||
return err("dynamic rln-relay could not be mounted: " & res.error())
|
return err("dynamic rln-relay could not be mounted: " & res.error())
|
||||||
|
|
||||||
else: # there is no credential file available in the supplied path
|
else: # there is no credential file available in the supplied path
|
||||||
# mount the rln-relay protocol leaving rln-relay credentials arguments unassigned
|
# mount the rln-relay protocol leaving rln-relay credentials arguments unassigned
|
||||||
# this infroms mountRlnRelayDynamic proc that new credentials should be generated and registered to the membership contract
|
# this infroms mountRlnRelayDynamic proc that new credentials should be generated and registered to the membership contract
|
||||||
@ -1210,7 +1211,8 @@ proc mount(node: WakuNode,
|
|||||||
contentTopic = conf.rlnRelayContentTopic, spamHandler = spamHandler, registrationHandler = registrationHandler)
|
contentTopic = conf.rlnRelayContentTopic, spamHandler = spamHandler, registrationHandler = registrationHandler)
|
||||||
if res.isErr:
|
if res.isErr:
|
||||||
return err("dynamic rln-relay could not be mounted: " & res.error())
|
return err("dynamic rln-relay could not be mounted: " & res.error())
|
||||||
return ok(true)
|
|
||||||
|
return ok(true)
|
||||||
|
|
||||||
|
|
||||||
proc mountRlnRelay*(node: WakuNode,
|
proc mountRlnRelay*(node: WakuNode,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user