-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Consensus Observer] Small improvements to message metrics. #15864
Conversation
⏱️ 1h 31m total CI duration on this PR
🚨 2 jobs on the last run were significantly faster/slower than expected
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -416,13 +416,15 @@ impl ConsensusObserver { | |||
|
|||
// Verify the block payload digests | |||
if let Err(error) = block_payload.verify_payload_digests() { | |||
// Log the error and update the invalid message counter | |||
error!( | |||
LogSchema::new(LogEntry::ConsensusObserver).message(&format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if including some information about the peer might be helpful here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 will peer_network_id help here to see who's sending bad messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah, we can derive it from the existing logs, e.g., we only have 2 streams (we know the peers), and we only process the first message. But, let me add it to the logs anyway 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits
@@ -416,13 +416,15 @@ impl ConsensusObserver { | |||
|
|||
// Verify the block payload digests | |||
if let Err(error) = block_payload.verify_payload_digests() { | |||
// Log the error and update the invalid message counter | |||
error!( | |||
LogSchema::new(LogEntry::ConsensusObserver).message(&format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 will peer_network_id help here to see who's sending bad messages?
@@ -1232,3 +1226,45 @@ fn update_metrics_for_ordered_block_message( | |||
ordered_block.proof_block_info().round(), | |||
); | |||
} | |||
|
|||
/// Increments the dropped message counter for the given peer and message | |||
fn update_dropped_message_counter(peer_network_id: &PeerNetworkId, message_label: &str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should these functions be increment_
instead of update_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. Will update 😄
045e772
to
1d059b4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1d059b4
to
ee3198f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
❌ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
This small PR makes tiny improvements to the message metrics for consensus observer. Specifically, we: (i) add a new counter to track invalid messages; and (ii) refactor some of the logic into shared methods.
Testing Plan
Existing test infrastructure.