From 4f379a8a138db468f94ed040851860d2a6767b4a Mon Sep 17 00:00:00 2001 From: Will Hester Date: Mon, 4 Nov 2024 17:32:17 +0000 Subject: [PATCH] check blob length before reconstructing rollup --- go/enclave/components/rollup_consumer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/enclave/components/rollup_consumer.go b/go/enclave/components/rollup_consumer.go index 5f4ed38c5f..fad4ad764f 100644 --- a/go/enclave/components/rollup_consumer.go +++ b/go/enclave/components/rollup_consumer.go @@ -145,6 +145,11 @@ func (rc *rollupConsumerImpl) extractAndVerifyRollups(br *common.BlockAndReceipt continue // Blob hashes don't match, skip this rollup } + // Check if we have all required blobs + if len(blobs) < len(rollupHashes.BlobHashes) { + return nil, fmt.Errorf("insufficient blobs for rollup reconstruction: have %d, need %d", len(blobs), len(rollupHashes.BlobHashes)) + } + r, err := ethadapter.ReconstructRollup(blobs) if err != nil { // This is a critical error because we've already verified the blob hashes