mirror of https://github.com/waku-org/nwaku.git
fix(rln-relay): waku_rln_number_registered_memberships metrics appropriately handled (#2018)
This commit is contained in:
parent
47ae19c104
commit
a4e783303c
|
@ -105,7 +105,8 @@ method atomicBatch*(g: OnchainGroupManager,
|
||||||
let operationSuccess = g.rlnInstance.atomicWrite(some(start), idCommitments, toRemoveIndices)
|
let operationSuccess = g.rlnInstance.atomicWrite(some(start), idCommitments, toRemoveIndices)
|
||||||
if not operationSuccess:
|
if not operationSuccess:
|
||||||
raise newException(ValueError, "atomic batch operation failed")
|
raise newException(ValueError, "atomic batch operation failed")
|
||||||
waku_rln_number_registered_memberships.inc(int64(idCommitments.len - toRemoveIndices.len))
|
# TODO: when slashing is enabled, we need to track slashed members
|
||||||
|
waku_rln_number_registered_memberships.set(int64(start.int + idCommitments.len - toRemoveIndices.len))
|
||||||
|
|
||||||
if g.registerCb.isSome():
|
if g.registerCb.isSome():
|
||||||
var membersSeq = newSeq[Membership]()
|
var membersSeq = newSeq[Membership]()
|
||||||
|
@ -304,7 +305,7 @@ proc getAndHandleEvents(g: OnchainGroupManager,
|
||||||
toBlock: BlockNumber): Future[void] {.async.} =
|
toBlock: BlockNumber): Future[void] {.async.} =
|
||||||
initializedGuard(g)
|
initializedGuard(g)
|
||||||
|
|
||||||
let blockTable = await g.getBlockTable(fromBlock, toBlock)
|
let blockTable = await g.getBlockTable(fromBlock, toBlock)
|
||||||
await g.handleEvents(blockTable)
|
await g.handleEvents(blockTable)
|
||||||
await g.handleRemovedEvents(blockTable)
|
await g.handleRemovedEvents(blockTable)
|
||||||
|
|
||||||
|
@ -544,4 +545,4 @@ method isReady*(g: OnchainGroupManager): Future[bool] {.async,gcsafe.} =
|
||||||
if g.latestProcessedBlock < currentBlock:
|
if g.latestProcessedBlock < currentBlock:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
return not (await g.isSyncing())
|
return not (await g.isSyncing())
|
||||||
|
|
|
@ -35,7 +35,8 @@ declarePublicHistogram(identifier = waku_rln_valid_messages_total,
|
||||||
buckets = generateBucketsForHistogram(AcceptableRootWindowSize))
|
buckets = generateBucketsForHistogram(AcceptableRootWindowSize))
|
||||||
declarePublicCounter(waku_rln_errors_total, "number of errors detected while operating the rln relay", ["type"])
|
declarePublicCounter(waku_rln_errors_total, "number of errors detected while operating the rln relay", ["type"])
|
||||||
declarePublicCounter(waku_rln_proof_verification_total, "number of times the rln proofs are verified")
|
declarePublicCounter(waku_rln_proof_verification_total, "number of times the rln proofs are verified")
|
||||||
declarePublicCounter(waku_rln_number_registered_memberships, "number of registered and active rln memberships")
|
# this is a gauge so that we can set it based on the events we receive
|
||||||
|
declarePublicGauge(waku_rln_number_registered_memberships, "number of registered and active rln memberships")
|
||||||
|
|
||||||
# Timing metrics
|
# Timing metrics
|
||||||
declarePublicGauge(waku_rln_proof_verification_duration_seconds, "time taken to verify a proof")
|
declarePublicGauge(waku_rln_proof_verification_duration_seconds, "time taken to verify a proof")
|
||||||
|
|
Loading…
Reference in New Issue