Skip to content

Commit fa9c8cb

Browse files
tamirhemoclaude
andauthored
feat(zkevm): SP1 platform for ZKEVM guests (eth-act zkvm-standards) (#2763)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c604834 commit fa9c8cb

237 files changed

Lines changed: 54358 additions & 217 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "slop/**"
1212
- "sp1-gpu/**"
1313
- "examples/**"
14+
- "zkevm/**"
1415
- "Cargo.toml"
1516
- ".github/workflows/**"
1617
- ".github/actions/**"

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ jobs:
332332
docker-tag: ${{ needs.prepare.outputs.tag_name }}
333333
dry-run: ${{ inputs.dry_run }}
334334

335+
zkevm-sdk-release:
336+
name: zkEVM SDK build and upload
337+
needs: [prepare]
338+
uses: ./.github/workflows/zkevm-sdk-build.yml
339+
with:
340+
version: ${{ needs.prepare.outputs.tag_name }}
341+
release_tag: ${{ needs.prepare.outputs.tag_name }}
342+
dry_run: ${{ inputs.dry_run }}
343+
secrets: inherit
344+
335345
set-latest-release:
336346
name: Set latest release
337347
runs-on: ubuntu-latest
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: zkevm-sdk-build
2+
3+
# Builds the redistributable `zkevm-sdk-<version>.tar.gz` artifact.
4+
# Contents (host-independent — `libzkevm.a` is always built for
5+
# `riscv64im-succinct-zkvm-elf`):
6+
#
7+
# zkevm-sdk-<version>/
8+
# ├── libzkevm.a
9+
# ├── zkvm.ld
10+
# ├── include/zkvm_accelerators.h
11+
# └── README.md
12+
#
13+
# Triggers:
14+
# - workflow_dispatch: manual sanity-check build. Uploads the tarball
15+
# as a workflow artifact (downloadable from the Actions UI).
16+
# - workflow_call: invoked from `release.yml` as part of the SP1
17+
# release process. With `release_tag` set, the tarball is
18+
# `gh release upload`-ed to that tag instead of being kept as a
19+
# workflow artifact.
20+
21+
on:
22+
workflow_dispatch:
23+
inputs:
24+
version:
25+
description: 'SDK version (used in the tarball filename, e.g. v6.2.0 or 0.1.0-pre)'
26+
required: true
27+
default: '0.1.0-pre'
28+
workflow_call:
29+
inputs:
30+
version:
31+
description: 'SDK version (used in the tarball filename)'
32+
type: string
33+
required: true
34+
release_tag:
35+
description: 'If non-empty, gh release upload the tarball to this tag instead of saving a workflow artifact'
36+
type: string
37+
default: ''
38+
dry_run:
39+
description: 'Dry run - build but skip the release upload'
40+
type: boolean
41+
default: false
42+
43+
jobs:
44+
build:
45+
runs-on: [runs-on, runner=8cpu-linux-x64, "run-id=${{ github.run_id }}"]
46+
timeout-minutes: 60
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v6
50+
51+
- name: Setup CI
52+
uses: ./.github/actions/setup
53+
54+
- name: Install SP1 toolchain (succinct)
55+
run: cargo run -p sp1-cli --no-default-features -- prove install-toolchain
56+
57+
- name: Build SDK archive
58+
run: make -C zkevm sdk-archive SDK_VERSION=${{ inputs.version }}
59+
60+
- name: Upload tarball as workflow artifact
61+
if: ${{ inputs.release_tag == '' }}
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: zkevm-sdk-${{ inputs.version }}
65+
path: zkevm/zkevm-sdk-${{ inputs.version }}.tar.gz
66+
retention-days: 30
67+
68+
- name: Upload tarball to release
69+
if: ${{ inputs.release_tag != '' && inputs.dry_run != true }}
70+
env:
71+
GH_TOKEN: ${{ secrets.SP1_RELEASE_TOKEN }}
72+
run: |
73+
gh release upload "${{ inputs.release_tag }}" "zkevm/zkevm-sdk-${{ inputs.version }}.tar.gz"

.github/workflows/zkevm.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: ZKEVM
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "zkevm/**"
8+
- "crates/zkvm/**"
9+
- "crates/build/**"
10+
- ".github/workflows/zkevm.yml"
11+
pull_request:
12+
branches:
13+
- "**"
14+
paths:
15+
- "zkevm/**"
16+
- "crates/zkvm/**"
17+
- "crates/build/**"
18+
- ".github/workflows/zkevm.yml"
19+
merge_group:
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
conformance:
27+
name: SDK build + executor conformance
28+
runs-on:
29+
[
30+
runs-on,
31+
runner=64cpu-linux-x64,
32+
spot=false,
33+
disk=large,
34+
"run-id=${{ github.run_id }}",
35+
]
36+
env:
37+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
38+
steps:
39+
- name: Checkout sources
40+
uses: actions/checkout@v6
41+
42+
- name: Setup CI
43+
uses: ./.github/actions/setup
44+
with:
45+
pull_token: ${{ secrets.PRIVATE_PULL_TOKEN }}
46+
47+
- name: Install SP1 toolchain from repo
48+
run: cargo run -p sp1-cli --no-default-features -- prove install-toolchain
49+
50+
# Builds libzkevm-cabi for the riscv target and assembles sdk/
51+
# (libzkevm.a + zkvm.ld + headers) — the artifact C guests link.
52+
- name: Build SDK staticlib
53+
run: make -C zkevm sdk
54+
55+
# Runs the full official vector suites (geth precompile testdata,
56+
# Wycheproof sample) through the accelerator C ABI inside the SP1
57+
# executor — i.e. over the real syscall paths. Host-side (software
58+
# fallback) coverage of the same suites runs in pr.yml via
59+
# `cargo test -p libzkevm`.
60+
- name: Run executor conformance
61+
working-directory: zkevm/examples
62+
run: cargo run --release -p conformance-script --bin conformance-execute
63+
env:
64+
RUST_LOG: info
65+
RUST_BACKTRACE: 1

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ crates/perf/data/
3333
crates/prover/maximal_shapes.sh
3434

3535
# Build Artifacts
36+
# zkevm/sdk is fully generated by `make -C zkevm sdk` (zkevm-build-sdk)
37+
zkevm/sdk/
38+
# C guest objects/ELFs built by the zkevm example/template Makefiles
39+
zkevm/examples/**/*.o
40+
zkevm/examples/**/*.elf
3641
recursion/gnark-ffi/build
3742
crates/prover/build
3843
crates/prover/data

0 commit comments

Comments
 (0)