Skip to content

Commit

Permalink
Prover/Constraint for IsInsertRow3 (#147)
Browse files Browse the repository at this point in the history
* added constraint for IsInsertRow3
  • Loading branch information
arijitdutta67 authored Oct 26, 2024
1 parent e84b088 commit db82f0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions prover/zkevm/prover/statemanager/accumulator/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ func (am *Module) checkNextFreeNode() {
cols.IsInsertRow3,
symbolic.Sub(cols.NextFreeNode, cols.InsertionPath, symbolic.NewConstant(1)))
am.comp.InsertGlobal(am.Round, am.qname("NEXT_FREE_NODE_CONSISTENCY_2"), expr4)

// IsInsertRow3 is true if and only if it is row 3 for INSERT operation, i.e.,
// IsActiveAccumulator[i] * (IsInsert[i] * IsEmptyLeaf[i] - IsInsertRow3[i]). The constraint that
// IsEmptyLeaf is 1 if and only if it is row 3 for INSERT (and row 4 of DELETE) is imposed already.
expr5 := symbolic.Mul(cols.IsActiveAccumulator,
symbolic.Sub(symbolic.Mul(cols.IsInsert, cols.IsEmptyLeaf),
cols.IsInsertRow3))
am.comp.InsertGlobal(am.Round, am.qname("IS_INSERT_ROW3_CONSISTENCY"), expr5)
}

func (am *Module) checkTopRootHash() {
Expand Down

0 comments on commit db82f0f

Please sign in to comment.