Skip to content

[Networking] Gossipsub content-addressed messages #1528

@AgeManning

Description

@AgeManning

Currently, gossipsub uses source_peer_id + sequence_number to address the messages sent across the gossipsub network. If a client re-publishes a seen message, this will look like a new message to all other peers. This can lead to duplicate messages on the network, which then needs to be filtered at the application layer.

Rust and go (libp2p/go-libp2p-pubsub#248) now have the ability to customise the message id of gossipsub messages. I propose we set the gossipsub message id to:
base64(sha256(data)) where data is the gossipsub protobuf data field which typically contains our ssz-encoded data or snappy-compressed data.

This way, gossipsub will filter out duplicate messages before notifying the application layer. In principle, we then just need to verify the hash at the application layer to ensure duplicates aren't sent/received.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions