From 07b69c91944e377efe064ea12b0a2135da4d9535 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:33:51 -0500 Subject: [PATCH] v1.17: validator: ignore too old tower error (backport of #35229) (#35278) validator: ignore too old tower error (#35229) * validator: ignore too old tower error * Update core/src/replay_stage.rs Co-authored-by: Ashwin Sekar * remove redundant references --------- Co-authored-by: Ashwin Sekar (cherry picked from commit 531793b4be6d6c55f7c6a13f6da1982a7387f185) Co-authored-by: DimAn --- core/src/consensus.rs | 3 +++ core/src/replay_stage.rs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 816e9d1b5e2af7..59c0adf724346c 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 317f54e3d71652..aaf4a09d266034 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);