libp2p / libp2p/py-libp2p

Add Gossipsub 1.4 module in py-libp2p

Open
#992 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
624
Forks
256
Avg merge
1d 34m
Merged PRs (30d)
47

Description

Description

Implement Gossipsub v1.4 in py-libp2p, aligning with the latest libp2p/specs/pubsub/gossipsub specification.

This update introduces key performance and security enhancements over v1.2, including improved peer scoring, message propagation, and adaptive gossip strategies.

Motivation

The current implementation in py-libp2p supports Gossipsub v1.1 / v1.2.

To ensure protocol parity with other libp2p implementations (go-libp2p, js-libp2p, rust-libp2p), and enable cross-language interoperability, we need to bring the Gossipsub 1.4 features to Python.

This will also enhance pubsub performance in decentralized applications using Python-based networking stacks, such as those in Filecoin and IPFS ecosystems.

Requirements
Key Features to Implement
  • Extended Peer Scoring Parameters

    • Decay interval refinements and behavioral penalties.
  • IP Colocation Penalties

    • Penalize peers from the same IP subnet to prevent Sybil attacks.
  • Adaptive Gossip Dissemination

    • Dynamic adjustment of gossip parameters for improved propagation efficiency.
  • Message ID Customization

    • Support for user-defined message ID functions.
  • Rate-limiting and Score Decay Enhancements

    • Align with Gossipsub v1.4 performance tuning.
  • Testing and Interop

    • Validate against go-libp2p and js-libp2p implementations.

References

Next Steps
  1. Review existing Gossipsub 1.2 module implementation in py-libp2p.
  2. Outline architectural deltas required for 1.4 compliance.
  3. Begin incremental implementation (peer scoring, adaptive gossip, rate limiting).
  4. Add test cases and benchmarking suite for verification.
  5. Validate interoperability with go-libp2p and js-libp2p.
Open questions

No response

Are you planning to do it yourself in a pull request ?

Maybe

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing Gossipsub 1.2 module in py-libp2p alongside the Gossipsub v1.4 specification and the referenced Go, JavaScript, and Rust implementations. Identify the architectural deltas for peer scoring, gossip, message IDs, rate limiting, and interoperability before implementing incrementally. Done means the listed features are covered by tests, benchmarks, and cross-language validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.