Skip to content

Commit 194d5d1

Browse files
Autoparallelmattes
andauthored
feat: public params artifact (#55)
* rm: unneeded circuits * feat: `create-pp` binary * Update main.rs * feat: update `Makefile` and workflow * Update package.json * Update artifacts.yaml * fix: build * working local build * wip: prep to serialize pk/vk * Fix Github CI (#57) Using Personal Access Token to clone pluto/web-prover * deal with packages * this build works * fix: ci * fix: ci again * try with release tag (and fx not making zip) * remove extra build step * Revert "remove extra build step" This reverts commit b79a9c1. --------- Co-authored-by: Matt <1240531+mattes@users.noreply.github.com>
1 parent a97cc1a commit 194d5d1

6 files changed

Lines changed: 3337 additions & 10 deletions

File tree

.github/workflows/artifacts.yaml

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install Rust
5656
uses: dtolnay/rust-toolchain@master
5757
with:
58-
toolchain: nightly-2024-06-10
58+
toolchain: nightly-2024-10-28
5959

6060
- name: Install Circom
6161
run: |
@@ -87,18 +87,76 @@ jobs:
8787
make debug # Show what will be processed
8888
make build # Build the circuits
8989
90+
- name: Configure Git for Private Repos
91+
run: |
92+
git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf "https://github.com/"
93+
94+
- name: Build and run parameter generator
95+
run: |
96+
rustup install nightly
97+
98+
# Build the parameter generator
99+
cargo build --release
100+
101+
# Generate parameters using makefile target
102+
make params
103+
104+
# Verify parameter files were created
105+
for target_dir in builds/target_*b; do
106+
size=$(basename "$target_dir" | sed 's/target_//')
107+
# Calculate ROM length the same way as in Makefile
108+
rom_length=$(echo "${size%b} / 16 + 16" | bc)
109+
110+
# List of expected files
111+
files=(
112+
"aux_params_${size}_rom_length_${rom_length}.bin"
113+
"prover_key_${size}_rom_length_${rom_length}.bin"
114+
"verifier_key_${size}_rom_length_${rom_length}.bin"
115+
)
116+
117+
for file in "${files[@]}"; do
118+
if [ ! -f "$target_dir/artifacts/$file" ]; then
119+
echo "Error: File not found: $file in $target_dir/artifacts"
120+
exit 1
121+
else
122+
echo "Successfully verified: $file"
123+
fi
124+
done
125+
126+
echo "Successfully generated all parameter files for ${size}"
127+
done
128+
90129
- name: Create release artifacts
91130
run: |
92-
# Get the list of target directories
131+
# First verify parameter files were created
93132
for target_dir in builds/target_*b; do
133+
size=$(basename "$target_dir" | sed 's/target_//')
134+
# Calculate ROM length the same way as in Makefile
135+
rom_length=$(echo "${size%b} / 16 + 16" | bc)
136+
137+
# List of expected files
138+
files=(
139+
"aux_params_${size}_rom_length_${rom_length}.bin"
140+
"prover_key_${size}_rom_length_${rom_length}.bin"
141+
"verifier_key_${size}_rom_length_${rom_length}.bin"
142+
)
143+
144+
for file in "${files[@]}"; do
145+
if [ ! -f "$target_dir/artifacts/$file" ]; then
146+
echo "Error: File not found: $file in $target_dir/artifacts"
147+
exit 1
148+
else
149+
echo "Successfully verified: $file"
150+
fi
151+
done
152+
153+
echo "Successfully generated all parameter files for ${size}"
154+
155+
# Create zip archive for this target size
94156
if [ -d "$target_dir/artifacts" ]; then
95-
# Extract the target size from the directory name
96-
target_size=$(basename "$target_dir")
97-
98-
echo "Creating archive for $target_size"
99-
# Create zip file for this target size
157+
echo "Creating archive for $size"
100158
( cd "$target_dir/artifacts" && \
101-
zip -r "../../../circom-artifacts-${target_size}-v${{ env.VERSION }}.zip" . )
159+
zip -r "../../../circom-artifacts-${size}-v${{ env.VERSION }}.zip" . )
102160
fi
103161
done
104162

0 commit comments

Comments
 (0)