diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index 13c7234dc5..5be2aec345 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -505,10 +505,14 @@ func (r *Layer2Relayer) ProcessPendingBundles() { r.metrics.rollupL2RelayerProcessPendingBundlesTotal.Inc() bundle, err := r.bundleOrm.GetFirstPendingBundle(r.ctx) + if bundle == nil && err == nil { + return + } if err != nil { log.Error("Failed to fetch first pending L2 bundle", "err", err) return } + status := types.ProvingStatus(bundle.ProvingStatus) switch status { case types.ProvingTaskUnassigned, types.ProvingTaskAssigned: diff --git a/rollup/internal/orm/bundle.go b/rollup/internal/orm/bundle.go index afd861729d..28ed3209bd 100644 --- a/rollup/internal/orm/bundle.go +++ b/rollup/internal/orm/bundle.go @@ -126,6 +126,9 @@ func (o *Bundle) GetFirstPendingBundle(ctx context.Context) (*Bundle, error) { var pendingBundle Bundle if err := db.First(&pendingBundle).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil, nil + } return nil, fmt.Errorf("Bundle.GetFirstPendingBundle error: %w", err) } return &pendingBundle, nil