From eee5176e039e196298f61f2f6b67ba0cd47797ac Mon Sep 17 00:00:00 2001 From: otherview Date: Fri, 29 Dec 2023 14:38:14 +0000 Subject: [PATCH] pr comments --- go/enclave/components/batch_registry.go | 1 + go/enclave/components/block_processor.go | 1 + 2 files changed, 2 insertions(+) diff --git a/go/enclave/components/batch_registry.go b/go/enclave/components/batch_registry.go index efaf1cf1b3..94eb0aede5 100644 --- a/go/enclave/components/batch_registry.go +++ b/go/enclave/components/batch_registry.go @@ -202,6 +202,7 @@ func (br *batchRegistry) GetBatchAtHeight(height gethrpc.BlockNumber) (*core.Bat return batch, nil } +// HealthCheck checks if the last executed batch was more than healthTimeout ago func (br *batchRegistry) HealthCheck() (bool, error) { lastExecutedBatchTime := br.lastExecutedBatch.LastTimestamp() if time.Now().After(lastExecutedBatchTime.Add(br.healthTimeout)) { diff --git a/go/enclave/components/block_processor.go b/go/enclave/components/block_processor.go index c211ba17a2..a80b893004 100644 --- a/go/enclave/components/block_processor.go +++ b/go/enclave/components/block_processor.go @@ -86,6 +86,7 @@ func (bp *l1BlockProcessor) Process(br *common.BlockAndReceipts) (*BlockIngestio return ingestion, nil } +// HealthCheck checks if the last ingested block was more than healthTimeout ago func (bp *l1BlockProcessor) HealthCheck() (bool, error) { lastIngestedBlockTime := bp.lastIngestedBlock.LastTimestamp() if time.Now().After(lastIngestedBlockTime.Add(bp.healthTimeout)) {