Skip to content

Commit

Permalink
Log epoch info on boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Apr 5, 2020
1 parent 1deaba9 commit 6996b96
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ledger/src/bank_forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,27 @@ impl BankForks {
root: Slot,
snapshot_package_sender: &Option<SnapshotPackageSender>,
) {
let old_epoch = self.root_bank().epoch();
self.root = root;
let set_root_start = Instant::now();
let root_bank = self
.banks
.get(&root)
.expect("root bank didn't exist in bank_forks");
let new_epoch = root_bank.epoch();
if old_epoch != new_epoch {
info!(
"Root entering
epoch: {},
next_epoch_start_slot: {},
epoch_stakes: {:#?}",
new_epoch,
root_bank
.epoch_schedule()
.get_first_slot_in_epoch(new_epoch + 1),
root_bank.epoch_stakes(new_epoch).unwrap().node_id_to_vote_accounts()
);
}
let root_tx_count = root_bank
.parents()
.last()
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/epoch_stakes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{collections::HashMap, sync::Arc};
pub type NodeIdToVoteAccounts = HashMap<Pubkey, NodeVoteAccounts>;
pub type EpochAuthorizedVoters = HashMap<Pubkey, Pubkey>;

#[derive(Clone, Serialize, Deserialize, Default, PartialEq)]
#[derive(Clone, Serialize, Debug, Deserialize, Default, PartialEq)]
pub struct NodeVoteAccounts {
pub vote_accounts: Vec<Pubkey>,
pub total_stake: u64,
Expand Down

0 comments on commit 6996b96

Please sign in to comment.