Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Soften vote account identity mismatch from panic to runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jan 14, 2022
1 parent 304afd4 commit debac00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,10 +1157,6 @@ impl Tower {
self.node_pubkey,
bank.slot(),
);
assert_eq!(
self.vote_state.node_pubkey, self.node_pubkey,
"vote account's node_pubkey doesn't match",
);
} else {
self.initialize_root(root);
info!(
Expand Down
8 changes: 8 additions & 0 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,14 @@ impl ReplayStage {
}
Ok(vote_state) => vote_state,
};
if vote_state.node_pubkey != node_keypair.pubkey() {
info!(
"Vote account node_pubkey mismatch: {} (expected: {}). Unable to vote",
vote_state.node_pubkey,
node_keypair.pubkey()
);
return None;
}
let authorized_voter_pubkey =
if let Some(authorized_voter_pubkey) = vote_state.get_authorized_voter(bank.epoch()) {
authorized_voter_pubkey
Expand Down

0 comments on commit debac00

Please sign in to comment.