Skip to content

Commit

Permalink
validator: ignore too old tower error (#35229)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
diman-io and AshwinSekar authored Feb 21, 2024
1 parent a97f26e commit 531793b
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 @@ -1533,6 +1533,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 @@ -1171,6 +1171,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 531793b

Please sign in to comment.