Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ public boolean isDataAvailable(
final Bytes32 beaconBlockRoot,
final List<KZGCommitment> kzgCommitments,
final List<BlobSidecar> blobSidecars) {
validateBlobs(slot, beaconBlockRoot, kzgCommitments, blobSidecars);
return true;
}

/**
* <a
* href="https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/fork-choice.md#validate_blobs">validate_blobs</a>
*/
private void validateBlobs(
final UInt64 slot,
final Bytes32 beaconBlockRoot,
final List<KZGCommitment> kzgCommitments,
final List<BlobSidecar> blobSidecars) {
blobSidecars.forEach(
blobSidecar -> {
checkArgument(
Expand All @@ -100,21 +87,14 @@ private void validateBlobs(
.collect(Collectors.toList());
final List<KZGProof> proofs =
blobSidecars.stream().map(BlobSidecar::getKZGProof).collect(Collectors.toList());
checkArgument(
kzgCommitments.size() == blobs.size(),
"Number of KZG commitments (%s) does not match number of blobs (%s)",
kzgCommitments.size(),
blobSidecars.size());
checkArgument(
blobs.size() == proofs.size(),
"Number of blobs (%s) does not match number of proofs (%s)",
blobs.size(),
proofs.size());

checkState(
kzg.verifyBlobKzgProofBatch(blobs, kzgCommitments, proofs),
"The blobs and KZG proofs do not correspond to the KZG commitments for slot %s and block root %s",
slot,
beaconBlockRoot);

return true;
}

/**
Expand Down