diff --git a/api_eip7594.go b/api_eip7594.go index a20de9a..69aa9a9 100644 --- a/api_eip7594.go +++ b/api_eip7594.go @@ -126,10 +126,6 @@ func (ctx *Context) RecoverCellsAndComputeKZGProofs(cellIDs []uint64, cells []*C return ctx.computeCellsAndKZGProofsFromPolyCoeff(polyCoeff, numGoRoutines) } -func (ctx *Context) VerifyCellKZGProof(commitment KZGCommitment, cellID uint64, cell *Cell, proof KZGProof) error { - return ctx.VerifyCellKZGProofBatch([]KZGCommitment{commitment}, []uint64{0}, []uint64{cellID}, []*Cell{cell}, []KZGProof{proof}) -} - func (ctx *Context) VerifyCellKZGProofBatch(rowCommitments []KZGCommitment, rowIndices, columnIndices []uint64, cells []*Cell, proofs []KZGProof) error { // Check that all components in the batch have the same size, expect the rowCommitments batchSize := len(rowIndices) diff --git a/consensus_specs_test.go b/consensus_specs_test.go index 78e8c71..c18ffb1 100644 --- a/consensus_specs_test.go +++ b/consensus_specs_test.go @@ -25,7 +25,6 @@ var ( verifyBlobKZGProofTests = filepath.Join(testDir, "verify_blob_kzg_proof/*/*/*") verifyBlobKZGProofBatchTests = filepath.Join(testDir, "verify_blob_kzg_proof_batch/*/*/*") computeCellsAndKZGProofsTests = filepath.Join(testDir, "compute_cells_and_kzg_proofs/*/*/*") - verifyCellKZGProofTests = filepath.Join(testDir, "verify_cell_kzg_proof/*/*/*") verifyCellKZGProofBatchTests = filepath.Join(testDir, "verify_cell_kzg_proof_batch/*/*/*") recoverCellsAndKZGProofsTests = filepath.Join(testDir, "recover_cells_and_kzg_proofs/*/*/*") ) @@ -405,67 +404,6 @@ func TestComputeCellsAndKZGProofs(t *testing.T) { } } -func TestVerifyCellKZGProof(t *testing.T) { - type Test struct { - Input struct { - Commitment string `yaml:"commitment"` - CellId uint64 `yaml:"cell_id"` - Cell string `yaml:"cell"` - Proof string `yaml:"proof"` - } - Output *bool `yaml:"output"` - } - - tests, err := filepath.Glob(verifyCellKZGProofTests) - require.NoError(t, err) - require.True(t, len(tests) > 0) - - for _, testPath := range tests { - t.Run(testPath, func(t *testing.T) { - testFile, err := os.Open(testPath) - require.NoError(t, err) - test := Test{} - err = yaml.NewDecoder(testFile).Decode(&test) - require.NoError(t, testFile.Close()) - require.NoError(t, err) - testCaseValid := test.Output != nil - - commitment, err := hexStrToCommitment(test.Input.Commitment) - if err != nil { - require.False(t, testCaseValid) - return - } - - cellId := test.Input.CellId - - cell, err := hexStrToCell(test.Input.Cell) - if err != nil { - require.False(t, testCaseValid) - return - } - - proof, err := hexStrToProof(test.Input.Proof) - if err != nil { - require.False(t, testCaseValid) - return - } - - err = ctx.VerifyCellKZGProof(commitment, cellId, cell, proof) - // Test specifically distinguish between the test failing - // because of the pairing check and failing because of - // validation errors on the input - if err != nil && !errors.Is(err, kzg.ErrVerifyOpeningProof) { - require.False(t, testCaseValid) - } else { - // Either the error is nil or it is a verification error - expectedOutput := *test.Output - gotOutput := !errors.Is(err, kzg.ErrVerifyOpeningProof) - require.Equal(t, expectedOutput, gotOutput) - } - }) - } -} - func TestVerifyCellKZGProofBatch(t *testing.T) { type Test struct { Input struct {