libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.56k stars 273 forks source link

pubsub: consider single required topic hash #399

Closed wemeetagain closed 2 years ago

wemeetagain commented 2 years ago

Currently, rust-libp2p assumes a single required topic hash (https://github.com/libp2p/rust-libp2p/blob/a168410dbed0d0941f2e5a14543206044ccb2260/protocols/gossipsub/src/types.rs#L123)

This simplifies the code a lot and seems to be the standard use-case for pubsub protocols.

Perhaps this can be applied at the spec level and rolled out to other implementations.

cc @dapplion

vyzo commented 2 years ago

No, we've had this discussion before -- we are not changing the spec to require hashes.

Note that messages have a single topic for a while now, if that's what you mean; the spec might need to be updated for that.

wemeetagain commented 2 years ago

Note that messages have a single topic for a while now, if that's what you mean; the spec might need to be updated for that.

Yeah thats what I was meant.

Is the idea to keep the protobuf definition as-is and just enforce the single topic outside of that? Or is the protobuf definition changing?

vyzo commented 2 years ago

we changed the protobuf too in go pubsub, but backwards compatible (same field id).

Mind opening a pr to update the spec?

wemeetagain commented 2 years ago

Mind opening a pr to update the spec?

Sure thing

mxinden commented 2 years ago

If I am not mistaken this can be closed with https://github.com/libp2p/specs/pull/400.