Skip to content

Commit

Permalink
test: add missing cert verifier test for blob staleness
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Jan 10, 2025
1 parent e633096 commit 47ff9ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,21 @@ func TestVerifyCertRollupBlobInclusionWindow(t *testing.T) {
err = verifier.VerifyCert(ctx, &cert, common.VerifyArgs{RollupL1InclusionBlockNum: -1})
require.NoError(t, err)

// 50 is within the window, so we expect no error to be caught
// 50 < RollupBlobInclusionWindow, so we expect no error to be caught
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err = verifier.VerifyCert(ctx, &cert, common.VerifyArgs{RollupL1InclusionBlockNum: int64(blobInfo.BlobVerificationProof.BatchMetadata.BatchHeader.ReferenceBlockNumber) + 50})
require.NoError(t, err)

// 200 is outside the window, so we expect an error to be caught
// 200 > RollupBlobInclusionWindow, so we expect an error to be caught
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err = verifier.VerifyCert(ctx, &cert, common.VerifyArgs{RollupL1InclusionBlockNum: int64(blobInfo.BlobVerificationProof.BatchMetadata.BatchHeader.ReferenceBlockNumber) + 200})
require.EqualError(t, err, "rollup inclusion block number (3106502) needs to be < eigenda batch reference block number (3106302) + rollupBlobInclusionWindow (100)")

// RBN-50 < RBN, so we expect an error to be caught
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err = verifier.VerifyCert(ctx, &cert, common.VerifyArgs{RollupL1InclusionBlockNum: int64(blobInfo.BlobVerificationProof.BatchMetadata.BatchHeader.ReferenceBlockNumber) - 50})
require.EqualError(t, err, "eigenda batch reference block number (3106302) needs to be < rollup inclusion block number (3106252)")
}

0 comments on commit 47ff9ba

Please sign in to comment.