Skip to content

Commit

Permalink
add timeout to sp1 wait_proof
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft committed Oct 15, 2024
1 parent 2d918a8 commit 8f55ae4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion provers/sp1/driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use std::{
borrow::BorrowMut,
env, fs,
path::{Path, PathBuf},
time::Duration,
};
use tracing::{debug, error, info};

Expand Down Expand Up @@ -170,7 +171,10 @@ impl Prover for Sp1Prover {
output.header.number
);
network_prover
.wait_proof::<sp1_sdk::SP1ProofWithPublicValues>(&proof_id, None)
.wait_proof::<sp1_sdk::SP1ProofWithPublicValues>(
&proof_id,
Some(Duration::from_secs(3600)),
)
.await
.map_err(|e| ProverError::GuestError(format!("Sp1: network proof failed {e:?}")))?
};
Expand Down
3 changes: 2 additions & 1 deletion script/prove-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ for block in $(eval echo {$rangeStart..$rangeEnd}); do
fi

echo "- proving block $block"
curl --location --request POST 'http://localhost:8080/v3/proof' \
curl --location --request POST 'http://localhost:8080/v2/proof' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 4cbd753fbcbc2639de804f8ce425016a50e0ecd53db00cb5397912e83f5e570e' \
--data-raw "{
\"network\": \"$chain\",
\"l1_network\": \"$l1_network\",
\"block_numbers\": [[$block, null], [$(($block+1)), null]],
\"block_number\": $block,
\"prover\": \"$prover\",
\"graffiti\": \"$graffiti\",
$proofParam
Expand Down

0 comments on commit 8f55ae4

Please sign in to comment.