Files
linea-monorepo/prover/protocol/compiler/fullrecursion/full_recursion_test.go
AlexandreBelling 3b875fd8d6 Prover/full recursion (#350)
* (feat): Implements the full-recursion and test for a simple test
* msg(sticker): better error in the sticker
* test(full-recursion): adds a test for double full-recursion (overflowing memory)
* fix: sort out the packages after rebasing
* fix(pi): renaming of the public inputs
* fix(hasher): adjust the code to using a [hash.StateStorer]
* fix(pairing): pass the new format for fp12 elements
* doc(plonk): adds more doc in plonk.alignment.go
* doc(fs-hook): improves the documentation of the FiatShamirHook field.
* docs(skipping): adds doc on the ByRoundRegister
* feat(pubinp): move the zkevm public inputs to using the new public-input framework
* doc(column-store): adds documentation for the more precise methods regarding the inclusion in the FS transcript.
* clean(self-recursion): remove the self-recursion tuning file
* doc(vortex): explain the separation between the verifier steps
* doc(full-recursion): documents the prover and verifier actions
* doc(columns): improve the documentation on the IncludeInProverFS
2025-01-06 09:52:01 +01:00

106 lines
3.3 KiB
Go

//go:build !fuzzlight
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/dummy"
"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"
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
"github.com/sirupsen/logrus"
)
func TestLookup(t *testing.T) {
logrus.SetLevel(logrus.FatalLevel)
define := func(bui *wizard.Builder) {
var (
a = bui.RegisterCommit("A", 8)
b = bui.RegisterCommit("B", 8)
)
bui.Inclusion("Q", []ifaces.Column{a}, []ifaces.Column{b})
}
prove := func(run *wizard.ProverRuntime) {
run.AssignColumn("A", smartvectors.ForTest(1, 2, 3, 4, 5, 6, 7, 8))
run.AssignColumn("B", smartvectors.ForTest(1, 2, 3, 4, 5, 6, 7, 8))
}
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),
dummy.CompileAtProverLvl,
},
{
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),
dummy.CompileAtProverLvl,
},
}
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)
}
})
}
}