core/types: BlobHashes should iterate Commitments (#35109)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Previously was iterating Blobs, but that could cause panic if the sidecar is malformed.
This commit is contained in:
cui 2026-06-05 01:17:46 +08:00 committed by GitHub
parent dcf6d0c135
commit f5c62d0552
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ func NewBlobTxSidecar(version byte, blobs []kzg4844.Blob, commitments []kzg4844.
func (sc *BlobTxSidecar) BlobHashes() []common.Hash { func (sc *BlobTxSidecar) BlobHashes() []common.Hash {
hasher := sha256.New() hasher := sha256.New()
h := make([]common.Hash, len(sc.Commitments)) h := make([]common.Hash, len(sc.Commitments))
for i := range sc.Blobs { for i := range sc.Commitments {
h[i] = kzg4844.CalcBlobHashV1(hasher, &sc.Commitments[i]) h[i] = kzg4844.CalcBlobHashV1(hasher, &sc.Commitments[i])
} }
return h return h