From b50a3bae72c2aa19d1dffbc8f37c007a04f0448a Mon Sep 17 00:00:00 2001 From: carllin Date: Wed, 10 Jul 2019 15:52:31 -0700 Subject: [PATCH] Logging (#5017) * Add logging to replay_stage * locktower logging --- core/src/consensus.rs | 12 ++++++++++++ core/src/replay_stage.rs | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 68dcb9366f..44dc780b9f 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -118,6 +118,10 @@ impl Tower { } let vote_state = VoteState::from(&account); if vote_state.is_none() { + info!( + "vote state for bank: {}, validator: {} is none", + bank_slot, key + ); datapoint_warn!( "tower_warn", ( @@ -129,6 +133,10 @@ impl Tower { continue; } let mut vote_state = vote_state.unwrap(); + info!( + "Vote states for slot: {}, account: {}, vote_states {:#?}", + bank_slot, key, vote_state.votes + ); if key == self.epoch_stakes.delegate_pubkey || vote_state.node_pubkey == self.epoch_stakes.delegate_pubkey @@ -152,6 +160,10 @@ impl Tower { let start_root = vote_state.root_slot; vote_state.process_slot_vote_unchecked(bank_slot); + info!( + "After simultated vote, vote states for slot: {}, account: {}, vote_states {:#?}", + bank_slot, key, vote_state.votes + ); for vote in &vote_state.votes { Self::update_ancestor_lockouts(&mut stake_lockouts, &vote, ancestors); diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 2d7666408b..7d5fcb28e6 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -340,7 +340,7 @@ impl ReplayStage { where T: 'static + KeypairUtil + Send + Sync, { - trace!("handle votable bank {}", bank.slot()); + info!("voting on bank {}", bank.slot()); if let Some(new_root) = tower.record_vote(bank.slot(), bank.hash()) { // get the root bank before squash let root_bank = bank_forks @@ -361,7 +361,7 @@ impl ReplayStage { leader_schedule_cache.set_root(rooted_banks.last().unwrap()); bank_forks.write().unwrap().set_root(new_root); Self::handle_new_root(&bank_forks, progress); - trace!("new root {}", new_root); + info!("new root {}", new_root); if let Err(e) = root_bank_sender.send(rooted_banks) { trace!("root_bank_sender failed: {:?}", e); Err(e)?; @@ -472,6 +472,9 @@ impl ReplayStage { .filter(|b| { let is_votable = b.is_votable(); trace!("bank is votable: {} {}", b.slot(), is_votable); + if !is_votable { + info!("bank is not votable: {}", b.slot()); + } is_votable }) .filter(|b| { @@ -503,6 +506,9 @@ impl ReplayStage { let vote_threshold = tower.check_vote_stake_threshold(b.slot(), &stake_lockouts); Self::confirm_forks(tower, stake_lockouts, progress, bank_forks); debug!("bank vote_threshold: {} {}", b.slot(), vote_threshold); + if !vote_threshold { + info!("bank failed threshold check: {}", b.slot()); + } vote_threshold }) .map(|(b, stake_lockouts)| (tower.calculate_weight(&stake_lockouts), b.clone()))