Skip to content

Commit

Permalink
More state sync logs (MystenLabs#16115)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Feb 8, 2024
1 parent a5bfb3f commit d2df8af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/sui-network/src/state_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ async fn sync_checkpoint_contents<S>(
}
}

#[instrument(level = "debug", skip_all, fields(sequence_number = ?checkpoint.sequence_number()))]
async fn sync_one_checkpoint_contents<S>(
network: anemo::Network,
store: S,
Expand All @@ -1283,6 +1284,8 @@ async fn sync_one_checkpoint_contents<S>(
where
S: WriteStore + Clone,
{
debug!("syncing checkpoint contents");

// Check if we already have produced this checkpoint locally. If so, we don't need
// to get it from peers anymore.
if store
Expand All @@ -1291,7 +1294,7 @@ where
.sequence_number()
>= checkpoint.sequence_number()
{
debug!(seq = ?checkpoint.sequence_number(), "checkpoint was already created via consensus output");
debug!("checkpoint was already created via consensus output");
return Ok(checkpoint);
}

Expand All @@ -1309,6 +1312,7 @@ where
.read()
.unwrap()
.wait_interval_when_no_peer_to_sync_content();
info!("retrying checkpoint sync after {:?}", duration);
tokio::time::sleep(duration).await;
return Err(checkpoint);
};
Expand All @@ -1335,6 +1339,7 @@ where
.expect("store operation should not fail")
})
{
debug!("store already contains checkpoint contents");
return Some(contents);
}

Expand All @@ -1359,6 +1364,7 @@ where
}
}
}
debug!("no peers had checkpoint contents");
None
}

Expand Down

0 comments on commit d2df8af

Please sign in to comment.