check commitment conversion

This commit is contained in:
Sina Mahmoodi 2024-02-28 15:46:59 +01:00
parent 4cc0f14c90
commit 0c58f4a559

View file

@ -206,7 +206,11 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
if envelope.BlobsBundle != nil {
hasher := sha256.New()
for _, commit := range envelope.BlobsBundle.Commitments {
c := kzg4844.Commitment(commit[:])
var c kzg4844.Commitment
if len(commit) != len(c) {
return errors.New("invalid commitment length")
}
copy(c[:], commit)
blobHashes = append(blobHashes, kzg4844.CalcBlobHashV1(hasher, &c))
}
}