diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 816e9d1b5e..59c0adf724 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -1449,6 +1449,9 @@ impl TowerError { false } } + pub fn is_too_old(&self) -> bool { + matches!(self, TowerError::TooOldTower(_, _)) + } } #[derive(Debug)] diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 317f54e3d7..aaf4a09d26 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -1136,6 +1136,13 @@ impl ReplayStage { node_pubkey, vote_account, ) + } else if err.is_too_old() { + warn!("Failed to load tower, too old for {}: {}. Creating a new tower from bankforks.", node_pubkey, err); + Tower::new_from_bankforks( + &bank_forks.read().unwrap(), + node_pubkey, + vote_account, + ) } else { error!("Failed to load tower for {}: {}", node_pubkey, err); std::process::exit(1);