Indicate that Syncing FCUs are not affecting sync progress during pipeline sync (#7245)

This commit is contained in:
Abner Zheng
2024-03-22 00:37:36 +08:00
committed by GitHub
parent 56b63adecc
commit f4b5000a80

View File

@@ -30,7 +30,7 @@ use tracing::{debug, info, warn};
/// Interval of reporting node state.
const INFO_MESSAGE_INTERVAL: Duration = Duration::from_secs(25);
/// The current high-level state of the node, including the node's database environemt, network
/// The current high-level state of the node, including the node's database environment, network
/// connections, current processing stage, and the latest block information. It provides
/// methods to handle different types of events that affect the node's state, such as pipeline
/// events, network events, and consensus engine events.
@@ -219,17 +219,17 @@ impl<DB> NodeState<DB> {
BeaconConsensusEngineEvent::ForkchoiceUpdated(state, status) => {
let ForkchoiceState { head_block_hash, safe_block_hash, finalized_block_hash } =
state;
if status != ForkchoiceStatus::Valid ||
(self.safe_block_hash != Some(safe_block_hash) &&
self.finalized_block_hash != Some(finalized_block_hash))
if self.safe_block_hash != Some(safe_block_hash) &&
self.finalized_block_hash != Some(finalized_block_hash)
{
info!(
?head_block_hash,
?safe_block_hash,
?finalized_block_hash,
?status,
"Forkchoice updated"
);
let msg = match status {
ForkchoiceStatus::Valid => "Forkchoice updated",
ForkchoiceStatus::Invalid => "Received invalid forkchoice updated message",
ForkchoiceStatus::Syncing => {
"Received forkchoice updated message when syncing"
}
};
info!(?head_block_hash, ?safe_block_hash, ?finalized_block_hash, "{}", msg);
}
self.head_block_hash = Some(head_block_hash);
self.safe_block_hash = Some(safe_block_hash);