Skip to content

Commit b821044

Browse files
Merge branch 'main' into feat/edwards-curve-support
2 parents cb4e446 + bee97a7 commit b821044

File tree

58 files changed

+960
-404
lines changed

Some content is hidden

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

58 files changed

+960
-404
lines changed

.github/workflows/cli.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@ name: OpenVM CLI Tests
33
on:
44
push:
55
branches: ["main"]
6+
tags: ["v*"]
67
pull_request:
78
branches: ["**"]
89
paths:
910
- "crates/circuits/primitives/**"
1011
- "crates/vm/**"
12+
- "crates/toolchain/**"
1113
- "crates/sdk/**"
1214
- "crates/cli/**"
1315
- "examples/**"
1416
- "Cargo.toml"
1517
- ".github/workflows/cli.yml"
18+
workflow_dispatch:
19+
inputs:
20+
use_local_openvm:
21+
description: "Test cargo openvm init using local patch"
22+
required: true
23+
type: boolean
24+
default: false
1625

1726
concurrency:
1827
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@@ -74,6 +83,14 @@ jobs:
7483
cargo build
7584
cargo run --bin cargo-openvm -- openvm keygen --config ./example/app_config.toml --output-dir .
7685
86+
- name: Set USE_LOCAL_OPENVM environment variable
87+
run: |
88+
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == refs/tags/* ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.use_local_openvm }}" == "false" ]]; then
89+
echo "USE_LOCAL_OPENVM=0" >> $GITHUB_ENV
90+
else
91+
echo "USE_LOCAL_OPENVM=1" >> $GITHUB_ENV
92+
fi
93+
7794
- name: Run CLI tests
7895
working-directory: crates/cli
7996
run: |

.github/workflows/extension-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- "crates/circuits/**"
1010
- "crates/vm/**"
11+
- "crates/toolchain/**"
1112
- "extensions/**"
1213
- "Cargo.toml"
1314
- ".github/workflows/extension-tests.yml"
@@ -51,6 +52,7 @@ jobs:
5152
filters: |
5253
- "crates/circuits/**"
5354
- "crates/vm/**"
55+
- "crates/toolchain/**"
5456
- "extensions/${{ matrix.extensions.path }}/**"
5557
- ".github/workflows/extension-tests.yml"
5658
- name: Skip if no changes

.github/workflows/guest-lib-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- "crates/circuits/**"
1010
- "crates/vm/**"
11+
- "crates/toolchain/**"
1112
- "extensions/**"
1213
- "guest-libs/**"
1314
- "Cargo.toml"
@@ -33,6 +34,7 @@ jobs:
3334
- { name: "p256", path: "p256" }
3435
- { name: "ruint", path: "ruint" }
3536
- { name: "pairing", path: "pairing" }
37+
- { name: "verify_stark", path: "verify_stark" }
3638
# Ensure tests run in parallel even if one fails
3739
fail-fast: false
3840

@@ -51,6 +53,7 @@ jobs:
5153
filters: |
5254
- "crates/circuits/**"
5355
- "crates/vm/**"
56+
- "crates/toolchain/**"
5457
- "extensions/**"
5558
- "guest-libs/${{ matrix.crate.path }}/**"
5659
- ".github/workflows/guest-lib-tests.yml"

.github/workflows/riscv.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ on:
77
branches: ["**"]
88
paths:
99
- "crates/vm/**"
10-
- "crates/toolchain/platform/**"
11-
- "crates/toolchain/instructions/**"
12-
- "crates/toolchain/build/**"
13-
- "crates/toolchain/macros/**"
14-
- "crates/toolchain/tests/**"
10+
- "crates/toolchain/**"
1511
- "Cargo.toml"
1612
- ".github/workflows/riscv.yml"
1713

.github/workflows/sdk.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- "crates/circuits/primitives/**"
1010
- "crates/vm/**"
11+
- "crates/toolchain/**"
1112
- "crates/sdk/**"
1213
- "Cargo.toml"
1314
- ".github/workflows/sdk.yml"

.github/workflows/versioning.yml

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Workflow to verify versioning compatibility between base branch and patch versions
2+
name: Verify Versioning Compatibility
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Version tag to compare (e.g., v1.2.0)"
9+
required: true
10+
default: "v1.2.0"
11+
type: string
12+
13+
jobs:
14+
verify-versioning:
15+
runs-on:
16+
- runs-on=${{ github.run_id }}
17+
- runner=64cpu-linux-arm64
18+
- extras=s3-cache
19+
- disk=large
20+
steps:
21+
- name: Checkout base branch
22+
uses: actions/checkout@v4
23+
24+
- name: Set version fallback
25+
run: echo "version=${{ github.event.inputs.version || 'v1.2.0' }}" >> $GITHUB_ENV
26+
27+
- name: Install solc # svm should support arm64 linux
28+
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
29+
30+
- name: Install Rust
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
toolchain: stable
34+
35+
- name: Cache Cargo dependencies
36+
uses: Swatinem/rust-cache@v2
37+
38+
# Build and test from base branch
39+
- name: Build base branch CLI
40+
run: cargo install --force --path crates/cli
41+
42+
- name: Run setup from base branch and snapshot ~/.openvm
43+
run: |
44+
cargo openvm setup --evm
45+
rm -rf ~/.openvm-base
46+
mv ~/.openvm ~/.openvm-base
47+
48+
# - name: Build and keygen examples from base branch
49+
# run: |
50+
# mkdir -p ./base-outputs/examples
51+
# for example in examples/*/; do
52+
# if [ -f "$example/Cargo.toml" ]; then
53+
# example_name=$(basename "$example")
54+
# echo "Building and generating keys for example: $example_name"
55+
# cd "$example"
56+
# cargo openvm build --no-transpile
57+
# cargo openvm keygen --output-dir "../../base-outputs/examples/$example_name"
58+
# cd ../..
59+
# fi
60+
# done
61+
62+
- name: Build and keygen benchmarks from base branch
63+
run: |
64+
mkdir -p ./base-outputs/benchmarks
65+
for benchmark in benchmarks/guest/*/; do
66+
if [ -f "$benchmark/Cargo.toml" ]; then
67+
benchmark_name=$(basename "$benchmark")
68+
echo "Building and generating keys for benchmark: $benchmark_name"
69+
cd "$benchmark"
70+
cargo openvm build --no-transpile
71+
cargo openvm keygen --output-dir "../../../base-outputs/benchmarks/$benchmark_name"
72+
cd ../../..
73+
fi
74+
done
75+
76+
# Checkout and test tagged version
77+
- name: Checkout tagged version
78+
uses: actions/checkout@v4
79+
with:
80+
ref: ${{ env.version }}
81+
clean: false
82+
83+
- name: Build tagged CLI
84+
run: cargo install --force --path crates/cli
85+
86+
- name: Run setup from tagged version
87+
run: |
88+
# TODO: Add --evm after v1.3.0 release
89+
cargo openvm setup
90+
91+
# - name: Build and keygen examples from tagged version
92+
# run: |
93+
# mkdir -p ./tagged-outputs/examples
94+
# for example in examples/*/; do
95+
# if [ -f "$example/Cargo.toml" ]; then
96+
# example_name=$(basename "$example")
97+
# echo "Building and generating keys for example: $example_name"
98+
# cd "$example"
99+
# cargo openvm build --no-transpile
100+
# # TODO(yi): Change --vk-output to --output-dir after v1.3.0 release
101+
# mkdir -p "../../tagged-outputs/examples/$example_name"
102+
# cargo openvm keygen --vk-output "../../tagged-outputs/examples/$example_name/app.vk"
103+
# cd ../..
104+
# fi
105+
# done
106+
107+
- name: Build and keygen benchmarks from tagged version
108+
run: |
109+
mkdir -p ./tagged-outputs/benchmarks
110+
for benchmark in benchmarks/guest/*/; do
111+
if [ -f "$benchmark/Cargo.toml" ]; then
112+
benchmark_name=$(basename "$benchmark")
113+
echo "Building and generating keys for benchmark: $benchmark_name"
114+
cd "$benchmark"
115+
cargo openvm build --no-transpile
116+
# TODO(yi): Change --vk-output to --output-dir after v1.3.0 release
117+
mkdir -p "../../../tagged-outputs/benchmarks/$benchmark_name"
118+
cargo openvm keygen --vk-output "../../../tagged-outputs/benchmarks/$benchmark_name/app.vk"
119+
cd ../../..
120+
fi
121+
done
122+
123+
# - name: Compare example verification keys
124+
# run: |
125+
# echo "Comparing example verification keys between base branch and ${{ env.version }}..."
126+
# failed=0
127+
# for example in examples/*/; do
128+
# if [ -f "$example/Cargo.toml" ]; then
129+
# example_name=$(basename "$example")
130+
# echo "Checking example: $example_name"
131+
# if cmp "./base-outputs/examples/$example_name/app.vk" "./tagged-outputs/examples/$example_name/app.vk"; then
132+
# echo "✅ $example_name verification keys are identical"
133+
# else
134+
# echo "❌ $example_name verification keys differ"
135+
# failed=1
136+
# fi
137+
# fi
138+
# done
139+
# if [ $failed -eq 1 ]; then
140+
# echo "❌ Some example verification keys differ - versioning policy violated"
141+
# exit 1
142+
# else
143+
# echo "✅ All example verification keys are identical"
144+
# fi
145+
146+
- name: Compare benchmark verification keys
147+
run: |
148+
echo "Comparing benchmark verification keys between base branch and ${{ env.version }}..."
149+
failed=0
150+
for benchmark in benchmarks/guest/*/; do
151+
if [ -f "$benchmark/Cargo.toml" ]; then
152+
benchmark_name=$(basename "$benchmark")
153+
echo "Checking benchmark: $benchmark_name"
154+
if cmp "./base-outputs/benchmarks/$benchmark_name/app.vk" "./tagged-outputs/benchmarks/$benchmark_name/app.vk"; then
155+
echo "✅ $benchmark_name verification keys are identical"
156+
else
157+
echo "❌ $benchmark_name verification keys differ"
158+
failed=1
159+
fi
160+
fi
161+
done
162+
if [ $failed -eq 1 ]; then
163+
echo "❌ Some benchmark verification keys differ - versioning policy violated"
164+
exit 1
165+
else
166+
echo "✅ All benchmark verification keys are identical"
167+
fi
168+
169+
# Compare all outputs
170+
# TODO: After v1.3.0 release, just compare the contents of ~/.openvm-base
171+
# and ~/.openvm
172+
- name: Compare ~/.openvm contents
173+
run: |
174+
echo "🔍 Comparing ~/.openvm agg and halo2 outputs between base branch and ${{ env.version }}..."
175+
176+
failed=0
177+
178+
# Compare agg.pk with agg_halo2.pk
179+
if cmp ~/.openvm-base/agg.pk ~/.openvm/agg_halo2.pk; then
180+
echo "✅ agg.pk and agg_halo2.pk are identical"
181+
else
182+
echo "❌ agg.pk and agg_halo2.pk differ"
183+
failed=1
184+
fi
185+
186+
# Compare halo2 directories recursively
187+
if diff -r ~/.openvm-base/halo2 ~/.openvm/halo2; then
188+
echo "✅ halo2 directories are identical"
189+
else
190+
echo "❌ halo2 directories differ"
191+
failed=1
192+
fi
193+
194+
if [ $failed -eq 1 ]; then
195+
echo "❌ ~/.openvm outputs differ"
196+
exit 1
197+
else
198+
echo "✅ All checked ~/.openvm outputs are identical"
199+
fi
200+
201+
- name: Final summary
202+
run: |
203+
echo "🎉 Versioning compatibility verification completed successfully!"
204+
echo "✅ Setup outputs are identical between base branch and ${{ env.version }}"
205+
echo "✅ All example verification keys are identical"
206+
echo "✅ All benchmark verification keys are identical"
207+
echo "✅ Versioning policy maintained - patch upgrade is backward compatible"

0 commit comments

Comments
 (0)