Skip to content

Commit

Permalink
removing preperation phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Soleimani193 committed Dec 6, 2024
1 parent 17078bd commit 89399dc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 54 deletions.
13 changes: 0 additions & 13 deletions prover/protocol/distributed/compiler/inclusion/inclusion.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
package inclusion

import (
"github.com/consensys/linea-monorepo/prover/protocol/distributed/query"
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
)

// IntoLogDerivativeSum reduces all the inclusion queries into a LogDerivativeSum query.
func IntoLogDerivativeSum(comp *wizard.CompiledIOP) query.LogDerivativeSum {
panic("unimplemented")
// - scan the compiler for the inclusion queries, and
// group them based on their lookup table (different S with the same T).
// - declare two coins. The coins should not create any new round here.
// So we declare them as variable rather than inserting them.
// var alpha, beta coin.Info
// - build the expressions for the LogDerivativeSum from the columns and the coins.
// - return LogDerivatevSum.
}

// CompileDist compiles a LogDerivativeSum query distributedly.
func CompileDist(comp *wizard.CompiledIOP) {

Expand Down
19 changes: 12 additions & 7 deletions prover/protocol/distributed/compiler/permutation/permutation.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package permutation

import "github.com/consensys/linea-monorepo/prover/protocol/wizard"

// IntoGrandProduct reduces all the permutation queries to a single GrandProduct query
func IntoGrandProduct(comp *wizard.CompiledIOP) {
panic("unimplemented")
}
import (
"github.com/consensys/linea-monorepo/prover/protocol/coin"
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
)

// CompileDist compiles a GrandProduct query distributedly.
func CompileDist(comp *wizard.CompiledIOP) {
// It receives a compiledIop object relevant to a segment.
// The seed is a random coin from randomness beacon (FS of all LPP commitments).
// It scans compiledIOP to find the permutation queries.
// All the compilation steps are similar to the permutation compilation apart from:
// - random coins \alpha and \gamma are generated from the seed.
// - no verifierAction is needed over the ZOpening.
// - ZOpenings are declared as public input.
func CompileDist(comp *wizard.CompiledIOP, seed coin.Info) {

}
18 changes: 11 additions & 7 deletions prover/protocol/distributed/compiler/projection/projection.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package projection

import "github.com/consensys/linea-monorepo/prover/protocol/wizard"

// IntoGrandSu reduces all the projection queries into a GrandSum query
func IntoGrandSum(comp *wizard.CompiledIOP) {
panic("unimplemented")
}
import (
"github.com/consensys/linea-monorepo/prover/protocol/coin"
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
)

// CompileDist compiles a GrandSum query distributedly.
func CompileDist(comp *wizard.CompiledIOP) {
// It receives a compiledIop object relevant to a segment.
// The seed is a random coin from randomness beacon (FS of all LPP commitments).
// All the compilation steps are similar to the permutation compilation apart from:
// - random coins \alpha and \gamma are generated from the seed.
// - no verifierAction is needed over the ZOpening.
// - ZOpenings are declared as public input.
func CompileDist(comp *wizard.CompiledIOP, seed coin.Info) {

}
28 changes: 1 addition & 27 deletions prover/protocol/distributed/distributed.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
package distributed

import (
"github.com/consensys/linea-monorepo/prover/protocol/compiler/mimc"
"github.com/consensys/linea-monorepo/prover/protocol/compiler/specialqueries"
"github.com/consensys/linea-monorepo/prover/protocol/distributed/compiler/inclusion"
"github.com/consensys/linea-monorepo/prover/protocol/distributed/compiler/permutation"
"github.com/consensys/linea-monorepo/prover/protocol/distributed/compiler/projection"
"github.com/consensys/linea-monorepo/prover/protocol/ifaces"
"github.com/consensys/linea-monorepo/prover/protocol/wizard"
)

type moduleName = string

type DistributedWizard struct {
// initializedWizard which is ready for distribution.
// initializedWizard
Bootstrapper *wizard.CompiledIOP
// compiledIOPs for a segment of each module.
// Since splits are fair/uniform over a module. One segment can represent all the segments.
Expand Down Expand Up @@ -44,9 +39,6 @@ type ModuleDiscoverer interface {
// maxSegmentSize is a static parameter for the max size of the columns in segments.
// maxNumSegment give the max number of segments in a module.
func Distribute(initialWizard *wizard.CompiledIOP, disc ModuleDiscoverer, maxSegmentSize, maxNumSegment int) DistributedWizard {
// prepare the initialWizard for the distribution.
// This adds intermediates queries that are simpler to be distributed.
prepare(initialWizard)

// analyze the initialWizard to split it to modules.
disc.Analyze(initialWizard)
Expand All @@ -72,24 +64,6 @@ func Distribute(initialWizard *wizard.CompiledIOP, disc ModuleDiscoverer, maxSeg
}
}

// It compiles any other query to LPP or GL.
// then transfer LPP queries into the queries proper for distribution.
func prepare(comp *wizard.CompiledIOP) {
// compile other queries to LPP and GL.
mimc.CompileMiMC(comp)
specialqueries.RangeProof(comp)
specialqueries.CompileFixedPermutations(comp)

// prepare LPP queries for the distribution.
inclusion.IntoLogDerivativeSum(comp)
permutation.IntoGrandProduct(comp)
projection.IntoGrandSum(comp)
}

func addSplittingStep(comp *wizard.CompiledIOP, disc ModuleDiscoverer) {
panic("unimplemented")
}

// it should scan comp and based on module name build compiledIOP for LPP and for GL.
func extractDistModule(
comp *wizard.CompiledIOP, disc ModuleDiscoverer,
Expand Down

0 comments on commit 89399dc

Please sign in to comment.