Skip to content

Commit 6394cf2

Browse files
committed
remove debug logs
1 parent 9f42b08 commit 6394cf2

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

crates/batcher/src/lib.rs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,6 @@ impl Batcher {
793793
client_msg: Box<SubmitProofMessage>,
794794
ws_conn_sink: WsMessageSink,
795795
) -> Result<(), Error> {
796-
let start_time = std::time::Instant::now();
797796
let msg_nonce = client_msg.verification_data.nonce;
798797
debug!("Received message with nonce: {msg_nonce:?}");
799798
self.metrics.received_proofs.inc();
@@ -820,8 +819,6 @@ impl Batcher {
820819
// All check functions sends the error to the metrics server and logs it
821820
// if they return false
822821

823-
let validation_start = std::time::Instant::now();
824-
825822
if !self.msg_chain_id_is_valid(&client_msg, &ws_conn_sink).await {
826823
return Ok(());
827824
}
@@ -847,11 +844,6 @@ impl Batcher {
847844
return Ok(());
848845
};
849846

850-
debug!(
851-
"Message validations completed for {:?} in {:?}",
852-
addr_in_msg,
853-
validation_start.elapsed()
854-
);
855847

856848
let addr;
857849
let signature = client_msg.signature;
@@ -878,7 +870,6 @@ impl Batcher {
878870
}
879871

880872
info!("Handling message, locking user state");
881-
let user_state_start = std::time::Instant::now();
882873

883874
// We acquire the lock first only to query if the user is already present and the lock is dropped.
884875
// If it was not present, then the user nonce is queried to the Aligned contract.
@@ -917,15 +908,9 @@ impl Batcher {
917908
return Ok(());
918909
};
919910

920-
debug!(
921-
"User lock acquired for {:?} in {:?}",
922-
addr,
923-
user_state_start.elapsed()
924-
);
925911

926912
// If the user state was not present, we need to get the nonce from the Ethereum contract and update the dummy user state
927913
if !is_user_in_state {
928-
let nonce_fetch_start = std::time::Instant::now();
929914
let ethereum_user_nonce = match self.get_user_nonce_from_ethereum(addr).await {
930915
Ok(ethereum_user_nonce) => ethereum_user_nonce,
931916
Err(e) => {
@@ -941,11 +926,6 @@ impl Batcher {
941926
return Ok(());
942927
}
943928
};
944-
warn!(
945-
"Ethereum nonce fetched for {:?} in {:?}",
946-
addr,
947-
nonce_fetch_start.elapsed()
948-
);
949929
// Update the dummy user state with the correct nonce
950930
user_state_guard.nonce = ethereum_user_nonce;
951931
}
@@ -954,7 +934,6 @@ impl Batcher {
954934
// * Perform validations over user state *
955935
// * ---------------------------------------------------*
956936

957-
let balance_validation_start = std::time::Instant::now();
958937
let Some(user_balance) = self.get_user_balance(&addr).await else {
959938
error!("Could not get balance for address {addr:?}");
960939
send_message(
@@ -1026,13 +1005,7 @@ impl Batcher {
10261005
return Ok(());
10271006
}
10281007

1029-
debug!(
1030-
"Balance and nonce validations completed for {:?} in {:?}",
1031-
addr,
1032-
balance_validation_start.elapsed()
1033-
);
10341008

1035-
let proof_verification_start = std::time::Instant::now();
10361009
if !self
10371010
.verify_proof_if_enabled(
10381011
&nonced_verification_data.verification_data,
@@ -1042,17 +1015,11 @@ impl Batcher {
10421015
{
10431016
return Ok(());
10441017
}
1045-
debug!(
1046-
"Proof verification completed for {:?} in {:?}",
1047-
addr,
1048-
proof_verification_start.elapsed()
1049-
);
10501018

10511019
// * ---------------------------------------------------------------------*
10521020
// * Perform validation over batcher queue *
10531021
// * ---------------------------------------------------------------------*
10541022

1055-
let queue_management_start = std::time::Instant::now();
10561023
let Some(mut batch_state_lock) = self
10571024
.try_batch_lock_with_timeout(self.batch_state.lock())
10581025
.await
@@ -1160,17 +1127,11 @@ impl Batcher {
11601127
}
11611128
}
11621129

1163-
debug!(
1164-
"Queue management and eviction logic completed for {:?} in {:?}",
1165-
addr,
1166-
queue_management_start.elapsed()
1167-
);
11681130

11691131
// * ---------------------------------------------------------------------*
11701132
// * Add message data into the queue and update user state *
11711133
// * ---------------------------------------------------------------------*
11721134

1173-
let add_to_batch_start = std::time::Instant::now();
11741135
if let Err(e) = self
11751136
.add_to_batch(
11761137
batch_state_lock,
@@ -1194,17 +1155,6 @@ impl Batcher {
11941155
user_state_guard.last_max_fee_limit = max_fee;
11951156
user_state_guard.proofs_in_batch += 1;
11961157
user_state_guard.total_fees_in_queue += max_fee;
1197-
debug!(
1198-
"Add to batch and user state update completed for {:?} in {:?}",
1199-
addr,
1200-
add_to_batch_start.elapsed()
1201-
);
1202-
1203-
debug!(
1204-
"Verification data message handled for {:?} - total time: {:?}",
1205-
addr,
1206-
start_time.elapsed()
1207-
);
12081158
Ok(())
12091159
}
12101160

0 commit comments

Comments
 (0)