From 0cfe5bb285b507dcd97d1aae38933b77ec4dee4d Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Tue, 26 Nov 2024 15:07:44 +0100 Subject: [PATCH] tmp change approach --- .../phase0/forkchoice/StubBlobSidecarManager.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/StubBlobSidecarManager.java b/eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/StubBlobSidecarManager.java index a8608be6960..f2d520a1fb4 100644 --- a/eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/StubBlobSidecarManager.java +++ b/eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/StubBlobSidecarManager.java @@ -95,11 +95,7 @@ public SafeFuture getAvailabilityCheckResult() if (blobsAndProofs == null) { return SafeFuture.completedFuture(BlobSidecarsAndValidationResult.NOT_REQUIRED); } - try { - return SafeFuture.completedFuture(validateImmediately(block, blobsAndProofs)); - } catch (RuntimeException e) { - return SafeFuture.completedFuture(BlobSidecarsAndValidationResult.notAvailable(e)); - } + return SafeFuture.completedFuture(validateImmediately(block, blobsAndProofs)); } private BlobSidecarsAndValidationResult validateImmediately( @@ -111,8 +107,12 @@ private BlobSidecarsAndValidationResult validateImmediately( .map(SszKZGCommitment::getKZGCommitment) .toList(); final List blobs = blobsAndProofs.blobs.stream().map(Blob::getBytes).toList(); - if (!kzg.verifyBlobKzgProofBatch(blobs, kzgCommitments, blobsAndProofs.proofs)) { - throw new RuntimeException("Invalid KZG proof"); + try { + if (!kzg.verifyBlobKzgProofBatch(blobs, kzgCommitments, blobsAndProofs.proofs)) { + return BlobSidecarsAndValidationResult.invalidResult(Collections.emptyList()); + } + } catch (final Exception ex) { + return BlobSidecarsAndValidationResult.invalidResult(Collections.emptyList(), ex); } return BlobSidecarsAndValidationResult.validResult(Collections.emptyList()); }