Skip to content

Instantly share code, notes, and snippets.

@diman-io
Created February 18, 2024 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diman-io/b464fe6938960b3081523231b02a1b42 to your computer and use it in GitHub Desktop.
Save diman-io/b464fe6938960b3081523231b02a1b42 to your computer and use it in GitHub Desktop.
From 7db7441d79c3fb63b43c8793fe76159fff2cdc4b Mon Sep 17 00:00:00 2001
From: DimAn <diman@diman.io>
Date: Tue, 16 Jan 2024 14:08:58 +0200
Subject: [PATCH] ignore too old tower error
---
core/src/consensus.rs | 7 +++++++
core/src/replay_stage.rs | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/core/src/consensus.rs b/core/src/consensus.rs
index 5b2b651a68..7b62aaf171 100644
--- a/core/src/consensus.rs
+++ b/core/src/consensus.rs
@@ -1465,6 +1465,13 @@ impl TowerError {
false
}
}
+ pub fn is_too_old(&self) -> bool {
+ if let TowerError::TooOldTower(_, _) = &self {
+ true
+ } else {
+ false
+ }
+ }
}
#[derive(Debug)]
diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs
index 7dce3cdd00..2e4a8c5d39 100644
--- a/core/src/replay_stage.rs
+++ b/core/src/replay_stage.rs
@@ -999,6 +999,13 @@ impl ReplayStage {
&my_pubkey,
&vote_account,
)
+ } else if err.is_too_old() {
+ warn!("Failed to load tower for {}: {}", my_pubkey, err);
+ Tower::new_from_bankforks(
+ &bank_forks.read().unwrap(),
+ &my_pubkey,
+ &vote_account,
+ )
} else {
error!("Failed to load tower for {}: {}", my_pubkey, err);
std::process::exit(1);
--
2.38.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment