mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
More gossipsub metrics (#6873)
N/A Add metrics that tell us if a duplicate message that we received was from a mesh peer or from a non mesh peer that we requested with iwant message.
This commit is contained in:
@@ -1841,6 +1841,30 @@ where
|
||||
peer_score.duplicated_message(propagation_source, &msg_id, &message.topic);
|
||||
}
|
||||
self.mcache.observe_duplicate(&msg_id, propagation_source);
|
||||
// track metrics for the source of the duplicates
|
||||
if let Some(metrics) = self.metrics.as_mut() {
|
||||
if self
|
||||
.mesh
|
||||
.get(&message.topic)
|
||||
.is_some_and(|peers| peers.contains(propagation_source))
|
||||
{
|
||||
// duplicate was received from a mesh peer
|
||||
metrics.mesh_duplicates(&message.topic);
|
||||
} else if self
|
||||
.gossip_promises
|
||||
.contains_peer(&msg_id, propagation_source)
|
||||
{
|
||||
// duplicate was received from an iwant request
|
||||
metrics.iwant_duplicates(&message.topic);
|
||||
} else {
|
||||
tracing::warn!(
|
||||
messsage=%msg_id,
|
||||
peer=%propagation_source,
|
||||
topic=%message.topic,
|
||||
"Peer should not have sent message"
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user