Skip to content

Commit

Permalink
v1.17: validator: ignore too old tower error (backport of #35229) (#3…
Browse files Browse the repository at this point in the history
…5278)

validator: ignore too old tower error (#35229)

* validator: ignore too old tower error

* Update core/src/replay_stage.rs

Co-authored-by: Ashwin Sekar <[email protected]>

* remove redundant references

---------

Co-authored-by: Ashwin Sekar <[email protected]>
(cherry picked from commit 531793b)

Co-authored-by: DimAn <[email protected]>
  • Loading branch information
mergify[bot] and diman-io authored Feb 21, 2024
1 parent d56a083 commit 07b69c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,9 @@ impl TowerError {
false
}
}
pub fn is_too_old(&self) -> bool {
matches!(self, TowerError::TooOldTower(_, _))
}
}

#[derive(Debug)]
Expand Down
7 changes: 7 additions & 0 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 07b69c9

Please sign in to comment.