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
1 change: 1 addition & 0 deletions circuits/scripts/build/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ REGISTER_ID_CIRCUITS=(
"register_id_sha512_sha512_sha512_ecdsa_secp521r1:true"
"register_id_sha512_sha512_sha512_rsa_65537_4096:true"
"register_id_sha512_sha512_sha512_rsapss_65537_64_2048:true"
"register_id_sha512_sha512_sha256_rsapss_65537_32_2048:true"
)
Comment on lines +72 to 73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Enablement looks good; fix silent-failure risk in parallel build.

With more enabled circuits, a failed compile still yields “All circuits compiled successfully!” because only the last wait’s status is surfaced. Make the script fail fast if any job fails.

Apply this change near the end to aggregate exit codes:

-echo "Waiting for all circuits to compile..."
-wait "${pids[@]}"
-echo "All circuits compiled successfully!"
+echo "Waiting for all circuits to compile..."
+failures=0
+for pid in "${pids[@]}"; do
+  if ! wait "$pid"; then
+    echo "❌ Compile process $pid failed"
+    failures=$((failures+1))
+  fi
+done
+if (( failures > 0 )); then
+  echo "❌ $failures circuit(s) failed to compile"
+  exit 1
+fi
+echo "✅ All circuits compiled successfully!"

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In circuits/scripts/build/build_cpp.sh around lines 72-73, the script starts
parallel compile jobs but only checks the last wait status, causing a false "All
circuits compiled successfully!" when earlier jobs fail; modify the end to
record PIDs of all background jobs, loop over them calling wait PID and collect
each exit code, and if any wait returns non-zero exit immediately (or after
aggregating) with a non-zero exit status and do not print the success message;
optionally add a trap to kill child jobs on early exit.


REGISTER_AADHAAR_CIRCUITS=(
Expand Down
1 change: 1 addition & 0 deletions circuits/scripts/build/build_single_circuit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ REGISTER_ID_CIRCUITS=(
"register_id_sha512_sha512_sha512_ecdsa_secp521r1"
"register_id_sha512_sha512_sha512_rsa_65537_4096"
"register_id_sha512_sha512_sha512_rsapss_65537_64_2048"
"register_id_sha512_sha512_sha256_rsapss_65537_32_2048"
)

REGISTER_AADHAAR_CIRCUITS=(
Expand Down