diff --git a/.github/workflows/prover-build-and-publish.yml b/.github/workflows/prover-build-and-publish.yml index 53b9262a..59cbc18f 100644 --- a/.github/workflows/prover-build-and-publish.yml +++ b/.github/workflows/prover-build-and-publish.yml @@ -96,7 +96,7 @@ jobs: RUSTFLAGS="-C target-cpu=x86-64-v3" build-contexts: | prover=prover/ - corset=corset/ + go-corset=go-corset/ constraints=constraints/ platforms: linux/amd64 load: true @@ -123,7 +123,7 @@ jobs: RUSTFLAGS="-C target-cpu=x86-64-v3" build-contexts: | prover=prover/ - corset=corset/ + go-corset=go-corset/ constraints=constraints/ platforms: linux/amd64 load: false diff --git a/.gitmodules b/.gitmodules index 66217348..63080987 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "constraints"] path = constraints url = git@github.com:ConsenSys/zkevm-constraints.git -[submodule "corset"] - path = corset - url = git@github.com:consensys/corset.git +[submodule "go-corset"] + path = go-corset + url = git@github.com:Consensys/go-corset.git [submodule "contracts/lib/forge-std"] path = contracts/lib/forge-std - url = https://github.com/foundry-rs/forge-std + url = https://github.com/foundry-rs/forge-std \ No newline at end of file diff --git a/corset b/corset deleted file mode 160000 index 3d6496a0..00000000 --- a/corset +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d6496a0348d73617bbd5c57f02ec1cd6a4799fd diff --git a/go-corset b/go-corset new file mode 160000 index 00000000..4e884ec4 --- /dev/null +++ b/go-corset @@ -0,0 +1 @@ +Subproject commit 4e884ec4c0280dff6fe62ba4b432746f8637a872 diff --git a/prover/Makefile b/prover/Makefile index 39f3ae29..b7028ae2 100644 --- a/prover/Makefile +++ b/prover/Makefile @@ -1,18 +1,14 @@ # required for `source` SHELL := /usr/bin/env bash -CORSET_ROOT := $(shell pwd)/../corset - -CGO_CFLAGS := "-I${CORSET_ROOT}/target/" -CGO_LDFLAGS := "${CORSET_ROOT}/target/release/libcorset.a -lm -ldl" -CORSET_FLAGS := CGO_CFLAGS=${CGO_CFLAGS} CGO_LDFLAGS=${CGO_LDFLAGS} +CORSET_ROOT := $(shell pwd)/../go-corset VERSION := $(shell git rev-parse --short HEAD) LINUX_AMD64_FLAGS := CGO_ENABLED=1 CC="x86_64-linux-musl-gcc" CXX="x86_64-linux-musl-g++" GOOS="linux" GOARCH="amd64" DARWIN_ARM64_FLAGS := CGO_ENABLED=1 GOOS="linux" GOARCH="arm64" -# Ensure that we are using corset from the monorepo -CORSET := PATH="${CORSET_ROOT}/target/release":$$PATH +# Ensure that we are using go-corset from the monorepo +GO_CORSET := PATH="${CORSET_ROOT}/bin":$$PATH # these targets are not defined as depending on source files, # so they should be recompiled by default “just in case”. @@ -30,21 +26,28 @@ CORSET := PATH="${CORSET_ROOT}/target/release":$$PATH docker \ bin/prover \ bin/checker \ - corset \ + go-corset \ testdata \ ## -## This rule produces both the corset binary and libcorset.a & corset.h for the FFI +## This rule produces the go-corset binary ## -corset: - cd ${CORSET_ROOT} && cargo build --release +go-corset: + cd ${CORSET_ROOT} && make build ## -## Build and bundle the Corset trace-expander dependency +## Build and bundle the go-corset trace-expander dependency ## -zkevm/arithmetization/zkevm.bin: corset - cd ../constraints && $(CORSET) make zkevm.bin && mv zkevm.bin ../prover/zkevm/arithmetization +zkevm/arithmetization/zkevm.bin: go-corset + cd ../constraints && $(GO_CORSET) make zkevm.bin && mv zkevm.bin ../prover/zkevm/arithmetization + +## +## zkevm.bin without 2B block gas limit constraint to test old traces +## +zkevm/arithmetization/zkevm_for_old_trace.bin: go-corset + cd ../constraints && $(GO_CORSET) make zkevm_for_old_replay_tests.bin &&\ + mv zkevm_for_old_replay_tests.bin ../prover/zkevm/arithmetization/zkevm_for_old_trace.bin ## ## Generate the setup for the execution prover (to be run with S3 access) diff --git a/prover/compose-integration.yml b/prover/compose-integration.yml index 02db8d45..ef579b8b 100644 --- a/prover/compose-integration.yml +++ b/prover/compose-integration.yml @@ -26,7 +26,7 @@ services: dockerfile: ./prover/Dockerfile additional_contexts: prover: ../prover/ - corset: ../corset/ + go-corset: ../go-corset/ constraints: ../constraints/ environment: VERSION: "0.2.0" # TODO @gbotrel hunt all the hard coded version strings