From 460036c7b1a4d97c0c87c0671879f2ec94af0dbc Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Thu, 2 Nov 2023 16:06:57 +0800 Subject: [PATCH] fix CI --- rollup/internal/controller/relayer/l2_relayer.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index 2b391c7fa8..6f63c990ca 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -432,7 +432,13 @@ func (r *Layer2Relayer) ProcessCommittedBatches() { switch status { case types.ProvingTaskUnassigned, types.ProvingTaskAssigned: now := time.Now() - elapsedTime := now.Sub(batch.CommittedAt) + + if batch.CommittedAt == nil { + log.Error("batch.CommittedAt is nil", "index", batch.Index, "hash", batch.Hash) + return + } + + elapsedTime := now.Sub(*batch.CommittedAt) if r.cfg.EnableTestEnvBypassFeatures && elapsedTime.Seconds() > float64(r.cfg.FinalizeBatchWithoutProofTimeoutSec) { if err := r.finalizeBatch(batch, false); err != nil { log.Error("Failed to finalize timeout batch without proof", "index", batch.Index, "hash", batch.Hash, "err", err)