added verifier check in sticker, fixed the edge case in product (#204)

* added the verifier check for local opening
* fixed the edge case for product

---------

Co-authored-by: AlexandreBelling <alexandrebelling8@gmail.com>
This commit is contained in:
Azam Soleimanian
2024-10-21 11:42:35 +02:00
committed by GitHub
parent 5fad7f793c
commit 62438cb7e9
2 changed files with 19 additions and 1 deletions

View File

@@ -1,8 +1,10 @@
package sticker
import (
"fmt"
"strings"
"github.com/consensys/gnark/frontend"
"github.com/consensys/linea-monorepo/prover/maths/common/smartvectors"
"github.com/consensys/linea-monorepo/prover/maths/common/vector"
"github.com/consensys/linea-monorepo/prover/maths/field"
@@ -434,6 +436,22 @@ func (ctx *stickContext) compileFixedEvaluation() {
y := run.QueriesParams.MustGet(q.ID).(query.LocalOpeningParams).Y
run.AssignLocalPoint(newQ.ID, y)
})
// The verifier ensures that the old and new queries have the same assignement
ctx.comp.InsertVerifier(round, func(run *wizard.VerifierRuntime) error {
oldParams := run.GetLocalPointEvalParams(q.ID)
newParams := run.GetLocalPointEvalParams(queryName(q.ID))
if oldParams != newParams {
return fmt.Errorf("sticker verifier failed for local opening %v - %v", q.ID, queryName(q.ID))
}
return nil
}, func(api frontend.API, run *wizard.WizardVerifierCircuit) {
oldParams := run.GetLocalPointEvalParams(q.ID)
newParams := run.GetLocalPointEvalParams(queryName(q.ID))
api.AssertIsEqual(oldParams.Y, newParams.Y)
})
}
}

View File

@@ -60,7 +60,7 @@ func NewProduct(items []*Expression, exponents []int) *Expression {
}
for i := range items {
if items[i].ESHash.IsZero() {
if items[i].ESHash.IsZero() && exponents[i] != 0 {
return NewConstant(0)
}
}