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: 0 additions & 1 deletion .github/workflows/pr_checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jobs:
run: gh pr close ${{ github.event.pull_request.number }} --comment "Spam detected"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

26 changes: 26 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- # Workflow to run shellckeck on all shell scripts

name: Shellcheck
on:
pull_request:
paths:
- '**/*.sh'
- 'scripts/**'
workflow_dispatch:
branches:
- "**"

jobs:
shellcheck_scripts:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- name: Install shellcheck
run: sudo apt-get install shellcheck=0.8.0-2

- name: Run shellcheck
run: |
cd scripts
shellcheck ./*.sh
49 changes: 27 additions & 22 deletions scripts/prove_stdio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,22 @@ fi
# proof. This is useful for quickly testing decoding and all of the
# other non-proving code.
if [[ $TEST_ONLY == "test_only" ]]; then
cargo run --quiet --release --package zero --bin leader -- --test-only --runtime in-memory --load-strategy on-demand --block-batch-size $BLOCK_BATCH_SIZE --proof-output-dir $PROOF_OUTPUT_DIR stdio < $INPUT_FILE &> $TEST_OUT_PATH
if grep -q 'All proof witnesses have been generated successfully.' $TEST_OUT_PATH; then
cargo run --quiet --release --package zero --bin leader -- \
--test-only \
--runtime in-memory \
--load-strategy on-demand \
--block-batch-size "$BLOCK_BATCH_SIZE" \
--proof-output-dir "$PROOF_OUTPUT_DIR" \
stdio < "$INPUT_FILE" &> "$TEST_OUT_PATH"

if grep -q 'All proof witnesses have been generated successfully.' "$TEST_OUT_PATH"; then
echo -e "\n\nSuccess - Note this was just a test, not a proof"
rm $TEST_OUT_PATH
rm "$TEST_OUT_PATH"
exit
else
# Some error occurred, display the logs and exit.
cat $OUT_LOG_PATH
echo "Failed to create proof witnesses. See $OUT_LOG_PATH for more details."
cat "$TEST_OUT_PATH"
echo "Failed to create proof witnesses. See $TEST_OUT_PATH for more details."
exit 1
fi
fi
Expand All @@ -112,45 +119,43 @@ cargo build --release --jobs "$num_procs"


start_time=$(date +%s%N)
"${REPO_ROOT}/target/release/leader" --runtime in-memory --load-strategy on-demand -n 1 --block-batch-size $BLOCK_BATCH_SIZE \
--proof-output-dir $PROOF_OUTPUT_DIR stdio < $INPUT_FILE &> $OUTPUT_LOG
"${REPO_ROOT}/target/release/leader" --runtime in-memory \
--load-strategy on-demand -n 1 \
--block-batch-size "$BLOCK_BATCH_SIZE" \
--proof-output-dir "$PROOF_OUTPUT_DIR" stdio < "$INPUT_FILE" &> "$OUTPUT_LOG"
end_time=$(date +%s%N)

cat $OUTPUT_LOG | grep "Successfully wrote to disk proof file " | awk '{print $NF}' | tee $PROOFS_FILE_LIST
grep "Successfully wrote to disk proof file " "$OUTPUT_LOG" | awk '{print $NF}' | tee "$PROOFS_FILE_LIST"
if [ ! -s "$PROOFS_FILE_LIST" ]; then
# Some error occurred, display the logs and exit.
cat $OUTPUT_LOG
cat "$OUTPUT_LOG"
echo "Proof list not generated, some error happened. For more details check the log file $OUTPUT_LOG"
exit 1
fi

cat $PROOFS_FILE_LIST | while read proof_file;
while read -r proof_file;
do
echo "Verifying proof file $proof_file"
verify_file=$PROOF_OUTPUT_DIR/verify_$(basename $proof_file).out
"${REPO_ROOT}/target/release/verifier" -f $proof_file | tee $verify_file
if grep -q 'All proofs verified successfully!' $verify_file; then
verify_file=$PROOF_OUTPUT_DIR/verify_$(basename "$proof_file").out
"${REPO_ROOT}/target/release/verifier" -f "$proof_file" | tee "$verify_file"
if grep -q 'All proofs verified successfully!' "$verify_file"; then
echo "Proof verification for file $proof_file successful";
rm $verify_file # we keep the generated proof for potential reuse
rm "$verify_file" # we keep the generated proof for potential reuse
else
# Some error occurred with verification, display the logs and exit.
cat $verify_file
cat "$verify_file"
echo "There was an issue with proof verification. See $verify_file for more details.";
exit 1
fi
done
done < "$PROOFS_FILE_LIST"

duration_ns=$((end_time - start_time))
duration_sec=$(echo "$duration_ns / 1000000000" | bc -l)

echo "Success!"
echo "Proving duration:" $duration_sec " seconds"
echo "Proving duration: $duration_sec seconds"
echo "Note, this duration is inclusive of circuit handling and overall process initialization";

# Clean up in case of success
rm $OUTPUT_LOG




rm "$OUTPUT_LOG"

Loading