Skip to content

Commit

Permalink
review: add instrumentation to batch prover
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoPittella committed Feb 24, 2025
1 parent a255cc3 commit 8fe8da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/block-producer/src/batch_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use miden_proving_service_client::proving_service::batch_prover::RemoteBatchProv
use miden_tx_batch_prover::LocalBatchProver;
use rand::Rng;
use tokio::{task::JoinSet, time};
use tracing::{debug, info, instrument, warn, Span};
use tracing::{debug, info, instrument, Span};

use crate::{
domain::transaction::AuthenticatedTransaction, errors::BuildBatchError, mempool::SharedMempool,
Expand Down Expand Up @@ -314,17 +314,16 @@ impl BatchProver {
Self::Remote(RemoteBatchProver::new(endpoint))
}

#[instrument(target = COMPONENT, skip_all, err)]
pub async fn prove(
&self,
proposed_batch: ProposedBatch,
) -> Result<ProvenBatch, BuildBatchError> {
match self {
Self::Local(prover) => {
info!(target: COMPONENT, "Proving batch locally");
prover.prove(proposed_batch).map_err(BuildBatchError::ProveBatchError)
},
Self::Remote(prover) => {
info!(target: COMPONENT, "Proving batch remotely");
prover.prove(proposed_batch).await.map_err(BuildBatchError::RemoteProverError)
},
}
Expand Down

0 comments on commit 8fe8da2

Please sign in to comment.