Skip to content

Commit a148283

Browse files
committed
fix issue in estimateL1CommitBatchSizeAndBlobSize
1 parent f8a8d38 commit a148283

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

encoding/codecv7.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ func (d *DACodecV7) CheckBatchCompressedDataCompatibility(b *Batch) (bool, error
268268
}
269269

270270
func (d *DACodecV7) estimateL1CommitBatchSizeAndBlobSize(batch *Batch) (uint64, uint64, error) {
271+
if len(batch.Blocks) == 0 {
272+
return 0, 0, errors.New("batch must contain at least one block")
273+
}
274+
271275
blobBytes := make([]byte, blobEnvelopeV7OffsetPayload)
272276

273277
payloadBytes, err := d.constructBlobPayload(batch)

0 commit comments

Comments
 (0)