From 82b75b740fa3216c7b6c0843aa149489ca5dc4ca Mon Sep 17 00:00:00 2001
From: litt3 <102969658+litt3@users.noreply.github.com>
Date: Tue, 14 Jan 2025 14:09:22 -0500
Subject: [PATCH 1/2] Add utility method to call verifyBlobV2

Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
---
 api/clients/v2/verification/blob_verifier.go  | 38 +++++++++++++++++++
 .../EigenDABlobVerifier/conversion_utils.go   |  4 +-
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/api/clients/v2/verification/blob_verifier.go b/api/clients/v2/verification/blob_verifier.go
index d6a11d350a..0461719628 100644
--- a/api/clients/v2/verification/blob_verifier.go
+++ b/api/clients/v2/verification/blob_verifier.go
@@ -4,6 +4,7 @@ import (
 	"context"
 	"fmt"
 
+	commonv2 "github.com/Layr-Labs/eigenda/api/grpc/common/v2"
 	"github.com/Layr-Labs/eigenda/common"
 
 	disperser "github.com/Layr-Labs/eigenda/api/grpc/disperser/v2"
@@ -74,3 +75,40 @@ func (v *BlobVerifier) VerifyBlobV2FromSignedBatch(
 
 	return nil
 }
+
+// VerifyBlobV2 calls the VerifyBlobV2 view function on the EigenDABlobVerifier contract
+//
+// This method returns nil if the blob is successfully verified. Otherwise, it returns an error.
+//
+// It is the responsibility of the caller to configure a timeout on the ctx, if a timeout is required.
+func (v *BlobVerifier) VerifyBlobV2(
+	ctx context.Context,
+	// The header of the batch that the blob is contained in
+	batchHeader *commonv2.BatchHeader,
+	// Contains data pertaining to the blob's inclusion in the batch
+	blobVerificationProof *disperser.BlobVerificationInfo,
+	// Contains data that can be used to verify that the blob actually exists in the claimed batch
+	nonSignerStakesAndSignature verifierBindings.NonSignerStakesAndSignature,
+) error {
+	convertedBatchHeader, err := verifierBindings.ConvertBatchHeader(batchHeader)
+	if err != nil {
+		return fmt.Errorf("convert batch header: %s", err)
+	}
+
+	convertedBlobVerificationProof, err := verifierBindings.ConvertVerificationProof(blobVerificationProof)
+	if err != nil {
+		return fmt.Errorf("convert blob verification proof: %s", err)
+	}
+
+	err = v.blobVerifierCaller.VerifyBlobV2(
+		&bind.CallOpts{Context: ctx},
+		*convertedBatchHeader,
+		*convertedBlobVerificationProof,
+		nonSignerStakesAndSignature)
+
+	if err != nil {
+		return fmt.Errorf("verify blob v2: %s", err)
+	}
+
+	return nil
+}
diff --git a/contracts/bindings/EigenDABlobVerifier/conversion_utils.go b/contracts/bindings/EigenDABlobVerifier/conversion_utils.go
index 9789387ffd..ff955af40f 100644
--- a/contracts/bindings/EigenDABlobVerifier/conversion_utils.go
+++ b/contracts/bindings/EigenDABlobVerifier/conversion_utils.go
@@ -13,7 +13,7 @@ import (
 )
 
 func ConvertSignedBatch(inputBatch *disperserv2.SignedBatch) (*SignedBatch, error) {
-	convertedBatchHeader, err := convertBatchHeader(inputBatch.GetHeader())
+	convertedBatchHeader, err := ConvertBatchHeader(inputBatch.GetHeader())
 	if err != nil {
 		return nil, fmt.Errorf("convert batch header: %s", err)
 	}
@@ -31,7 +31,7 @@ func ConvertSignedBatch(inputBatch *disperserv2.SignedBatch) (*SignedBatch, erro
 	return outputSignedBatch, nil
 }
 
-func convertBatchHeader(inputHeader *commonv2.BatchHeader) (*BatchHeaderV2, error) {
+func ConvertBatchHeader(inputHeader *commonv2.BatchHeader) (*BatchHeaderV2, error) {
 	var outputBatchRoot [32]byte
 
 	inputBatchRoot := inputHeader.GetBatchRoot()

From 3c9dabc3c3e0d28137a5751845c066eabee3e016 Mon Sep 17 00:00:00 2001
From: litt3 <102969658+litt3@users.noreply.github.com>
Date: Wed, 15 Jan 2025 12:13:21 -0500
Subject: [PATCH 2/2] Remove redundant comment

Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
---
 api/clients/v2/verification/blob_verifier.go | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/api/clients/v2/verification/blob_verifier.go b/api/clients/v2/verification/blob_verifier.go
index 0461719628..4dc8d4e06c 100644
--- a/api/clients/v2/verification/blob_verifier.go
+++ b/api/clients/v2/verification/blob_verifier.go
@@ -44,8 +44,6 @@ func NewBlobVerifier(
 // VerifyBlobV2FromSignedBatch calls the verifyBlobV2FromSignedBatch view function on the EigenDABlobVerifier contract
 //
 // This method returns nil if the blob is successfully verified. Otherwise, it returns an error.
-//
-// It is the responsibility of the caller to configure a timeout on the ctx, if a timeout is required.
 func (v *BlobVerifier) VerifyBlobV2FromSignedBatch(
 	ctx context.Context,
 	// The signed batch that contains the blob being verified. This is obtained from the disperser, and is used
@@ -79,8 +77,6 @@ func (v *BlobVerifier) VerifyBlobV2FromSignedBatch(
 // VerifyBlobV2 calls the VerifyBlobV2 view function on the EigenDABlobVerifier contract
 //
 // This method returns nil if the blob is successfully verified. Otherwise, it returns an error.
-//
-// It is the responsibility of the caller to configure a timeout on the ctx, if a timeout is required.
 func (v *BlobVerifier) VerifyBlobV2(
 	ctx context.Context,
 	// The header of the batch that the blob is contained in