diff --git a/consensus/src/proposal/step.rs b/consensus/src/proposal/step.rs index 91d2a93720..380dbaef4a 100644 --- a/consensus/src/proposal/step.rs +++ b/consensus/src/proposal/step.rs @@ -12,7 +12,7 @@ use node_data::get_current_timestamp; use node_data::ledger::IterationsInfo; use node_data::message::Message; use tokio::sync::Mutex; -use tracing::{debug, error, info}; +use tracing::{debug, error}; use crate::commons::Database; use crate::config; @@ -137,7 +137,7 @@ impl ProposalStep { /// Waits until the next slot is reached async fn wait_until_next_slot(tip_timestamp: u64) { if let Some(delay) = Self::next_slot_in(tip_timestamp) { - info!(event = "next_slot", ?delay); + debug!(event = "Wait next block slot for validation", ?delay); tokio::time::sleep(delay).await; } } diff --git a/consensus/src/validation/handler.rs b/consensus/src/validation/handler.rs index 600800ecb6..e3fbeb407a 100644 --- a/consensus/src/validation/handler.rs +++ b/consensus/src/validation/handler.rs @@ -205,7 +205,6 @@ impl MsgHandler for ValidationHandler { return Err(ConsensusError::InvalidVote(vote)); } }; - info!(event = "quorum reached", ?vote); let vrmsg = self .build_validation_result(sv, vote, quorum_type, &p.header()) diff --git a/node/src/chain.rs b/node/src/chain.rs index dfe4e1119b..f092ccf2d7 100644 --- a/node/src/chain.rs +++ b/node/src/chain.rs @@ -130,7 +130,7 @@ impl recv = result_chan.recv() => { match recv? { Err(ConsensusError::Canceled(round)) => { - info!(event = "consensus canceled", round); + debug!(event = "consensus canceled", round); } Err(err) => { // Internal consensus execution has terminated with an error diff --git a/node/src/chain/acceptor.rs b/node/src/chain/acceptor.rs index a7431e906a..2a65a4838d 100644 --- a/node/src/chain/acceptor.rs +++ b/node/src/chain/acceptor.rs @@ -355,20 +355,36 @@ impl Acceptor { | Payload::Validation(_) | Payload::Ratification(_) | Payload::ValidationQuorum(_) => { - // Process consensus msg only if they are for the current round - // or at most 10 rounds in the future let msg_round = msg.header.round; - if msg_round > tip_height - && msg_round <= (tip_height + MAX_ROUND_DISTANCE) - { - consensus_task.main_inbound.try_send(msg); - } else { - warn!( - event = "msg discarded", - topic = ?msg.topic(), - info = ?msg.header, - ray_id = msg.ray_id() - ); + + match msg_round { + // Discard messages from the past + r if r <= tip_height => { + debug!( + event = "Consensus msg discarded", + reason = "past round", + topic = ?msg.topic(), + info = ?msg.header, + ray_id = msg.ray_id() + ); + } + + // Discard messages too far from the future + r if r > tip_height + MAX_ROUND_DISTANCE => { + warn!( + event = "Consensus msg discarded", + reason = "too far in the future", + topic = ?msg.topic(), + info = ?msg.header, + ray_id = msg.ray_id() + ); + } + + _ => { + // Process consensus msg only if they are for the + // current round or at most 10 rounds in the future + consensus_task.main_inbound.try_send(msg); + } } } diff --git a/node/src/chain/consensus.rs b/node/src/chain/consensus.rs index 756156ae32..f4b8fff250 100644 --- a/node/src/chain/consensus.rs +++ b/node/src/chain/consensus.rs @@ -130,7 +130,7 @@ impl Task { let (all_num, eligible_num) = current.get_provisioners_info(ru.round); - info!( + debug!( event = "spawn consensus", id = self.task_id, round = ru.round,