From 0c58f4a5596d349c63c9633884c6537dea8b1f00 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Wed, 28 Feb 2024 15:46:59 +0100 Subject: [PATCH] check commitment conversion --- eth/catalyst/simulated_beacon.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eth/catalyst/simulated_beacon.go b/eth/catalyst/simulated_beacon.go index 42d596d000..021ce23795 100644 --- a/eth/catalyst/simulated_beacon.go +++ b/eth/catalyst/simulated_beacon.go @@ -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)) } }