Skip to content

Commit

Permalink
check blob length before reconstructing rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Nov 4, 2024
1 parent e678d77 commit 4f379a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/enclave/components/rollup_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f379a8

Please sign in to comment.