-
Notifications
You must be signed in to change notification settings - Fork 175
enh/806-add-gossipsub-1.2-support #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
enh/806-add-gossipsub-1.2-support #812
Conversation
@Winter-Soren : Great, thank you for submitting the PR. Reviewing the PR and getting it ready for production level testing. As discussed, reiterating the pointers shared: according to the Gossipsub 1.2 spec, the primary addition at that version is indeed the IDONTWANT control message. The extra features you mentioned—message author validation, IP colocation checks, spam protection enhancements, and extended control messages- are not part of the 1.2 scope. Those were proposed, refined in later iterations (1.3 and 1.4), where the focus broadened to include stronger validation, Sybil resistance measures, anti-spam controls. So your understanding is correct: in 1.2, we only need to ensure we’re compliant with the IDONTWANT mechanism, keeping the implementation lean and true to the spec. The additional enhancements you mentioned are indeed tracked for later Gossipsub versions, and we can plan to incorporate them once we’re ready to move toward 1.4 compatibility. CCing @lla-dane , who is working on peer store integration with Gossipsub. Would recommend him to do integration for Gossipsub 1.2 branch too. |
@Winter-Soren : Hi Soham. Please resolve the merge conflicts. Will re-run the CI/CD pipeline once they are resolved. |
|
||
async def publish(self, msg_forwarder: ID, pubsub_msg: rpc_pb2.Message) -> None: | ||
"""Invoked to forward a new message that has been validated.""" | ||
self.mcache.put(pubsub_msg) | ||
|
||
# Get message ID for IDONTWANT | ||
if self.pubsub is not None: | ||
msg_id = self.pubsub._msg_id_constructor(pubsub_msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes use of a private method outside the PubSub
class. You might add a new public hook inside PubSub
, or make sure there is a test that clearly fails because the private method has been changed.
@Winter-Soren : Please review the important feedback points shared by @pacrob. Kindly add the requisite changes and respond on each of the feedback points. Kindly resolve the merge conflicts too. @pacrob: Thank you so much for your review, feedback and mentorship. Appreciate your great support. |
What was wrong?
Issue #806
py-libp2p was missing support for GossipSub 1.2, which includes important security and performance improvements over GossipSub 1.1. The missing features included:
Without these features, py-libp2p networks were vulnerable to spam attacks and had suboptimal mesh quality compared to other libp2p implementations.
How was it fixed?
Implemented complete GossipSub 1.2 support following the official specification and maintaining compatibility with go-libp2p and js-libp2p implementations.
Key Components Added:
Enhanced Control Messages:
Core Integration:
/meshsub/1.2.0
)To-Do
Cute Animal Picture