mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
let CellProofsAt method only supports version 1
This commit is contained in:
parent
139d3ceed3
commit
ba4a57043d
1 changed files with 3 additions and 7 deletions
|
|
@ -75,18 +75,14 @@ func (sc *BlobTxSidecar) BlobHashes() []common.Hash {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CellProofsAt returns the cell proofs for blob with index idx.
|
// CellProofsAt returns the cell proofs for blob with index idx.
|
||||||
|
// This method is only valid for sidecars with version 1.
|
||||||
func (sc *BlobTxSidecar) CellProofsAt(idx int) []kzg4844.Proof {
|
func (sc *BlobTxSidecar) CellProofsAt(idx int) []kzg4844.Proof {
|
||||||
if sc.Version == 1 {
|
if sc.Version == 1 {
|
||||||
index := idx * kzg4844.CellProofsPerBlob
|
index := idx * kzg4844.CellProofsPerBlob
|
||||||
return sc.Proofs[index : index+kzg4844.CellProofsPerBlob]
|
return sc.Proofs[index : index+kzg4844.CellProofsPerBlob]
|
||||||
}
|
}
|
||||||
|
log.Error("cellProofsAt called with unsupported version", "version", sc.Version)
|
||||||
cellProofs, err := kzg4844.ComputeCellProofs(&sc.Blobs[idx])
|
|
||||||
if err != nil {
|
|
||||||
log.Error("Failed to compute cell proofs for blob", "index", idx, "error", err)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
|
||||||
return cellProofs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// encodedSize computes the RLP size of the sidecar elements. This does NOT return the
|
// encodedSize computes the RLP size of the sidecar elements. This does NOT return the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue