Closed yhassanzadeh13 closed 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.
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.
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!
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:
Application-layer developers can perform comprehensive testing on the scoring mechanism of GossipSub. This includes setting scoring parameters, running test scenarios, and observing the updates to peers' scores in the GossipSub layer in real time.
These metadata can be used in the application layer's decision-making process, such as allowing or disallowing protocol-level participation based on the behavior in the GossipSub protocol.
Providing forensic insights into incidents and attacks.
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.