Skip to content

Optional Content addressed messages #247

@AgeManning

Description

@AgeManning

Currently message Id's are source_id + sequence_number. For my particular use-case (Eth 2), it would be nice if we could optionally set this ID based on the content of message, for example: hash(message).

This would allow us to filter messages at the pubsub layer based on content rather than source peer.

I was thinking of adding a configuration parameter to rust-libp2p, which takes a function f: (source_id, seq_no, message) -> Stringto allow the user to specify the message id, given source_id, seq_no, message.

For my case, this would simply be hash(message)

This would be a general way to allow users to specify how messages are addressed.

I'm open to all suggestions on this and thoughts of feasibility in the go implementation.

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