Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
fix: printout
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Jun 14, 2024
1 parent f4dad84 commit 6b29787
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
9 changes: 8 additions & 1 deletion leader/src/jerigon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(())
}
6 changes: 5 additions & 1 deletion leader/src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GeneratedBlockProof> = proved_blocks
.into_iter()
Expand Down
4 changes: 2 additions & 2 deletions tools/prove_jerigon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ 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
rm $OUT_LOG_PATH
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
Expand Down
4 changes: 2 additions & 2 deletions tools/prove_stdio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b29787

Please sign in to comment.