mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-12 14:13:07 +00:00
feat: add meaningful is_healthy check to sequencer healthcheck
is_healthy is now true only if the block store is accessible and has produced at least the genesis block. Clients should poll chain_height twice with a delay to verify the sequencer is making progress. Refs #244
This commit is contained in:
parent
4be96ef087
commit
934c333f47
@ -86,9 +86,14 @@ impl<BC: BlockSettlementClientTrait + Send + 'static, IC: IndexerClientTrait + S
|
||||
async fn check_health(&self) -> Result<HealthStatus, ErrorObjectOwned> {
|
||||
let sequencer = self.sequencer.lock().await;
|
||||
let chain_height = sequencer.chain_height();
|
||||
|
||||
// Sequencer is considered healthy if it has produced at least the genesis block.
|
||||
// Clients should poll this endpoint twice with a delay to verify chain_height increases.
|
||||
let is_healthy = sequencer.block_store().latest_block_meta().is_ok();
|
||||
|
||||
Ok(HealthStatus {
|
||||
chain_height,
|
||||
is_healthy: true,
|
||||
is_healthy,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user