mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-08 00:43:06 +00:00
chore(rln-relay): health check should account for window of roots (#2664)
* test(rln-relay): health check should account for window of roots * fix: some type-fu * fix: widen the type vs narrowing * fix: add extra parens
This commit is contained in:
parent
c3aa80284f
commit
bd8b659247
@ -855,7 +855,8 @@ method isReady*(g: OnchainGroupManager): Future[bool] {.async.} =
|
|||||||
g.retryWrapper(currentBlock, "Failed to get the current block number"):
|
g.retryWrapper(currentBlock, "Failed to get the current block number"):
|
||||||
cast[BlockNumber](await g.ethRpc.get().provider.eth_blockNumber())
|
cast[BlockNumber](await g.ethRpc.get().provider.eth_blockNumber())
|
||||||
|
|
||||||
if g.latestProcessedBlock < currentBlock:
|
# the node is still able to process messages if it is behind the latest block by a factor of the valid roots
|
||||||
|
if u256(g.latestProcessedBlock) < (u256(currentBlock) - u256(g.validRoots.len)):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
return not (await g.isSyncing())
|
return not (await g.isSyncing())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user