From 4ba78de8cbe9704acab6b0fdec82a6845c71eb4d Mon Sep 17 00:00:00 2001 From: Ashwin Sekar Date: Tue, 20 Jun 2023 10:29:13 -0700 Subject: [PATCH] Add metrics for invalid vote timestamps (#32206) --- core/src/consensus.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index ffc1c7eacd..6ad7c1ad38 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -463,6 +463,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) }; @@ -629,6 +635,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