Check that blobs count is correct when unblinding (#13118)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
Justin Traglia 2023-10-30 10:49:32 -05:00 committed by GitHub
parent 470ea6d717
commit 159a5dd69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,7 @@ func (u *unblinder) unblindBuilderBlock(ctx context.Context) (interfaces.SignedB
return nil, nil, errors.Wrap(err, "could not get transactions from payload")
}
if wb.Version() >= version.Bellatrix && blobsBundle != nil {
if wb.Version() >= version.Deneb && blobsBundle != nil {
log.WithField("blobCount", len(blobsBundle.Blobs))
}
@ -124,6 +124,9 @@ func unblindBlobsSidecars(blindSidecars []*ethpb.SignedBlindedBlobSidecar, bundl
if bundle == nil {
return nil, nil
}
if len(blindSidecars) != len(bundle.Blobs) {
return nil, errors.Errorf("blob count mismatch: wanted %d but got %d", len(blindSidecars), len(bundle.Blobs))
}
sidecars := make([]*ethpb.SignedBlobSidecar, len(blindSidecars))
for i, b := range blindSidecars {