Another some tower logging improvements (#12940)
This commit is contained in:
parent
5a5b7f39c1
commit
fd8ec27fe8
|
@ -570,9 +570,13 @@ impl Tower {
|
||||||
return SwitchForkDecision::SameFork;
|
return SwitchForkDecision::SameFork;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should never consider switching to an ancestor
|
assert!(
|
||||||
// of your last vote
|
!last_vote_ancestors.contains(&switch_slot),
|
||||||
assert!(!last_vote_ancestors.contains(&switch_slot));
|
"Should never consider switching to slot ({}), which is ancestors({:?}) of last vote: {}",
|
||||||
|
switch_slot,
|
||||||
|
last_vote_ancestors,
|
||||||
|
last_voted_slot
|
||||||
|
);
|
||||||
|
|
||||||
// By this point, we know the `switch_slot` is on a different fork
|
// By this point, we know the `switch_slot` is on a different fork
|
||||||
// (is neither an ancestor nor descendant of `last_vote`), so a
|
// (is neither an ancestor nor descendant of `last_vote`), so a
|
||||||
|
@ -832,16 +836,17 @@ impl Tower {
|
||||||
replayed_root: Slot,
|
replayed_root: Slot,
|
||||||
slot_history: &SlotHistory,
|
slot_history: &SlotHistory,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
info!(
|
|
||||||
"adjusting lockouts (after replay up to {}): {:?}",
|
|
||||||
replayed_root,
|
|
||||||
self.voted_slots()
|
|
||||||
);
|
|
||||||
|
|
||||||
// sanity assertions for roots
|
// sanity assertions for roots
|
||||||
assert_eq!(slot_history.check(replayed_root), Check::Found);
|
|
||||||
assert!(self.root().is_some());
|
assert!(self.root().is_some());
|
||||||
let tower_root = self.root().unwrap();
|
let tower_root = self.root().unwrap();
|
||||||
|
info!(
|
||||||
|
"adjusting lockouts (after replay up to {}): {:?} tower root: {}",
|
||||||
|
replayed_root,
|
||||||
|
self.voted_slots(),
|
||||||
|
tower_root,
|
||||||
|
);
|
||||||
|
assert_eq!(slot_history.check(replayed_root), Check::Found);
|
||||||
|
|
||||||
// reconcile_blockstore_roots_with_tower() should already have aligned these.
|
// reconcile_blockstore_roots_with_tower() should already have aligned these.
|
||||||
assert!(
|
assert!(
|
||||||
tower_root <= replayed_root,
|
tower_root <= replayed_root,
|
||||||
|
|
Loading…
Reference in New Issue