Skip to content

Commit

Permalink
downgrade validator not in set error to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekun Li authored and zekun000 committed Oct 28, 2024
1 parent d60f792 commit 7ea4594
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions consensus/src/epoch_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ use aptos_infallible::{duration_since_epoch, Mutex};
use aptos_logger::prelude::*;
use aptos_mempool::QuorumStoreRequest;
use aptos_network::{application::interface::NetworkClient, protocols::network::Event};
use aptos_safety_rules::{safety_rules_manager, PersistentSafetyStorage, SafetyRulesManager};
use aptos_safety_rules::{
safety_rules_manager, Error, PersistentSafetyStorage, SafetyRulesManager,
};
use aptos_types::{
account_address::AccountAddress,
dkg::{real_dkg::maybe_dk_from_bls_sk, DKGState, DKGTrait, DefaultDKG},
Expand Down Expand Up @@ -772,12 +774,22 @@ impl<P: OnChainConfigProvider> EpochManager<P> {

let mut safety_rules =
MetricsSafetyRules::new(self.safety_rules_manager.client(), self.storage.clone());
if let Err(error) = safety_rules.perform_initialize() {
error!(
epoch = epoch,
error = error,
"Unable to initialize safety rules.",
);
match safety_rules.perform_initialize() {
Err(e) if matches!(e, Error::ValidatorNotInSet(_)) => {
warn!(
epoch = epoch,
error = e,
"Unable to initialize safety rules.",
);
},
Err(e) => {
error!(
epoch = epoch,
error = e,
"Unable to initialize safety rules.",
);
},
Ok(()) => (),
}

info!(epoch = epoch, "Create RoundState");
Expand Down

0 comments on commit 7ea4594

Please sign in to comment.