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:
ygd58 2026-03-28 19:59:19 +01:00
parent 4be96ef087
commit 934c333f47
No known key found for this signature in database
GPG Key ID: 82B49AE8D5B28600

View File

@ -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,
})
}