Prover: go-corset as submodule (#759)

* feat(go-corset): go-corset as submodule (#743)

* remove corset submodule

* add go-corset submodule

* use go-corst in Makefile

* use go-corset v0.9.2

* update go-corset submodule url

* fix(go-corset): typo in submodule url

* fix: use go-corset instead of corset

* add zkevm_for_old_trace.bin without 2B block gas limit constraint to test old traces

---------

Signed-off-by: Leo Jeong <dreamerty@postech.ac.kr>
This commit is contained in:
Leo Jeong
2025-03-07 16:02:09 +09:00
committed by GitHub
parent bf71b6b5ca
commit a3972f3baa
6 changed files with 25 additions and 22 deletions

View File

@@ -96,7 +96,7 @@ jobs:
RUSTFLAGS="-C target-cpu=x86-64-v3" RUSTFLAGS="-C target-cpu=x86-64-v3"
build-contexts: | build-contexts: |
prover=prover/ prover=prover/
corset=corset/ go-corset=go-corset/
constraints=constraints/ constraints=constraints/
platforms: linux/amd64 platforms: linux/amd64
load: true load: true
@@ -123,7 +123,7 @@ jobs:
RUSTFLAGS="-C target-cpu=x86-64-v3" RUSTFLAGS="-C target-cpu=x86-64-v3"
build-contexts: | build-contexts: |
prover=prover/ prover=prover/
corset=corset/ go-corset=go-corset/
constraints=constraints/ constraints=constraints/
platforms: linux/amd64 platforms: linux/amd64
load: false load: false

8
.gitmodules vendored
View File

@@ -1,9 +1,9 @@
[submodule "constraints"] [submodule "constraints"]
path = constraints path = constraints
url = git@github.com:ConsenSys/zkevm-constraints.git url = git@github.com:ConsenSys/zkevm-constraints.git
[submodule "corset"] [submodule "go-corset"]
path = corset path = go-corset
url = git@github.com:consensys/corset.git url = git@github.com:Consensys/go-corset.git
[submodule "contracts/lib/forge-std"] [submodule "contracts/lib/forge-std"]
path = 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

1
corset

Submodule corset deleted from 3d6496a034

1
go-corset Submodule

Submodule go-corset added at 4e884ec4c0

View File

@@ -1,18 +1,14 @@
# required for `source` # required for `source`
SHELL := /usr/bin/env bash SHELL := /usr/bin/env bash
CORSET_ROOT := $(shell pwd)/../corset CORSET_ROOT := $(shell pwd)/../go-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}
VERSION := $(shell git rev-parse --short HEAD) 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" 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" DARWIN_ARM64_FLAGS := CGO_ENABLED=1 GOOS="linux" GOARCH="arm64"
# Ensure that we are using corset from the monorepo # Ensure that we are using go-corset from the monorepo
CORSET := PATH="${CORSET_ROOT}/target/release":$$PATH GO_CORSET := PATH="${CORSET_ROOT}/bin":$$PATH
# these targets are not defined as depending on source files, # these targets are not defined as depending on source files,
# so they should be recompiled by default “just in case”. # so they should be recompiled by default “just in case”.
@@ -30,21 +26,28 @@ CORSET := PATH="${CORSET_ROOT}/target/release":$$PATH
docker \ docker \
bin/prover \ bin/prover \
bin/checker \ bin/checker \
corset \ go-corset \
testdata \ testdata \
## ##
## This rule produces both the corset binary and libcorset.a & corset.h for the FFI ## This rule produces the go-corset binary
## ##
corset: go-corset:
cd ${CORSET_ROOT} && cargo build --release 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 zkevm/arithmetization/zkevm.bin: go-corset
cd ../constraints && $(CORSET) make zkevm.bin && mv zkevm.bin ../prover/zkevm/arithmetization 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) ## Generate the setup for the execution prover (to be run with S3 access)

View File

@@ -26,7 +26,7 @@ services:
dockerfile: ./prover/Dockerfile dockerfile: ./prover/Dockerfile
additional_contexts: additional_contexts:
prover: ../prover/ prover: ../prover/
corset: ../corset/ go-corset: ../go-corset/
constraints: ../constraints/ constraints: ../constraints/
environment: environment:
VERSION: "0.2.0" # TODO @gbotrel hunt all the hard coded version strings VERSION: "0.2.0" # TODO @gbotrel hunt all the hard coded version strings