From 7ea45940af861a35d4fd9f9245a617dcaac35667 Mon Sep 17 00:00:00 2001 From: Zekun Li Date: Mon, 28 Oct 2024 13:20:41 -0700 Subject: [PATCH] downgrade validator not in set error to warn --- consensus/src/epoch_manager.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/consensus/src/epoch_manager.rs b/consensus/src/epoch_manager.rs index 6a12c89dfcc7b..d46d1bf2ca6ab 100644 --- a/consensus/src/epoch_manager.rs +++ b/consensus/src/epoch_manager.rs @@ -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}, @@ -772,12 +774,22 @@ impl EpochManager

{ 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");