mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 20:27:58 -05:00
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:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user