Skip to content

Commit 29a64c5

Browse files
doc(full-recursion): documents the prover and verifier actions
1 parent 8b928f0 commit 29a64c5

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

prover/protocol/compiler/fullrecursion/actions.go

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,44 @@ import (
88
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
99
)
1010

11+
// CircuitAssignment is an implementation of [wizard.ProverAction]. As such, it
12+
// embodies the action of assigning the full-recursion Plonk circuit columns.
1113
type CircuitAssignment fullRecursionCtx
1214

13-
func (c CircuitAssignment) Run(run *wizard.ProverRuntime) {
14-
c.PlonkInWizard.ProverAction.Run(run, WitnessAssigner(c))
15+
// ConsistencyCheck is an implementation of [wizard.VerifierAction]. As such it
16+
// is responsible for checking that the public inputs of the full-recursion
17+
// Plonk circuit are assigned to values that are consistent with (1) the public
18+
// inputs of the wrapping wizard protocol and with the inputs of the
19+
// self-recursion wizard.
20+
type ConsistencyCheck struct {
21+
fullRecursionCtx
22+
isSkipped bool
1523
}
1624

25+
// ReplacementAssignment is a [wizard.ProverAction] implementation. It assigns
26+
// the queries and columns that are "replaced" in the wizard. In essence, this
27+
// concerns the main grail polynomial evaluation (the grail query) and the
28+
// Merkle roots assignment. These have to be replaced so that they can be
29+
// refered to by the self-recursion. Otherwise, they would be swallowed by the
30+
// recursion Plonk circuit.
1731
type ReplacementAssignment fullRecursionCtx
1832

33+
// LocalOpeningAssignment assigns the local openings made over the Plonk PI.
34+
// These are needed in order to (1) perform the consistency check (2) replace
35+
// the "old" and recursed public inputs of the original wizard by new ones.
36+
type LocalOpeningAssignment fullRecursionCtx
37+
38+
// ResetFsActions is a [wizard.FsHook] responsible for tweaking the FS state as
39+
// required by the self-recursion process.
40+
type ResetFsActions struct {
41+
fullRecursionCtx
42+
isSkipped bool
43+
}
44+
45+
func (c CircuitAssignment) Run(run *wizard.ProverRuntime) {
46+
c.PlonkInWizard.ProverAction.Run(run, WitnessAssigner(c))
47+
}
48+
1949
func (c ReplacementAssignment) Run(run *wizard.ProverRuntime) {
2050
params := run.GetUnivariateParams(c.PolyQuery.QueryID)
2151
run.AssignUnivariate(c.PolyQueryReplacement.QueryID, params.X, params.Ys...)
@@ -34,8 +64,6 @@ func (c ReplacementAssignment) Run(run *wizard.ProverRuntime) {
3464
}
3565
}
3666

37-
type LocalOpeningAssignment fullRecursionCtx
38-
3967
func (c LocalOpeningAssignment) Run(run *wizard.ProverRuntime) {
4068
for i := range c.LocalOpenings {
4169
run.AssignLocalPoint(
@@ -45,11 +73,6 @@ func (c LocalOpeningAssignment) Run(run *wizard.ProverRuntime) {
4573
}
4674
}
4775

48-
type ConsistencyCheck struct {
49-
fullRecursionCtx
50-
isSkipped bool
51-
}
52-
5376
func (c *ConsistencyCheck) Run(run *wizard.VerifierRuntime) error {
5477

5578
var (
@@ -168,11 +191,6 @@ func (c *ConsistencyCheck) IsSkipped() bool {
168191
return c.isSkipped
169192
}
170193

171-
type ResetFsActions struct {
172-
fullRecursionCtx
173-
isSkipped bool
174-
}
175-
176194
func (r *ResetFsActions) Run(run *wizard.VerifierRuntime) error {
177195
finalFsCirc := run.GetLocalPointEvalParams(r.LocalOpenings[1].ID).Y
178196
run.FS.SetState([]field.Element{finalFsCirc})

0 commit comments

Comments
 (0)