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

Commit

Permalink
v1.14: Add metrics for invalid vote timestamps (backport of #32206) (#…
Browse files Browse the repository at this point in the history
…32207)

Add metrics for invalid vote timestamps (#32206)

(cherry picked from commit 4ba78de)

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
  • Loading branch information
mergify[bot] and AshwinSekar authored Jun 20, 2023
1 parent a6166ee commit e3dda4b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,12 @@ impl Tower {
} else {
// If the previous vote did not send a timestamp due to clock error,
// use the last good timestamp + 1
datapoint_info!(
"refresh-timestamp-missing",
("heaviest-slot", heaviest_slot_on_same_fork, i64),
("last-timestamp", self.last_timestamp.timestamp, i64),
("last-slot", self.last_timestamp.slot, i64),
);
self.last_timestamp.timestamp.saturating_add(1)
};

Expand Down Expand Up @@ -591,6 +597,13 @@ impl Tower {
timestamp,
};
return Some(timestamp);
} else {
datapoint_info!(
"backwards-timestamp",
("slot", current_slot, i64),
("timestamp", timestamp, i64),
("last-timestamp", self.last_timestamp.timestamp, i64),
)
}
}
None
Expand Down

0 comments on commit e3dda4b

Please sign in to comment.