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

feat: stdio parallel proving #109

Merged
merged 22 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 6 additions & 4 deletions leader/src/jerigon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub(crate) async fn jerigon_main(
)
.await?;

if cfg!(feature = "test_only") {
info!("All dummy proofs have been generated successfully.");
atanmarko marked this conversation as resolved.
Show resolved Hide resolved
} else {
info!("All proofs have been generated successfully.");
}

// If `keep_intermediate_proofs` is not set we only keep the last block
// proof from the interval. It contains all the necessary information to
// verify the whole sequence.
Expand Down Expand Up @@ -84,9 +90,5 @@ pub(crate) async fn jerigon_main(
}
}

if cfg!(feature = "test_only") {
info!("All dummy proofs have been generated successfully.");
}

Ok(())
}
10 changes: 6 additions & 4 deletions leader/src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ pub(crate) async fn stdio_main(
runtime.close().await?;
let proved_blocks = proved_blocks?;

if cfg!(feature = "test_only") {
info!("All dummy proofs have been generated successfully.");
atanmarko marked this conversation as resolved.
Show resolved Hide resolved
} else {
info!("All proofs have been generated successfully.");
}

let proofs: Vec<GeneratedBlockProof> = proved_blocks
.into_iter()
.filter_map(|(_, proof)| proof)
.collect();
std::io::stdout().write_all(&serde_json::to_vec(&proofs)?)?;

if cfg!(feature = "test_only") {
info!("All dummy proofs have been generated successfully.");
}

Ok(())
}
4 changes: 2 additions & 2 deletions tools/prove_jerigon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ 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 'All dummy proofs have been generated successfully.' $OUT_LOG_PATH; then
echo "Success - Note this was just a test, not a proof"
if grep -q 'All dummy proofs have been generated successfully.' $OUT_LOG_PATH; then
echo -e "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
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,8 +68,8 @@ 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 dummy proofs have been generated successfully.' test.out; then
echo "Success - Note this was just a test, not a proof"
if grep -q 'All dummy proofs have been generated successfully.' test.out; then
echo -e "\n\nSuccess - Note this was just a test, not a proof"
exit
else
echo "Failed to create dummy proofs. See test.out for more details."
Expand Down
Loading