9595# proof. This is useful for quickly testing decoding and all of the
9696# other non-proving code.
9797if [[ $TEST_ONLY == " test_only" ]]; then
98- 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
99- if grep -q ' All proof witnesses have been generated successfully.' $TEST_OUT_PATH ; then
98+ cargo run --quiet --release --package zero --bin leader -- \
99+ --test-only \
100+ --runtime in-memory \
101+ --load-strategy on-demand \
102+ --block-batch-size " $BLOCK_BATCH_SIZE " \
103+ --proof-output-dir " $PROOF_OUTPUT_DIR " \
104+ stdio < " $INPUT_FILE " & > " $TEST_OUT_PATH "
105+
106+ if grep -q ' All proof witnesses have been generated successfully.' " $TEST_OUT_PATH " ; then
100107 echo -e " \n\nSuccess - Note this was just a test, not a proof"
101- rm $TEST_OUT_PATH
108+ rm " $TEST_OUT_PATH "
102109 exit
103110 else
104111 # Some error occurred, display the logs and exit.
105- cat $OUT_LOG_PATH
106- echo " Failed to create proof witnesses. See $OUT_LOG_PATH for more details."
112+ cat " $TEST_OUT_PATH "
113+ echo " Failed to create proof witnesses. See $TEST_OUT_PATH for more details."
107114 exit 1
108115 fi
109116fi
@@ -112,45 +119,43 @@ cargo build --release --jobs "$num_procs"
112119
113120
114121start_time=$( date +%s%N)
115- " ${REPO_ROOT} /target/release/leader" --runtime in-memory --load-strategy on-demand -n 1 --block-batch-size $BLOCK_BATCH_SIZE \
116- --proof-output-dir $PROOF_OUTPUT_DIR stdio < $INPUT_FILE & > $OUTPUT_LOG
122+ " ${REPO_ROOT} /target/release/leader" --runtime in-memory \
123+ --load-strategy on-demand -n 1 \
124+ --block-batch-size " $BLOCK_BATCH_SIZE " \
125+ --proof-output-dir " $PROOF_OUTPUT_DIR " stdio < " $INPUT_FILE " & > " $OUTPUT_LOG "
117126end_time=$( date +%s%N)
118127
119- cat $OUTPUT_LOG | grep " Successfully wrote to disk proof file " | awk ' {print $NF}' | tee $PROOFS_FILE_LIST
128+ grep " Successfully wrote to disk proof file " " $OUTPUT_LOG " | awk ' {print $NF}' | tee " $PROOFS_FILE_LIST "
120129if [ ! -s " $PROOFS_FILE_LIST " ]; then
121130 # Some error occurred, display the logs and exit.
122- cat $OUTPUT_LOG
131+ cat " $OUTPUT_LOG "
123132 echo " Proof list not generated, some error happened. For more details check the log file $OUTPUT_LOG "
124133 exit 1
125134fi
126135
127- cat $PROOFS_FILE_LIST | while read proof_file;
136+ while read -r proof_file;
128137do
129138 echo " Verifying proof file $proof_file "
130- verify_file=$PROOF_OUTPUT_DIR /verify_$( basename $proof_file ) .out
131- " ${REPO_ROOT} /target/release/verifier" -f $proof_file | tee $verify_file
132- if grep -q ' All proofs verified successfully!' $verify_file ; then
139+ verify_file=$PROOF_OUTPUT_DIR /verify_$( basename " $proof_file " ) .out
140+ " ${REPO_ROOT} /target/release/verifier" -f " $proof_file " | tee " $verify_file "
141+ if grep -q ' All proofs verified successfully!' " $verify_file " ; then
133142 echo " Proof verification for file $proof_file successful" ;
134- rm $verify_file # we keep the generated proof for potential reuse
143+ rm " $verify_file " # we keep the generated proof for potential reuse
135144 else
136145 # Some error occurred with verification, display the logs and exit.
137- cat $verify_file
146+ cat " $verify_file "
138147 echo " There was an issue with proof verification. See $verify_file for more details." ;
139148 exit 1
140149 fi
141- done
150+ done < " $PROOFS_FILE_LIST "
142151
143152duration_ns=$(( end_time - start_time))
144153duration_sec=$( echo " $duration_ns / 1000000000" | bc -l)
145154
146155echo " Success!"
147- echo " Proving duration:" $duration_sec " seconds"
156+ echo " Proving duration: $duration_sec seconds"
148157echo " Note, this duration is inclusive of circuit handling and overall process initialization" ;
149158
150159# Clean up in case of success
151- rm $OUTPUT_LOG
152-
153-
154-
155-
160+ rm " $OUTPUT_LOG "
156161
0 commit comments