Skip to content

Commit 07b69c9

Browse files
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 <ashwin@solana.com> * remove redundant references --------- Co-authored-by: Ashwin Sekar <ashwin@solana.com> (cherry picked from commit 531793b) Co-authored-by: DimAn <diman@diman.io>
1 parent d56a083 commit 07b69c9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

core/src/consensus.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,9 @@ impl TowerError {
14491449
false
14501450
}
14511451
}
1452+
pub fn is_too_old(&self) -> bool {
1453+
matches!(self, TowerError::TooOldTower(_, _))
1454+
}
14521455
}
14531456

14541457
#[derive(Debug)]

core/src/replay_stage.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,13 @@ impl ReplayStage {
11361136
node_pubkey,
11371137
vote_account,
11381138
)
1139+
} else if err.is_too_old() {
1140+
warn!("Failed to load tower, too old for {}: {}. Creating a new tower from bankforks.", node_pubkey, err);
1141+
Tower::new_from_bankforks(
1142+
&bank_forks.read().unwrap(),
1143+
node_pubkey,
1144+
vote_account,
1145+
)
11391146
} else {
11401147
error!("Failed to load tower for {}: {}", node_pubkey, err);
11411148
std::process::exit(1);

0 commit comments

Comments
 (0)