Skip to content

Commit f33bfff

Browse files
Lawliet-Chan0xmountaintopxinran chenUbuntu
authored
feat(roller&coordinator): upgrade lizkp to zkevm-0215 version (#281)
Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: xinran chen <[email protected]> Co-authored-by: Ubuntu <[email protected]>
1 parent 4ad1746 commit f33bfff

File tree

31 files changed

+45003
-85219
lines changed

31 files changed

+45003
-85219
lines changed

.github/workflows/common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions-rs/toolchain@v1
2828
with:
29-
toolchain: nightly-2022-08-23
29+
toolchain: nightly-2022-12-10
3030
override: true
3131
components: rustfmt, clippy
3232
- name: Install Go

.github/workflows/coordinator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions-rs/toolchain@v1
2828
with:
29-
toolchain: nightly-2022-08-23
29+
toolchain: nightly-2022-12-10
3030
override: true
3131
components: rustfmt, clippy
3232
- name: Install Go

.github/workflows/roller.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions-rs/toolchain@v1
2828
with:
29-
toolchain: nightly-2022-08-23
29+
toolchain: nightly-2022-12-10
3030
override: true
3131
components: rustfmt, clippy
3232
- name: Install Go
@@ -42,6 +42,8 @@ jobs:
4242
- name: Test
4343
run: |
4444
make roller
45+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./prover/lib
46+
export CHAIN_ID=534353
4547
go test -v ./...
4648
check:
4749
runs-on: ubuntu-latest

Jenkinsfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pipeline {
1313
environment {
1414
GO111MODULE = 'on'
1515
PATH="/home/ubuntu/.cargo/bin:$PATH"
16+
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./coordinator/verifier/lib"
17+
CHAIN_ID='534353'
1618
// LOG_DOCKER = 'true'
1719
}
1820
stages {

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.PHONY: check update dev_docker clean
22

3+
ZKP_VERSION=release-1220
4+
35
help: ## Display this help message
46
@grep -h \
57
-E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
@@ -29,5 +31,15 @@ dev_docker: ## build docker images for development/testing usages
2931
docker build -t scroll_l1geth ./common/docker/l1geth/
3032
docker build -t scroll_l2geth ./common/docker/l2geth/
3133

34+
test_zkp: ## Test zkp prove and verify, roller/prover generates the proof and coordinator/verifier verifies it
35+
mkdir -p test_params
36+
wget https://circuit-release.s3.us-west-2.amazonaws.com/circuit-release/${ZKP_VERSION}/test_params/params19 -O ./test_params/params19
37+
wget https://circuit-release.s3.us-west-2.amazonaws.com/circuit-release/${ZKP_VERSION}/test_params/params26 -O ./test_params/params26
38+
wget https://circuit-release.s3.us-west-2.amazonaws.com/circuit-release/${ZKP_VERSION}/test_seed -O test_seed
39+
rm -rf ./roller/assets/test_params && mv test_params ./roller/assets/ && mv test_seed ./roller/assets/
40+
cd ./roller && make test-gpu-prover
41+
rm -rf ./coordinator/assets/test_params && mv ./roller/assets/test_params ./coordinator/assets/ && mv ./roller/assets/agg_proof ./coordinator/assets/
42+
cd ./coordinator && make test-gpu-verifier
43+
3244
clean: ## Empty out the bin folder
3345
@rm -rf build/bin

build/dockerfiles/coordinator.Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build libzkp dependency
2-
FROM scrolltech/go-rust-builder:go-1.18-rust-nightly-2022-08-23 as chef
2+
FROM scrolltech/go-rust-builder:go-1.18-rust-nightly-2022-12-10 as chef
33
WORKDIR app
44

55
FROM chef as planner
@@ -13,10 +13,11 @@ RUN cargo chef cook --release --recipe-path recipe.json
1313

1414
COPY ./common/libzkp/impl .
1515
RUN cargo build --release
16+
RUN find ./ | grep libzktrie.so | xargs -i cp {} /app/target/release/
1617

1718

1819
# Download Go dependencies
19-
FROM scrolltech/go-rust-builder:go-1.18-rust-nightly-2022-08-23 as base
20+
FROM scrolltech/go-rust-builder:go-1.18-rust-nightly-2022-12-10 as base
2021
WORKDIR /src
2122
COPY go.work* ./
2223
COPY ./bridge/go.* ./bridge/
@@ -32,12 +33,14 @@ RUN go mod download -x
3233
FROM base as builder
3334
COPY . .
3435
RUN cp -r ./common/libzkp/interface ./coordinator/verifier/lib
35-
COPY --from=zkp-builder /app/target/release/libzkp.so ./coordinator/verifier/lib/
36+
COPY --from=zkp-builder /app/target/release/libzkp.a ./coordinator/verifier/lib/
37+
COPY --from=zkp-builder /app/target/release/libzktrie.so ./coordinator/verifier/lib/
3638
RUN cd ./coordinator && go build -v -p 4 -o /bin/coordinator ./cmd && mv verifier/lib /bin/
3739

3840
# Pull coordinator into a second stage deploy alpine container
3941
FROM ubuntu:20.04
40-
42+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/src/coordinator/verifier/lib
43+
# ENV CHAIN_ID=534353
4144
RUN mkdir -p /src/coordinator/verifier/lib
4245
COPY --from=builder /bin/lib /src/coordinator/verifier/lib
4346
COPY --from=builder /bin/coordinator /bin/

0 commit comments

Comments
 (0)