Skip to content

Add Gossipsub 1.4 module in py-libp2pΒ #992

@seetadev

Description

@seetadev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions