Skip to content

Commit

Permalink
chore: simplify and do it every epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
darshankabariya committed Dec 17, 2024
1 parent 6130c5e commit 2aaf95e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vendor/nimbus-build-system
5 changes: 2 additions & 3 deletions waku/waku_rln_relay/rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,15 @@ proc generateRlnValidator*(
return validator

proc monitorEpochs(wakuRlnRelay: WakuRLNRelay): Future[void] {.async.} =
let nextEpochTime = wakuRlnRelay.nextEpoch(epochTime())
await sleepAsync(int((nextEpochTime - epochTime()) * 1000))

while true:
try:
waku_rln_remaining_proofs_per_epoch.set(
wakuRlnRelay.groupManager.userMessageLimit.get().float64
)
except CatchableError:
error "Error in epoch monitoring", error = getCurrentExceptionMsg()

let nextEpochTime = wakuRlnRelay.nextEpoch(epochTime())
await sleepAsync(int(wakuRlnRelay.rlnEpochSizeSec * 1000))

proc mount(
Expand Down

0 comments on commit 2aaf95e

Please sign in to comment.