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

Expose Deep Copy of Mesh, Fanout, and Peers' Scores in GossipSub to Application Layer #518

Closed yhassanzadeh13 closed 1 year ago

yhassanzadeh13 commented 1 year ago

This pull request implements a new feature in GossipSub that exposes a deep copy of the mesh, fanout, and peers' scores to the application layer. The deep-copy feature ensures that the internal state of GossipSub remains protected from interference by the application layer, while still providing the following benefits:

By exposing these deep copies, the application layer can gain greater visibility into the inner workings of GossipSub, allowing for more robust testing and decision-making processes.

p-shahi commented 1 year ago

Hi @yhassanzadeh13, thanks for this! In the usual libp2p workflow (for maintainers and community members alike), new features are proposed as an update to the specifications (gossipsub specs here) with an accompanying PR. Would you be able to create a specs PR outlining what you already included in the PR description here as well but in an md file. If you can provide some added motivation on whether/how you plan to use this in Flow would be really helpful as well.

On second thought, this change looks like it doesn't need a spec update.

vyzo commented 1 year ago

This is perfectly fine and something we have been discussing.

Specs are irrelevant here, this is a library specific introspection mechanism and not a protocol change.

yhassanzadeh13 commented 1 year ago

Reverting and closing this PR as there is seemingly a way to inject tracers for score and topology at the application layer. Thanks for the feedbacks!