Skip to content

Commit 38da58b

Browse files
authored
feat: add ASM STF guest code and prover perf tooling (#9)
* feat: add ASM STF guest code * refactor(proof-impl): create a separate module for test utils * feat(prover-perf): create a new binary for guest code performance * ci(prover-perf): add prover workflow and just recipes for profiling * fix lints * fix: avoid running tests and docs for prover-perf * fix(ci): post report on CI * doc: add comment to fix the hardcoded spec
1 parent 1d4a95a commit 38da58b

File tree

20 files changed

+7559
-516
lines changed

20 files changed

+7559
-516
lines changed

.cargo/audit.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[advisories]
22
ignore = [
3-
# NOTE: cargo-audit reads config from .cargo/audit.toml.
4-
# RUSTSEC-2025-0055 (tracing-subscriber 0.2.25)
5-
# Pulled in via ark-relations.
6-
# Upgrade blocked until upstream bumps tracing-subscriber >= 0.3.20.
7-
# Low risk: affects ANSI escape sequences in logs only.
8-
"RUSTSEC-2025-0055",
3+
# NOTE: cargo-audit reads config from .cargo/audit.toml.
4+
# RUSTSEC-2025-0055 (tracing-subscriber 0.2.25)
5+
# Pulled in via ark-relations.
6+
# Upgrade blocked until upstream bumps tracing-subscriber >= 0.3.20.
7+
# Low risk: affects ANSI escape sequences in logs only.
8+
"RUSTSEC-2025-0055",
99
]

.github/workflows/prover.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Prover
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
push:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
permissions: {}
17+
18+
jobs:
19+
prover-perf:
20+
name: Run prover-perf (SP1)
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 120
23+
permissions:
24+
contents: read
25+
pull-requests: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
29+
with:
30+
persist-credentials: false
31+
32+
- name: Install Rust toolchain
33+
run: |
34+
RUST_TOOLCHAIN="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml)"
35+
rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal
36+
rustup default "$RUST_TOOLCHAIN"
37+
38+
- name: Rust cache
39+
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
40+
with:
41+
cache-on-failure: true
42+
43+
- name: Install SP1 Toolchain
44+
run: |
45+
curl -fsSL --proto '=https' --tlsv1.2 https://sp1.succinct.xyz | bash
46+
~/.sp1/bin/sp1up
47+
echo "$HOME/.sp1/bin" >> "$GITHUB_PATH"
48+
49+
- name: Check SP1 toolchain
50+
run: cargo prove --version
51+
52+
- name: Run prover-perf and post PR comment
53+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
54+
env:
55+
ZKVM_MOCK: "1"
56+
ZKVM_PROFILING: "1"
57+
run: |
58+
cargo run --release -p strata-asm-prover-perf -- \
59+
--post-to-gh \
60+
--github-token "${{ secrets.GITHUB_TOKEN }}" \
61+
--pr-number "${{ github.event.pull_request.number }}" \
62+
--commit-hash "${{ github.sha }}" \
63+
--github-repo "${{ github.repository }}" \
64+
--programs asm-stf
65+
66+
- name: Run prover-perf
67+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == true
68+
env:
69+
ZKVM_MOCK: "1"
70+
ZKVM_PROFILING: "1"
71+
run: cargo run --release -p strata-asm-prover-perf -- --programs asm-stf

.justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Prover perf variables
2+
prover_perf_eval_dir := "bin/prover-perf"
3+
prover_programs := "asm-stf"
4+
15
# List all the available commands
26
default:
37
just --list
@@ -63,3 +67,11 @@ audit:
6367
# Check GitHub Actions security analysis with `zizmor`
6468
check-github-actions-security:
6569
zizmor .
70+
71+
# Generate reports and profiling data for proofs
72+
prover-eval: prover-clean
73+
cd {{prover_perf_eval_dir}} && RUST_LOG=info ZKVM_MOCK=1 ZKVM_PROFILING=1 cargo run --release -- --programs {{prover_programs}}
74+
75+
# Cleans up profiling data generated by prover eval
76+
prover-clean:
77+
rm -rf {{prover_perf_eval_dir}}/*.trace

0 commit comments

Comments
 (0)