libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
309 stars 178 forks source link

Query: Access to topic level peer scores to application layer #554

Open chaitanyaprem opened 5 months ago

chaitanyaprem commented 5 months ago

I would like to know if there is a way to access current peer scores at application layer.

I went through the gossipsub code and found that peerScores are internal and are not exposed. Is there any other way to access these?

This would help us indicate status of the peer connection health in application in case scores to all peers are low (which could just be due to bad internet connectivity which delays packets received). This could be used to indicate bad network health.

vyzo commented 5 months ago

yes, you can get a periodic callback with a copy of the score table for exactly this purpose.

vyzo commented 5 months ago

See WithPeerScoreInspect in score.go.