Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions encoding/codecv7_types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package encoding

import (
"bytes"
"encoding/binary"
"encoding/hex"
"encoding/json"
Expand Down Expand Up @@ -478,17 +477,14 @@ func (c *daChunkV7) Hash() (common.Hash, error) {

// decompressV7Bytes decompresses the given blob bytes into the original payload bytes.
func decompressV7Bytes(compressedBytes []byte) ([]byte, error) {
var res []byte

compressedBytes = append(zstdMagicNumber, compressedBytes...)
r := bytes.NewReader(compressedBytes)
zr, err := zstd.NewReader(r, zstd.WithDecoderConcurrency(1))
zr, err := zstd.NewReader(nil, zstd.WithDecoderConcurrency(1))
if err != nil {
return nil, fmt.Errorf("failed to create zstd reader: %w", err)
}
defer zr.Close()

res, err = zr.DecodeAll(compressedBytes, res)
res, err := zr.DecodeAll(compressedBytes, nil)
if err != nil {
return nil, fmt.Errorf("failed to decompress zstd data: %w", err)
}
Expand Down