From ba596bc635d3dbb353e338c5dd1337d709032dce Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 19 Feb 2025 15:42:29 -0800 Subject: [PATCH] func docs --- core/types/tx_blob.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/types/tx_blob.go b/core/types/tx_blob.go index 482b47da27..32401db101 100644 --- a/core/types/tx_blob.go +++ b/core/types/tx_blob.go @@ -86,18 +86,12 @@ func (sc *BlobTxSidecar) encodedSize() uint64 { return rlp.ListSize(blobs) + rlp.ListSize(commitments) + rlp.ListSize(proofs) } +// ValidateBlobCommitmentHashes checks whether the given hashes correspond to the +// commitments in the sidecar func (sc *BlobTxSidecar) ValidateBlobCommitmentHashes(hashes []common.Hash) error { - if len(sc.Blobs) != len(hashes) { - return fmt.Errorf("invalid number of %d blobs compared to %d blob hashes", len(sc.Blobs), len(hashes)) - } if len(sc.Commitments) != len(hashes) { return fmt.Errorf("invalid number of %d blob commitments compared to %d blob hashes", len(sc.Commitments), len(hashes)) } - if len(sc.Proofs) != len(hashes) { - return fmt.Errorf("invalid number of %d blob proofs compared to %d blob hashes", len(sc.Proofs), len(hashes)) - } - // Blob quantities match up, validate that the provers match with the - // transaction hash before getting to the cryptography hasher := sha256.New() for i, vhash := range hashes { computed := kzg4844.CalcBlobHashV1(hasher, &sc.Commitments[i])