dotnet-libp2p
dotnet-libp2p copied to clipboard
Add Peer Scoring according to Gossipsub v1.1
(Work in Progress)
Summary This PR introduces peer scoring configurations based on the Gossipsub v1.1 specification.
Issue : #139
Key Changes
- Added PeerState class to track topic scores for each peer, and it is initialized and managed in PubsubRouter.cs
- Introduced PeerScoreManager class, which is responsible for calculating and updating peer scores according to Gossipsub v1.1 rules
- Updated PubsubSettings.cs to include peer scoring parameters (P1–P7) as defined in the Gossipsub spec
To-Do
- Integrate PeerScoreManager into the heartbeat function for periodic score updates
- Run a pubsub connection test to validate scoring behavior
- Add comprehensive unit tests to cover various scoring scenarios