diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java index 425285c6533..2427bf16a26 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java @@ -260,12 +260,6 @@ public boolean isMergeTransitionComplete(final BeaconState state) { /** * Performs data availability by validating blobs and proof from Sidecar against blobs kzg * commitments from the block. It will also make check slot and blockRoot consistency. - * - * @param slot - * @param beaconBlockRoot - * @param kzgCommitments - * @param blobsSidecar - * @return */ public boolean isDataAvailable( final UInt64 slot, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip4844/helpers/MiscHelpersEip4844.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip4844/helpers/MiscHelpersEip4844.java index 0e65a39a5b9..b351dd165c9 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip4844/helpers/MiscHelpersEip4844.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip4844/helpers/MiscHelpersEip4844.java @@ -14,6 +14,7 @@ package tech.pegasys.teku.spec.logic.versions.eip4844.helpers; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkState; import static tech.pegasys.teku.spec.config.SpecConfigEip4844.BLOB_TX_TYPE; import static tech.pegasys.teku.spec.config.SpecConfigEip4844.VERSIONED_HASH_VERSION_KZG; @@ -68,17 +69,19 @@ private void validateBlobSidecar( final BlobsSidecar blobsSidecar) { checkArgument( slot.equals(blobsSidecar.getBeaconBlockSlot()), - "Block slot should match blobsSidecar slot"); + "Block slot should match blobs sidecar slot"); checkArgument( beaconBlockRoot.equals(blobsSidecar.getBeaconBlockRoot()), - "Block root should match blobsSidecar beacon block root"); + "Block root should match blobs sidecar beacon block root"); checkArgument( kzgCommitments.size() == blobsSidecar.getBlobs().size(), - "Number of kzgCommitments should match number of blobs"); - kzg.verifyAggregateKzgProof( - blobsSidecar.getBlobs().stream().map(Blob::getBytes).collect(Collectors.toList()), - kzgCommitments, - blobsSidecar.getKZGAggregatedProof()); + "Number of KZG commitments should match number of blobs"); + final boolean isValidProof = + kzg.verifyAggregateKzgProof( + blobsSidecar.getBlobs().stream().map(Blob::getBytes).collect(Collectors.toList()), + kzgCommitments, + blobsSidecar.getKZGAggregatedProof()); + checkState(isValidProof, "Invalid aggregate KZG proof for the given blobs and commitments"); } @Override diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 4a03a399982..c9171add6f7 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -41,7 +41,7 @@ dependencyManagement { dependency 'io.libp2p:jvm-libp2p-minimal:0.10.0-RELEASE' dependency 'tech.pegasys:jblst:0.3.10' - dependency 'tech.pegasys:jc-kzg-4844:0.2.1' + dependency 'tech.pegasys:jc-kzg-4844:0.3.0' dependency 'org.hdrhistogram:HdrHistogram:2.1.12'