Skip to content

Commit

Permalink
test(full-recursion): adds a test for double full-recursion (overflow…
Browse files Browse the repository at this point in the history
…ing memory)
  • Loading branch information
AlexandreBelling committed Dec 2, 2024
1 parent b1697f4 commit 244080c
Showing 1 changed file with 61 additions and 16 deletions.
77 changes: 61 additions & 16 deletions prover/protocol/compiler/fullrecursion/full_recursion_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package fullrecursion_test

import (
"fmt"
"testing"

"github.com/consensys/linea-monorepo/prover/crypto/ringsis"
"github.com/consensys/linea-monorepo/prover/maths/common/smartvectors"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/fullrecursion"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/globalcs"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/innerproduct"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/localcs"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/lookup"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/mimc"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/permutation"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/specialqueries"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/splitter"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/splitter/sticker"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/univariates"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/vortex"
"github.com/consensys/linea-monorepo/prover/protocol/ifaces"
Expand All @@ -35,21 +42,59 @@ func TestLookup(t *testing.T) {
run.AssignColumn("B", smartvectors.ForTest(1, 2, 3, 4, 5, 6, 7, 8))
}

comp := wizard.Compile(
define,
lookup.CompileLogDerivative,
localcs.Compile,
globalcs.Compile,
univariates.CompileLocalOpening,
univariates.Naturalize,
univariates.MultiPointToSinglePoint(8),
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
fullrecursion.FullRecursion(true),
)

proof := wizard.Prove(comp, prove)

if err := wizard.Verify(comp, proof); err != nil {
t.Fatalf("verifier failed: %v", err)
suites := [][]func(*wizard.CompiledIOP){
{
lookup.CompileLogDerivative,
localcs.Compile,
globalcs.Compile,
univariates.CompileLocalOpening,
univariates.Naturalize,
univariates.MultiPointToSinglePoint(8),
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
fullrecursion.FullRecursion(true),
},
{
lookup.CompileLogDerivative,
localcs.Compile,
globalcs.Compile,
univariates.CompileLocalOpening,
univariates.Naturalize,
univariates.MultiPointToSinglePoint(8),
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
fullrecursion.FullRecursion(true),
mimc.CompileMiMC,
specialqueries.RangeProof,
lookup.CompileLogDerivative,
specialqueries.CompileFixedPermutations,
permutation.CompileGrandProduct,
innerproduct.Compile,
sticker.Sticker(1<<8, 1<<16),
splitter.SplitColumns(1 << 16),
localcs.Compile,
globalcs.Compile,
univariates.CompileLocalOpening,
univariates.Naturalize,
univariates.MultiPointToSinglePoint(1 << 16),
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
fullrecursion.FullRecursion(true),
},
}

for i, s := range suites {

t.Run(fmt.Sprintf("case-%v", i), func(t *testing.T) {

comp := wizard.Compile(
define,
s...,
)

proof := wizard.Prove(comp, prove)

if err := wizard.Verify(comp, proof); err != nil {
t.Fatalf("verifier failed: %v", err)
}
})

}
}

0 comments on commit 244080c

Please sign in to comment.