Skip to content

Commit 33af79e

Browse files
author
colinlyguo
committed
overwrite CheckChunkCompressedDataCompatibility
1 parent ba3a9d0 commit 33af79e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

encoding/codecv8.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
// - checkCompressedDataCompatibility (core method using the new compression)
2323
// - constructBlob (calls checkCompressedDataCompatibility)
2424
// - NewDABatch (calls constructBlob)
25+
// - CheckChunkCompressedDataCompatibility (calls checkCompressedDataCompatibility)
2526
// - CheckBatchCompressedDataCompatibility (calls checkCompressedDataCompatibility)
2627
// - estimateL1CommitBatchSizeAndBlobSize (calls checkCompressedDataCompatibility)
2728
// - EstimateChunkL1CommitBatchSizeAndBlobSize (calls estimateL1CommitBatchSizeAndBlobSize)
@@ -141,6 +142,19 @@ func (d *DACodecV8) constructBlob(batch *Batch) (*kzg4844.Blob, common.Hash, []b
141142
return blob, blobVersionedHash, blobBytes, challengeDigest, nil
142143
}
143144

145+
// CheckChunkCompressedDataCompatibility checks the compressed data compatibility for a batch built from a single chunk.
146+
func (d *DACodecV8) CheckChunkCompressedDataCompatibility(c *Chunk) (bool, error) {
147+
// filling the needed fields for the batch used in the check
148+
b := &Batch{
149+
Chunks: []*Chunk{c},
150+
PrevL1MessageQueueHash: c.PrevL1MessageQueueHash,
151+
PostL1MessageQueueHash: c.PostL1MessageQueueHash,
152+
Blocks: c.Blocks,
153+
}
154+
155+
return d.CheckBatchCompressedDataCompatibility(b)
156+
}
157+
144158
// CheckBatchCompressedDataCompatibility checks the compressed data compatibility for a batch.
145159
func (d *DACodecV8) CheckBatchCompressedDataCompatibility(b *Batch) (bool, error) {
146160
if len(b.Blocks) == 0 {

0 commit comments

Comments
 (0)