From e13af3566adad23317186984349bdb9f2e483c33 Mon Sep 17 00:00:00 2001 From: Robin Salen <30937548+Nashtare@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:10:46 -0400 Subject: [PATCH] misc: Do not perform sanity check on test_only runs (#635) --- zero/src/bin/leader/client.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zero/src/bin/leader/client.rs b/zero/src/bin/leader/client.rs index 6825b6683..c4ddedd63 100644 --- a/zero/src/bin/leader/client.rs +++ b/zero/src/bin/leader/client.rs @@ -38,6 +38,8 @@ pub(crate) async fn client_main( ) -> Result<()> { use futures::StreamExt; + let test_only = leader_config.prover_config.test_only; + let cached_provider = Arc::new(zero::provider::CachedProvider::new( build_http_retry_provider( rpc_params.rpc_url.clone(), @@ -45,17 +47,20 @@ pub(crate) async fn client_main( rpc_params.max_retries, )?, )); - check_previous_proof_and_checkpoint( - leader_config.checkpoint_block_number, - &leader_config.previous_proof, - block_interval.get_start_block()?, - )?; + + if !test_only { + // For actual proof runs, perform a sanity check on the provided inputs. + check_previous_proof_and_checkpoint( + leader_config.checkpoint_block_number, + &leader_config.previous_proof, + block_interval.get_start_block()?, + )?; + } // Create a channel for block prover input and use it to send prover input to // the proving task. The second element of the tuple is a flag indicating // whether the block is the last one in the interval. let (block_tx, block_rx) = mpsc::channel::<(BlockProverInput, bool)>(zero::BLOCK_CHANNEL_SIZE); - let test_only = leader_config.prover_config.test_only; // Run proving task let runtime_ = runtime.clone();