Skip to content

Commit 0c485d8

Browse files
apollo_proof_manager: log verify and store times
1 parent 8cfb0ad commit 0c485d8

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/apollo_class_manager_types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ strum = { workspace = true, features = ["derive"] }
2626
strum_macros.workspace = true
2727
thiserror.workspace = true
2828
tokio.workspace = true
29+
tracing.workspace = true
2930

3031
[dev-dependencies]
3132
apollo_proof_manager_types = { workspace = true, features = ["testing"] }

crates/apollo_class_manager_types/src/transaction_converter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::time::Instant;
2+
13
use apollo_proof_manager_types::{ProofManagerClientError, SharedProofManagerClient};
24
use async_trait::async_trait;
35
#[cfg(any(feature = "testing", test))]
@@ -27,6 +29,7 @@ use starknet_api::transaction::fields::{Fee, Proof, ProofFacts};
2729
use starknet_api::transaction::CalculateContractAddress;
2830
use starknet_api::{executable_transaction, transaction, StarknetApiError};
2931
use thiserror::Error;
32+
use tracing::info;
3033

3134
use crate::{ClassHashes, ClassManagerClientError, SharedClassManagerClient};
3235

@@ -353,7 +356,10 @@ impl TransactionConverter {
353356
return Ok(());
354357
}
355358

359+
let verify_start = Instant::now();
356360
self.verify_proof(proof_facts.clone(), proof.clone())?;
361+
let verify_duration = verify_start.elapsed();
362+
info!("Proof verification took: {verify_duration:?}");
357363
Ok(())
358364
}
359365

crates/apollo_gateway/src/gateway.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::clone::Clone;
22
use std::sync::Arc;
3+
use std::time::Instant;
34

45
use apollo_class_manager_types::transaction_converter::{
56
TransactionConverter,
@@ -36,7 +37,7 @@ use starknet_api::rpc_transaction::{
3637
RpcTransaction,
3738
};
3839
use starknet_api::transaction::fields::TransactionSignature;
39-
use tracing::{debug, error, warn};
40+
use tracing::{debug, error, info, warn};
4041

4142
use crate::errors::{
4243
mempool_client_result_to_deprecated_gw_result,
@@ -172,17 +173,23 @@ impl Gateway {
172173
.inspect_err(|e| metric_counters.record_add_tx_failure(e))?;
173174

174175
if let Some((proof_facts, proof)) = proof_data {
176+
let proof_manager_store_start = Instant::now();
175177
let proof_manager_client = self.proof_manager_client.clone();
176178
if let Err(e) = proof_manager_client.set_proof(proof_facts.clone(), proof.clone()).await
177179
{
178180
error!("Failed to set proof in proof manager: {}", e);
179181
}
182+
let proof_manager_store_duration = proof_manager_store_start.elapsed();
183+
info!("Proof manager store took: {proof_manager_store_duration:?}");
184+
let proof_archive_writer_start = Instant::now();
180185
let proof_archive_writer = self.proof_archive_writer.clone();
181186
tokio::spawn(async move {
182187
if let Err(e) = proof_archive_writer.set_proof(proof_facts, proof).await {
183188
error!("Failed to archive proof to GCS: {}", e);
184189
}
185190
});
191+
let proof_archive_writer_duration = proof_archive_writer_start.elapsed();
192+
info!("Proof archive writer took: {proof_archive_writer_duration:?}");
186193
}
187194
let gateway_output = create_gateway_output(&internal_tx);
188195

0 commit comments

Comments
 (0)