Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,18 @@ jobs:
- run: source ~/.zkm-toolchain/env && cd crates/test-artifacts && cargo build && cd ../..
- run: rustup component add clippy
- run: cargo clippy --all-targets -- -D warnings
test_github_hosted:
name: Cargo Test (ghithub hosted)
runs-on: ubuntu-latest
test:
name: Cargo Test
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/zkMIPS/toolchain/refs/heads/main/setup.sh | sh
- run: |
set -e
source ~/.zkm-toolchain/env
for pkg in zkm-core-executor zkm-curves zkm-derive zkm-primitives zkm-prover \
zkm-recursion-circuit zkm-recursion-compiler zkm-recursion-core \
zkm-recursion-gnark-ffi zkm-stark zkm-zkvm zkm-lib; do
cargo test -r -p $pkg
done
env:
RUSTFLAGS: "-C target-cpu=native"
test_self_hosted:
name: Cargo Test (self hosted)
concurrency:
group: ci-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: |
set -e
for pkg in zkm-core-machine zkm-sdk zkm-verifier; do
cargo test -r -p $pkg
done
env:
RUSTFLAGS: "-C target-cpu=native"
26 changes: 26 additions & 0 deletions .github/workflows/ci_scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Scheduled CI

on:
push:
branches: ["main"]
schedule:
- cron: '0 20 * * *'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Cargo Test
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: |
set -e
for pkg in zkm-core-machine zkm-sdk zkm-verifier; do
cargo test -r -p $pkg
done
env:
RUSTFLAGS: "-C target-cpu=native"
10 changes: 5 additions & 5 deletions docs/src/dev/prover.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The zkm_sdk crate provides all the necessary tools for proof generation. Key fea

When generating Groth16 or PLONK proofs, the `ProverClient` automatically downloads the pre-generated proving key (pk) from a trusted setup by calling `try_install_circuit_artifacts()`.

## Example: [Fibonacci](https://github.com/zkMIPS/zkm/blob/dev/init/examples/fibonacci/host/src/main.rs)
## Example: [Fibonacci](https://github.com/zkMIPS/zkMIPS/blob/main/examples/fibonacci/host/src/main.rs)

The following code is an example of using zkm_sdk in host.

Expand Down Expand Up @@ -81,7 +81,7 @@ pub enum ZKMProof {
}
```

### [Core Proof (Default)](https://github.com/zkMIPS/zkm/blob/dev/init/examples/fibonacci/host/src/main.rs)
### [Core Proof (Default)](https://github.com/zkMIPS/zkMIPS/blob/main/examples/fibonacci/host/src/main.rs)

The default prover mode generates a sequence of STARK proofs whose cumulative proof size scales linearly with the execution trace length.

Expand All @@ -90,7 +90,7 @@ let client = ProverClient::new();
client.prove(&pk, stdin).run().unwrap();
```

### [Compressed Proof](https://github.com/zkMIPS/zkm/blob/dev/init/examples/fibonacci/host/bin/compressed.rs)
### [Compressed Proof](https://github.com/zkMIPS/zkMIPS/blob/main/examples/fibonacci/host/bin/compressed.rs)

The compressed proving mode generates constant-sized STARK proofs, but not suitable for on-chain verification.

Expand All @@ -99,7 +99,7 @@ let client = ProverClient::new();
client.prove(&pk, stdin).compressed().run().unwrap();
```

### [Groth16 Proof (Recommended)](https://github.com/zkMIPS/zkm/blob/dev/init/examples/fibonacci/host/bin/groth16_bn254.rs)
### [Groth16 Proof (Recommended)](https://github.com/zkMIPS/zkMIPS/blob/main/examples/fibonacci/host/bin/groth16_bn254.rs)

The Groth16 proving mode ​generates succinct SNARK proofs with a compact size of approximately 260 bytes, ​and features on-chain verification.

Expand All @@ -108,7 +108,7 @@ let client = ProverClient::new();
client.prove(&pk, stdin).groth16().run().unwrap();
```

### [PLONK Proof](https://github.com/zkMIPS/zkm/blob/dev/init/examples/fibonacci/host/bin/plonk_bn254.rs)
### [PLONK Proof](https://github.com/zkMIPS/zkMIPS/blob/main/examples/fibonacci/host/bin/plonk_bn254.rs)

The PLONK proving mode generates succinct SNARK proofs with a compact size of approximately 868 bytes, while maintaining on-chain verifiability. In contrast to Groth16, PLONK removes the dependency on trusted setup ceremonies.

Expand Down