Skip to content

Commit

Permalink
improve logging (#536)
Browse files Browse the repository at this point in the history
* improve logging

* use u64 consistently for batch sizes
  • Loading branch information
carlomazzaferro authored Oct 16, 2024
1 parent 9166f47 commit 2bc45c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions iris-mpc-upgrade/src/bin/tcp_ssl_upgrade_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ async fn send_batch_and_wait_for_ack(
let batch_size = batch.len();
// Send the batch size to all servers
let (batch_size_result_a, batch_size_result_b, batch_size_result_c) = (
server1.write_u8(batch_size as u8),
server2.write_u8(batch_size as u8),
server3.write_u8(batch_size as u8),
server1.write_u64(batch_size as u64),
server2.write_u64(batch_size as u64),
server3.write_u64(batch_size as u64),
)
.join()
.await;
Expand Down
4 changes: 2 additions & 2 deletions iris-mpc-upgrade/src/bin/tcp_upgrade_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ async fn main() -> eyre::Result<()> {
for batch_num in 0..num_batches + 1 {
tracing::info!("Processing batch {} of size: {}", batch_num, batch_size1);
let start_time = Instant::now();
let batch_size_1_message = client_stream1.read_u8().await?;
let batch_size_2_message = client_stream2.read_u8().await?;
let batch_size_1_message = client_stream1.read_u64().await?;
let batch_size_2_message = client_stream2.read_u64().await?;

if batch_size_1_message != batch_size_2_message {
bail!(
Expand Down
4 changes: 2 additions & 2 deletions iris-mpc-upgrade/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ impl<S: NewIrisShareSink> IrisCodeUpgrader<S> {
*a = a.wrapping_add(*b);
}
let duration = start_time.elapsed();
tracing::info!("Computed iris codes STEP DURATION: {:.2?}", duration);
tracing::debug!("Computed iris codes STEP DURATION: {:.2?}", duration);

let start_time = std::time::Instant::now();
self.iris_sink
.store_code_mask_share(id, &result, &mask)
.await?;
let duration = start_time.elapsed();
tracing::info!("Stored iris codes STEP DURATION: {:.2?}", duration);
tracing::debug!("Stored iris codes STEP DURATION: {:.2?}", duration);
Ok(())
}
}

0 comments on commit 2bc45c1

Please sign in to comment.