Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Lower log-level for a missing validator set (#124)
Browse files Browse the repository at this point in the history
* lower log-level for a missing validator set

* move best_finalized_block initialization
  • Loading branch information
adoerr authored Mar 23, 2021
1 parent e343d47 commit 9e28469
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions client/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ where
///
/// For this reason, BEEFY worker initialization completes only after a finality
/// notification has been received. Such a notifcation is basically an indication
/// that an on-chain BEEFY pallet is available.
/// that an on-chain BEEFY pallet may be available.
pub(crate) fn new(
client: Arc<C>,
key_store: SyncCryptoStorePtr,
Expand All @@ -131,7 +131,7 @@ where
finality_notifications: client.finality_notification_stream(),
gossip_engine: Arc::new(Mutex::new(gossip_engine)),
signed_commitment_sender,
best_finalized_block: client.info().finalized_number,
best_finalized_block: Zero::zero(),
best_block_voted_on: Zero::zero(),
validator_set_id: 0,
client,
Expand Down Expand Up @@ -169,6 +169,11 @@ where
self.local_id = local_id;
self.rounds = round::Rounds::new(validator_set.validators.clone());

// we are actually interested in the best finalized block with the BEEFY pallet
// being available on-chain. That is why we set `best_finalized_block` here and
// not as part of `new()` already.
self.best_finalized_block = self.client.info().finalized_number;

debug!(target: "beefy", "🥩 Validator set with id {} initialized", validator_set.id);

Ok(())
Expand Down Expand Up @@ -325,9 +330,9 @@ where
match self.init_validator_set() {
Ok(()) => (),
Err(err) => {
// we don't treat this as an error here because there really is
// nothing a node operator could do in order to remedy the error.
info!(target: "beefy", "🥩 Init validator set failed: {:?}", err);
// this is not treated as an error here because there really is
// nothing a node operator could do in order to remedy the root cause.
debug!(target: "beefy", "🥩 Init validator set failed: {:?}", err);
}
}
}
Expand Down

0 comments on commit 9e28469

Please sign in to comment.