From d6b9176ef2e055c06f1465e017a8121818c2ecc6 Mon Sep 17 00:00:00 2001 From: colin <102356659+colinlyguo@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:44:57 +0800 Subject: [PATCH] fix(bundle-proposer): add get chunk nil check (#1537) Co-authored-by: colinlyguo --- common/version/version.go | 2 +- rollup/internal/controller/watcher/bundle_proposer.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index a06c232c1..a9b3af2c6 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.64" +var tag = "v4.4.65" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/rollup/internal/controller/watcher/bundle_proposer.go b/rollup/internal/controller/watcher/bundle_proposer.go index 6b67347b2..480a86752 100644 --- a/rollup/internal/controller/watcher/bundle_proposer.go +++ b/rollup/internal/controller/watcher/bundle_proposer.go @@ -2,6 +2,7 @@ package watcher import ( "context" + "errors" "time" "github.com/prometheus/client_golang/prometheus" @@ -146,6 +147,12 @@ func (p *BundleProposer) proposeBundle() error { if err != nil { return err } + + if firstChunk == nil { + log.Error("first chunk not found", "start chunk index", batches[0].StartChunkIndex, "start batch index", batches[0].Index, "firstUnbundledBatchIndex", firstUnbundledBatchIndex) + return errors.New("first chunk not found in proposeBundle") + } + hardforkName := forks.GetHardforkName(p.chainCfg, firstChunk.StartBlockNumber, firstChunk.StartBlockTime) codecVersion := encoding.CodecVersion(batches[0].CodecVersion) for i := 1; i < len(batches); i++ {