Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/operations/src/synct…
Browse files Browse the repository at this point in the history
…x/path-to-regexp-1.9.0
  • Loading branch information
VGau authored Sep 13, 2024
2 parents 967c1ed + 54e3d5e commit e246795
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reuse-run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
outputs:
tests_outcome: ${{ steps.run_e2e_tests.outcome }}
runs-on: ubuntu-22.04-16core
runs-on: ubuntu-22.04
steps:
- name: Setup upterm session
if: ${{ inputs.e2e-tests-with-ssh }}
Expand Down
2 changes: 1 addition & 1 deletion contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compile:
npx hardhat run scripts/hardhat/postCompile.ts

force-compile:
npx hardhat compile --concurrency 4 --force
npx hardhat compile --force
npx hardhat run scripts/hardhat/postCompile.ts

clean:
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pnpm": ">=9"
},
"scripts": {
"build": "npx hardhat compile --concurrency 4",
"build": "npx hardhat compile",
"test": "npm run autoupdate && npx hardhat test",
"test:reportgas": "REPORT_GAS=true npx hardhat test",
"coverage": "npm run autoupdate && npx hardhat coverage --solcoverjs ./.solcover.js",
Expand Down
6 changes: 3 additions & 3 deletions prover/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ bin/controller:
##
## Prover (setup and prove)
##
bin/prover: zkevm/arithmetization/zkevm.bin
bin/prover:
mkdir -p bin
rm -f $@
$(CORSET_FLAGS) go build -o $@ ./cmd/prover
go build -o $@ ./cmd/prover

##
## Compiles the state-manager inspector
Expand All @@ -105,7 +105,7 @@ bin/compression-aggregation-sample:
bin/checker: zkevm/arithmetization/zkevm.bin
mkdir -p bin
rm -f $@
$(CORSET_FLAGS) go build -o $@ ./cmd/dev-tools/corset-checker
go build -o $@ ./cmd/dev-tools/corset-checker

##
## Build the prover docker image
Expand Down
48 changes: 30 additions & 18 deletions prover/circuits/pi-interconnection/circuit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ package pi_interconnection_test
import (
"errors"
"fmt"
"github.com/consensys/zkevm-monorepo/prover/config"
"github.com/leanovate/gopter"
"github.com/leanovate/gopter/gen"
"github.com/leanovate/gopter/prop"
"testing"

"github.com/consensys/gnark-crypto/ecc"
Expand All @@ -14,9 +18,7 @@ import (
"github.com/consensys/zkevm-monorepo/prover/circuits/internal"
pi_interconnection "github.com/consensys/zkevm-monorepo/prover/circuits/pi-interconnection"
"github.com/consensys/zkevm-monorepo/prover/circuits/pi-interconnection/keccak"
"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/stretchr/testify/assert"
"golang.org/x/crypto/sha3"
)
Expand Down Expand Up @@ -103,22 +105,32 @@ func (c *testMerkleCircuit) Define(api frontend.API) error {
}

func TestMaxNbCircuitsSum(t *testing.T) {
cfg := config.PublicInput{
MaxNbDecompression: test_utils.RandIntN(10),
MaxNbExecution: test_utils.RandIntN(10),
MaxNbCircuits: 20,
MaxNbKeccakF: 200,
ExecutionMaxNbMsg: 2,
L2MsgMerkleDepth: 5,
L2MsgMaxNbMerkle: 2,
MockKeccakWizard: true,
}

c, err := pi_interconnection.Compile(cfg)
assert.NoError(t, err)
parameters := gopter.DefaultTestParameters()
parameters.MinSuccessfulTests = 5
parameters.Rng.Seed(0x123456789abcdef0)

properties := gopter.NewProperties(parameters)

properties.Property("provides the correct number of public inputs", prop.ForAll(
func(maxNbDecompression, maxNbExecution int) bool {
cfg := config.PublicInput{
MaxNbDecompression: maxNbDecompression,
MaxNbExecution: maxNbExecution,
MaxNbCircuits: 20,
MaxNbKeccakF: 200,
ExecutionMaxNbMsg: 2,
L2MsgMerkleDepth: 5,
L2MsgMaxNbMerkle: 2,
MockKeccakWizard: true,
}

cs, err := frontend.Compile(ecc.BLS12_377.ScalarField(), scs.NewBuilder, c.Circuit)
assert.NoError(t, err)
c, err := pi_interconnection.Compile(cfg)
assert.NoError(t, err)
cs, err := frontend.Compile(ecc.BLS12_377.ScalarField(), scs.NewBuilder, c.Circuit)
assert.NoError(t, err)
return cfg.MaxNbDecompression+cfg.MaxNbExecution == pi_interconnection.GetMaxNbCircuitsSum(cs)
}, gen.IntRange(1, 10), gen.IntRange(1, 10),
))

assert.Equal(t, cfg.MaxNbDecompression+cfg.MaxNbExecution, pi_interconnection.GetMaxNbCircuitsSum(cs))
properties.TestingRun(t)
}

0 comments on commit e246795

Please sign in to comment.