Skip to content

Commit

Permalink
sc-consensus-beefy: reduce log levels (#3418)
Browse files Browse the repository at this point in the history
fixes #3407
  • Loading branch information
acatangiu authored Feb 21, 2024
1 parent f3a6b6d commit cbeccad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions substrate/client/consensus/beefy/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use crate::{error::Error, worker::PersistedState, LOG_TARGET};
use codec::{Decode, Encode};
use log::{info, trace};
use log::{debug, trace};
use sc_client_api::{backend::AuxStore, Backend};
use sp_runtime::traits::Block as BlockT;

Expand All @@ -30,7 +30,7 @@ const WORKER_STATE_KEY: &[u8] = b"beefy_voter_state";
const CURRENT_VERSION: u32 = 4;

pub(crate) fn write_current_version<BE: AuxStore>(backend: &BE) -> Result<(), Error> {
info!(target: LOG_TARGET, "🥩 write aux schema version {:?}", CURRENT_VERSION);
debug!(target: LOG_TARGET, "🥩 write aux schema version {:?}", CURRENT_VERSION);
AuxStore::insert_aux(backend, &[(VERSION_KEY, CURRENT_VERSION.encode().as_slice())], &[])
.map_err(|e| Error::Backend(e.to_string()))
}
Expand Down
8 changes: 6 additions & 2 deletions substrate/client/consensus/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,14 @@ where
R::Api: BeefyApi<B, AuthorityId>,
{
let blockchain = backend.blockchain();

// Walk up the chain looking for the validator set active at 'at_header'. Process both state and
// header digests.
debug!(target: LOG_TARGET, "🥩 Trying to find validator set active at header: {:?}", at_header);
debug!(
target: LOG_TARGET,
"🥩 Trying to find validator set active at header(number {:?}, hash {:?})",
at_header.number(),
at_header.hash()
);
let mut header = at_header.clone();
loop {
debug!(target: LOG_TARGET, "🥩 Looking for auth set change at block number: {:?}", *header.number());
Expand Down
21 changes: 11 additions & 10 deletions substrate/client/consensus/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ where
.flatten()
.map(|justifs| justifs.get(BEEFY_ENGINE_ID).is_some())
{
info!(
debug!(
target: LOG_TARGET,
"🥩 Initialize BEEFY voter at last BEEFY finalized block: {:?}.",
*header.number()
Expand Down Expand Up @@ -439,7 +439,7 @@ where
}

if let Some(active) = find_authorities_change::<B>(&header) {
info!(
debug!(
target: LOG_TARGET,
"🥩 Marking block {:?} as BEEFY Mandatory.",
*header.number()
Expand Down Expand Up @@ -471,7 +471,7 @@ where
state.set_best_grandpa(best_grandpa.clone());
// Overwrite persisted data with newly provided `min_block_delta`.
state.set_min_block_delta(min_block_delta);
info!(target: LOG_TARGET, "🥩 Loading BEEFY voter state from db: {:?}.", state);
debug!(target: LOG_TARGET, "🥩 Loading BEEFY voter state from db: {:?}.", state);

// Make sure that all the headers that we need have been synced.
let mut new_sessions = vec![];
Expand All @@ -489,7 +489,7 @@ where

// Make sure we didn't miss any sessions during node restart.
for (validator_set, new_session_start) in new_sessions.drain(..).rev() {
info!(
debug!(
target: LOG_TARGET,
"🥩 Handling missed BEEFY session after node restart: {:?}.",
new_session_start
Expand Down Expand Up @@ -630,13 +630,14 @@ where
&mut self,
notification: &FinalityNotification<B>,
) -> Result<(), Error> {
let header = &notification.header;
debug!(
target: LOG_TARGET,
"🥩 Finality notification: header {:?} tree_route {:?}",
notification.header,
"🥩 Finality notification: header(number {:?}, hash {:?}) tree_route {:?}",
header.number(),
header.hash(),
notification.tree_route,
);
let header = &notification.header;

self.base
.runtime
Expand Down Expand Up @@ -757,7 +758,7 @@ where
match rounds.add_vote(vote) {
VoteImportResult::RoundConcluded(signed_commitment) => {
let finality_proof = VersionedFinalityProof::V1(signed_commitment);
info!(
debug!(
target: LOG_TARGET,
"🥩 Round #{} concluded, finality_proof: {:?}.", block_number, finality_proof
);
Expand Down Expand Up @@ -1165,7 +1166,7 @@ where
return Ok(())
} else if let Some(local_id) = self.base.key_store.authority_id(validators) {
if offender_id == local_id {
debug!(target: LOG_TARGET, "🥩 Skip equivocation report for own equivocation");
warn!(target: LOG_TARGET, "🥩 Skip equivocation report for own equivocation");
return Ok(())
}
}
Expand Down Expand Up @@ -1234,7 +1235,7 @@ where
// if the mandatory block (session_start) does not have a beefy justification yet,
// we vote on it
let target = if best_beefy < session_start {
debug!(target: LOG_TARGET, "🥩 vote target - mandatory block: #{:?}", session_start,);
debug!(target: LOG_TARGET, "🥩 vote target - mandatory block: #{:?}", session_start);
session_start
} else {
let diff = best_grandpa.saturating_sub(best_beefy) + 1u32.into();
Expand Down

0 comments on commit cbeccad

Please sign in to comment.