diff --git a/crates/node-core/src/events/node.rs b/crates/node-core/src/events/node.rs index 5c41e5cac8..0e50030a88 100644 --- a/crates/node-core/src/events/node.rs +++ b/crates/node-core/src/events/node.rs @@ -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 NodeState { 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);