-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prover/Complete Projection Query (#667)
* added projection query * compiler for projection added * compiler added to arcane * minor fix added * fix lint error * duplicate name fix * removing cptHolter to math poly * shifted the no lint command * added bin file in gitignore * removed gitignore change * remove bin file * code simplification as Alex suggested * fix in lpp * distributed projection query added * more test cases added * adding slice to accomodate multiple query per module * param changed to support additive structure * compiler code added (wip) * check test added * incorporate Alex suggestion on PR 585 * Added documentation * vertical splitting wip * feat: cumNumOnes added * feat: vertical split verifier action added * feat : added filter counting and hash computing functionality * feat: vertical consistency check and cleanup --------- Signed-off-by: Arijit Dutta <37040536+arijitdutta67@users.noreply.github.com>
- Loading branch information
1 parent
b4093d4
commit f97cd00
Showing
18 changed files
with
921 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package accessors | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/consensys/gnark/frontend" | ||
"github.com/consensys/linea-monorepo/prover/maths/field" | ||
"github.com/consensys/linea-monorepo/prover/protocol/ifaces" | ||
"github.com/consensys/linea-monorepo/prover/protocol/query" | ||
"github.com/consensys/linea-monorepo/prover/symbolic" | ||
) | ||
|
||
const ( | ||
DISTRIBUTED_PROJECTION_ACCESSOR = "DISTRIBUTED_PROJECTION_ACCESSOR" | ||
) | ||
|
||
// FromDistributedProjectionAccessor implements [ifaces.Accessor] and accesses the result of | ||
// a [query.DISTRIBUTED_PROJECTION]. | ||
type FromDistributedProjectionAccessor struct { | ||
// Q is the underlying query whose parameters are accessed by the current | ||
// [ifaces.Accessor]. | ||
Q query.DistributedProjection | ||
} | ||
|
||
// NewDistributedProjectionAccessor creates an [ifaces.Accessor] returning the opening | ||
// point of a [query.DISTRIBUTED_PROJECTION]. | ||
func NewDistributedProjectionAccessor(q query.DistributedProjection) ifaces.Accessor { | ||
return &FromDistributedProjectionAccessor{Q: q} | ||
} | ||
|
||
// Name implements [ifaces.Accessor] | ||
func (l *FromDistributedProjectionAccessor) Name() string { | ||
return fmt.Sprintf("%v_%v", DISTRIBUTED_PROJECTION_ACCESSOR, l.Q.ID) | ||
} | ||
|
||
// String implements [github.com/consensys/linea-monorepo/prover/symbolic.Metadata] | ||
func (l *FromDistributedProjectionAccessor) String() string { | ||
return l.Name() | ||
} | ||
|
||
// GetVal implements [ifaces.Accessor] | ||
func (l *FromDistributedProjectionAccessor) GetVal(run ifaces.Runtime) field.Element { | ||
params := run.GetParams(l.Q.ID).(query.DistributedProjectionParams) | ||
return params.ScaledHorner | ||
} | ||
|
||
func (l *FromDistributedProjectionAccessor) GetValCumSumCurr(run ifaces.Runtime) field.Element { | ||
params := run.GetParams(l.Q.ID).(query.DistributedProjectionParams) | ||
return params.HashCumSumOneCurr | ||
} | ||
|
||
func (l *FromDistributedProjectionAccessor) GetValCumSumPrev(run ifaces.Runtime) field.Element { | ||
params := run.GetParams(l.Q.ID).(query.DistributedProjectionParams) | ||
return params.HashCumSumOnePrev | ||
} | ||
|
||
// GetFrontendVariable implements [ifaces.Accessor] | ||
func (l *FromDistributedProjectionAccessor) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable { | ||
params := circ.GetParams(l.Q.ID).(query.GnarkDistributedProjectionParams) | ||
return params.Sum | ||
} | ||
|
||
// AsVariable implements the [ifaces.Accessor] interface | ||
func (l *FromDistributedProjectionAccessor) AsVariable() *symbolic.Expression { | ||
return symbolic.NewVariable(l) | ||
} | ||
|
||
// Round implements the [ifaces.Accessor] interface | ||
func (l *FromDistributedProjectionAccessor) Round() int { | ||
return l.Q.Round | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.