Correct the metrics for topic subscriptions (#5344)

* Handle fork boundaries

* Merge latest unstable

* Topic subscription fix
This commit is contained in:
Age Manning
2024-03-07 23:32:21 +11:00
committed by GitHub
parent fc8f1a4ca7
commit 85c3204d70
5 changed files with 65 additions and 9 deletions

View File

@@ -854,6 +854,13 @@ where
}
}
/// Register topics to ensure metrics are recorded correctly for these topics.
pub fn register_topics_for_metrics(&mut self, topics: Vec<TopicHash>) {
if let Some(metrics) = &mut self.metrics {
metrics.register_allowed_topics(topics);
}
}
/// Adds a new peer to the list of explicitly connected peers.
pub fn add_explicit_peer(&mut self, peer_id: &PeerId) {
tracing::debug!(peer=%peer_id, "Adding explicit peer");