Skip to content

Commit c0e6b9b

Browse files
authored
feat: upgrade project template (#71)
* feat: add zkMIPS template structure * feat: add network prover. * style: refactor code. * docs: update docs * chore: remove unused file. * feat: add CI * fix: CI * chore: remove clippy * fix: remove runner
1 parent 339e6c7 commit c0e6b9b

80 files changed

Lines changed: 2671 additions & 2735 deletions

Some content is hidden

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

.env.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Proof modes are `mock`, `local` and`network`.
2+
# `mock` is for generating mock proofs locally.
3+
# `local` is for generating proofs locally using the CPU.
4+
# `network` is for generating proofs using the ZKM Prover Network.
5+
# The default value is `local`.
6+
ZKM_PROVER=local
7+
8+
# Network configuration
9+
# See more: https://docs.zkm.io/dev/prover.html#network-prover
10+
ZKM_PRIVATE_KEY=
11+
CERT_PATH=
12+
KEY_PATH=

.github/workflows/ci.yml

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,12 @@ env:
1313
ZKM_SKIP_PROGRAM_BUILD: true
1414

1515
jobs:
16-
build_and_test:
17-
name: Rust project - latest
18-
runs-on: ubuntu-latest
19-
strategy:
20-
matrix:
21-
toolchain:
22-
- nightly
23-
steps:
24-
- uses: actions/checkout@v2
25-
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
26-
- name: Install Dependencies
27-
run: sudo apt install protobuf-compiler
28-
- name: Install Go
29-
uses: actions/setup-go@v3
30-
with:
31-
go-version: '1.22'
32-
- name: Cargo build
33-
run: cargo build --verbose --release
34-
- name: Cargo test
35-
run: cargo test --release --verbose
3616
fmt:
3717
name: Rustfmt
3818
runs-on: ubuntu-latest
3919
steps:
40-
- uses: actions/checkout@v2
41-
- uses: actions-rs/toolchain@v1
20+
- uses: actions/checkout@v4
21+
- uses: dtolnay/rust-toolchain@stable
4222
with:
43-
profile: minimal
44-
toolchain: nightly-2024-12-05
45-
override: true
46-
- run: rustup component add rustfmt
47-
- run: cargo fmt --all -- --check
48-
clippy:
49-
name: Clippy
50-
runs-on: ubuntu-latest
51-
steps:
52-
- uses: actions/checkout@v2
53-
- uses: actions-rs/toolchain@v1
54-
with:
55-
profile: minimal
56-
toolchain: nightly-2024-12-05
57-
override: true
58-
- name: Install Dependencies
59-
run: sudo apt install protobuf-compiler
60-
- run: rustup component add clippy
61-
- run: cargo clippy --all-targets -- -D warnings
62-
23+
components: rustfmt
24+
- run: cargo fmt --all -- --check

.github/workflows/foundry-test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Foundry Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
9+
env:
10+
FOUNDRY_PROFILE: ci
11+
12+
jobs:
13+
check:
14+
strategy:
15+
fail-fast: true
16+
17+
name: Foundry project
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Install Foundry
25+
uses: foundry-rs/foundry-toolchain@v1
26+
with:
27+
version: nightly
28+
29+
- name: Run Forge build
30+
run: |
31+
cd contracts
32+
forge --version
33+
forge build --sizes
34+
id: build
35+
36+
- name: Run Forge tests
37+
run: |
38+
cd contracts
39+
forge test -vvv
40+
id: test

.github/workflows/prove.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Program
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
9+
env:
10+
FOUNDRY_PROFILE: ci
11+
12+
jobs:
13+
check:
14+
strategy:
15+
fail-fast: true
16+
17+
name: Build and Execute
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Install rust toolchain
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
profile: minimal
28+
toolchain: 1.85.0
29+
30+
- name: Install zkMIPS toolchain
31+
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/zkMIPS/toolchain/refs/heads/main/setup.sh | sh
32+
- name: Install Dependencies
33+
run: sudo apt install protobuf-compiler
34+
- name: Execute zkMIPS program
35+
run: |
36+
source ~/.zkm-toolchain/env && cargo run --release -- --execute

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ libsnark.h
77
libsnark.so
88
*.log
99
Cargo.lock
10+
.env

Cargo.toml

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,10 @@
1-
[workspace]
2-
members = [
3-
"host-program/sha2-go",
4-
"host-program/sha2-rust",
5-
"host-program/revme",
6-
"host-program/mem-alloc-vec",
7-
"host-program/sha2-composition",
8-
"sdk"
9-
]
10-
resolver = "2"
11-
12-
[workspace.dependencies]
13-
zkm-prover = { git = "https://github.com/zkMIPS/zkm", branch = "main", default-features = false }
14-
zkm-emulator = { git = "https://github.com/zkMIPS/zkm", branch = "main", default-features = false }
15-
zkm-recursion = { git = "https://github.com/zkMIPS/zkm", branch = "main", default-features = false }
16-
zkm-build = { git = "https://github.com/zkMIPS/zkm", branch = "main", default-features = false }
17-
18-
#zkm-prover = { path = "../zkm/prover", default-features = false }
19-
#zkm-emulator = { path = "../zkm/emulator", default-features = false }
20-
#zkm-recursion = { path = "../zkm/recursion", default-features = false }
21-
#zkm-build = { path = "../zkm/build", default-features = false }
22-
23-
[profile.release]
24-
opt-level = 3
25-
26-
[profile.bench]
27-
opt-level = 3
28-
29-
[profile.fast]
30-
inherits = "release"
31-
debug = true
32-
debug-assertions = true
1+
[workspace]
2+
members = [
3+
"guest",
4+
"host",
5+
"lib"
6+
]
7+
resolver = "2"
8+
9+
[workspace.dependencies]
10+
alloy-sol-types = "1.0"

Dockerfile

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)