Skip to content

Commit

Permalink
fix(en): improved tree recovery logs (#1619)
Browse files Browse the repository at this point in the history
Signed-off-by: tomg10 <lemures64@gmail.com>
  • Loading branch information
tomg10 committed Apr 9, 2024
1 parent 08eedb4 commit ef12df7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/lib/zksync_core/src/metadata_calculator/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use std::{
fmt, ops,
sync::atomic::{AtomicU64, Ordering},
time::Instant,
};

use anyhow::Context as _;
Expand Down Expand Up @@ -213,6 +214,7 @@ impl AsyncTreeRecovery {
pool: &ConnectionPool<Core>,
stop_receiver: &watch::Receiver<bool>,
) -> anyhow::Result<Option<AsyncTree>> {
let start_time = Instant::now();
let chunk_count = options.chunk_count;
let chunks: Vec<_> = (0..chunk_count)
.map(|chunk_id| uniform_hashed_keys_chunk(chunk_id, chunk_count))
Expand Down Expand Up @@ -261,9 +263,10 @@ impl AsyncTreeRecovery {
snapshot.expected_root_hash
);
let tree = tree.finalize().await;
let finalize_latency = finalize_latency.observe();
finalize_latency.observe();
tracing::info!(
"Finished tree recovery in {finalize_latency:?}; resuming normal tree operation"
"Tree recovery has finished, the recovery took {:?}! resuming normal tree operation",
start_time.elapsed()
);
Ok(Some(tree))
}
Expand Down

0 comments on commit ef12df7

Please sign in to comment.