From 6b2978799cf29e09a7f1f640dab590aa7c6d13df Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Fri, 14 Jun 2024 19:20:55 +0200 Subject: [PATCH] fix: printout --- leader/src/jerigon.rs | 9 ++++++++- leader/src/stdio.rs | 6 +++++- tools/prove_jerigon.sh | 4 ++-- tools/prove_stdio.sh | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/leader/src/jerigon.rs b/leader/src/jerigon.rs index 259b7612..f4175398 100644 --- a/leader/src/jerigon.rs +++ b/leader/src/jerigon.rs @@ -7,7 +7,7 @@ use common::block_interval::BlockInterval; use common::fs::generate_block_proof_file_name; use paladin::runtime::Runtime; use proof_gen::proof_types::GeneratedBlockProof; -use tracing::{error, warn}; +use tracing::{error, info, warn}; #[derive(Debug, Default)] pub struct ProofParams { @@ -48,6 +48,7 @@ pub(crate) async fn jerigon_main( if params.keep_intermediate_proofs { if params.proof_output_dir.is_some() { + // All proof files (including intermediary) are written to disk and kept warn!("Skipping cleanup, intermediate proof files are kept"); } else { // Output all proofs to stdout @@ -83,5 +84,11 @@ pub(crate) async fn jerigon_main( } } + if cfg!(feature = "test_only") { + info!("All dummy proofs have been generated successfully."); + } else { + info!("All proofs have been generated successfully."); + } + Ok(()) } diff --git a/leader/src/stdio.rs b/leader/src/stdio.rs index 673b50e9..b81fd1a6 100644 --- a/leader/src/stdio.rs +++ b/leader/src/stdio.rs @@ -26,7 +26,11 @@ pub(crate) async fn stdio_main( runtime.close().await?; let proved_blocks = proved_blocks?; - info!("All witnesses have been generated successfully."); + if cfg!(feature = "test_only") { + info!("All dummy proofs have been generated successfully."); + } else { + info!("All proofs have been generated successfully."); + } let proofs: Vec = proved_blocks .into_iter() diff --git a/tools/prove_jerigon.sh b/tools/prove_jerigon.sh index 62766157..71d7d063 100755 --- a/tools/prove_jerigon.sh +++ b/tools/prove_jerigon.sh @@ -82,7 +82,7 @@ if [[ $5 == "test_only" ]]; then # test only run echo "Proving blocks ${BLOCK_INTERVAL} in a test_only mode now... (Total: ${TOT_BLOCKS})" cargo r --release --features test_only --bin leader -- --runtime in-memory --load-strategy on-demand jerigon --rpc-url "$NODE_RPC_URL" --block-interval $BLOCK_INTERVAL --proof-output-dir $PROOF_OUTPUT_DIR $PREV_PROOF_EXTRA_ARG > $OUT_LOG_PATH 2>&1 - if grep 'Successfully generated witness for block' $OUT_LOG_PATH; then + if grep 'All dummy proofs have been generated successfully.' $OUT_LOG_PATH; then echo "Success - Note this was just a test, not a proof" # Remove the log on success if we don't want to keep it. if [ $ALWAYS_WRITE_LOGS -ne 1 ]; then @@ -90,7 +90,7 @@ if [[ $5 == "test_only" ]]; then fi exit else - echo "Failed to create a witness" + echo "Failed to create dummy proofs. See ${OUT_LOG_PATH} for more details." exit 1 fi else diff --git a/tools/prove_stdio.sh b/tools/prove_stdio.sh index af6eb87b..03939bfe 100755 --- a/tools/prove_stdio.sh +++ b/tools/prove_stdio.sh @@ -68,11 +68,11 @@ fi # other non-proving code. if [[ $TEST_ONLY == "test_only" ]]; then cargo run --release --features test_only --bin leader -- --runtime in-memory --load-strategy on-demand stdio < $INPUT_FILE | tee test.out - if grep 'All witnesses have been generated successfully.' test.out; then + if grep 'All dummy proofs have been generated successfully.' test.out; then echo "Success - Note this was just a test, not a proof" exit else - echo "Failed to create a witness" + echo "Failed to create dummy proofs. See test.out for more details." exit 1 fi fi