From debac00724302d6933b03a107d3c48cc8c32be3b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 13 Jan 2022 17:14:04 -0800 Subject: [PATCH] Soften vote account identity mismatch from panic to runtime error --- core/src/consensus.rs | 4 ---- core/src/replay_stage.rs | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index d705fc6011..bece591da0 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -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!( diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index bd95cdca73..b52f453bf5 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -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