-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,53 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/consensys/gnark-crypto/ecc" | ||
"github.com/consensys/gnark/backend/plonk" | ||
"github.com/consensys/gnark/frontend" | ||
"github.com/consensys/gnark/frontend/cs/scs" | ||
"github.com/consensys/gnark/profile" | ||
"github.com/consensys/zkevm-monorepo/prover/circuits" | ||
"github.com/consensys/zkevm-monorepo/prover/circuits/aggregation" | ||
"github.com/consensys/zkevm-monorepo/prover/circuits/dummy" | ||
pi_interconnection "github.com/consensys/zkevm-monorepo/prover/circuits/pi-interconnection" | ||
"github.com/consensys/zkevm-monorepo/prover/utils/test_utils" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func main() { | ||
|
||
const nbCircuits = 400 | ||
|
||
piCircuit := pi_interconnection.DummyCircuit{ | ||
ExecutionPublicInput: make([]frontend.Variable, nbCircuits), | ||
DecompressionPublicInput: make([]frontend.Variable, nbCircuits), | ||
DecompressionFPI: make([]frontend.Variable, nbCircuits), | ||
ExecutionFPI: make([]frontend.Variable, nbCircuits), | ||
} | ||
|
||
var t test_utils.FakeTestingT | ||
|
||
innerField := ecc.BLS12_377.ScalarField() | ||
piCs, err := frontend.Compile(innerField, scs.NewBuilder, &piCircuit) | ||
assert.NoError(t, err) | ||
|
||
srsProvider := circuits.NewUnsafeSRSProvider() | ||
|
||
piSetup, err := circuits.MakeSetup(context.TODO(), "public-input-interconnection", piCs, srsProvider, nil) | ||
assert.NoError(t, err) | ||
|
||
// Having more than 2 types of inner circuit to reflect various versions | ||
innerVks := make([]plonk.VerifyingKey, 10) | ||
for i := range innerVks { | ||
setup, err := dummy.MakeUnsafeSetup(srsProvider, 0, innerField) | ||
assert.NoError(t, err) | ||
innerVks[i] = setup.VerifyingKey | ||
} | ||
|
||
p := profile.Start(profile.WithPath("aggregation.pprof")) | ||
defer p.Stop() | ||
_, err = aggregation.MakeCS(nbCircuits, piSetup, innerVks) | ||
assert.NoError(t, err) | ||
} |
Binary file not shown.
Binary file not shown.
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,32 @@ | ||
package main | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"github.com/consensys/zkevm-monorepo/prover/circuits/execution" | ||
"github.com/consensys/zkevm-monorepo/prover/config" | ||
"github.com/consensys/zkevm-monorepo/prover/utils" | ||
"github.com/consensys/zkevm-monorepo/prover/utils/test_utils" | ||
"github.com/consensys/zkevm-monorepo/prover/zkevm" | ||
"github.com/spf13/viper" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func main() { | ||
var t test_utils.FakeTestingT | ||
root, err := utils.GetRepoRootPath() | ||
assert.NoError(t, err) | ||
root = filepath.Join(root, "prover") | ||
|
||
viper.Set("assets_dir", filepath.Join(root, "prover-assets")) | ||
// TODO Make sure this is the correct config file | ||
cfg, err := config.NewConfigFromFile(filepath.Join(root, "config", "config-integration-full.toml")) | ||
assert.NoError(t, err) | ||
|
||
//extraFlags["cfg_checksum"] = limits.Checksum() | ||
// The builder itself will create a profile called "profiling-execution.pprof" | ||
_, err = execution.NewBuilder( | ||
zkevm.FullZkEvm(&cfg.TracesLimits), // or TracesLimitsLarge? | ||
).Compile() | ||
assert.NoError(t, err) | ||
} |