File tree Expand file tree Collapse file tree 1 file changed +20
-14
lines changed
aggregation_mode/proof_aggregator/src/aggregators Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -208,20 +208,26 @@ pub(crate) fn run_chunk_aggregator(
208208 let stark_proof_path = format ! ( "{OUTPUT_PATH}/vadcop_final_proof.bin" ) ;
209209 let home_dir = std:: env:: var ( "HOME" ) . expect ( "HOME environment variable not set" ) ;
210210 let proving_key_path = format ! ( "{home_dir}/{PROVING_KEY_SNARK_DIR}" ) ;
211- let mut snark_command = std:: process:: Command :: new ( "cargo-zisk" ) ;
212- let snark_status = snark_command
213- . env ( "RUSTC" , & zisk_rustc_path)
214- . args ( [
215- "prove-snark" ,
216- "-p" ,
217- & stark_proof_path,
218- "-k" ,
219- & proving_key_path,
220- "-o" ,
221- SNARK_OUTPUT_PATH ,
222- ] )
223- . current_dir ( ZISK_PROGRAMS_DIR )
224- . status ( ) ?;
211+ let snark_status = {
212+ let mut run_snark = || {
213+ std:: process:: Command :: new ( "cargo-zisk" )
214+ . env ( "RUSTC" , & zisk_rustc_path)
215+ . args ( [
216+ "prove-snark" ,
217+ "-p" ,
218+ & stark_proof_path,
219+ "-k" ,
220+ & proving_key_path,
221+ "-o" ,
222+ SNARK_OUTPUT_PATH ,
223+ ] )
224+ . current_dir ( ZISK_PROGRAMS_DIR )
225+ . status ( )
226+ } ;
227+ // Dark magic: the first run tends to fail, while the second succeeds.
228+ let _ = run_snark ( ) ?;
229+ run_snark ( ) ?
230+ } ;
225231
226232 if !snark_status. success ( ) {
227233 return Err ( AlignedZiskError :: Aggregation ( format ! (
You can’t perform that action at this time.
0 commit comments