I have a use case that calls for the following:
Using pubsub/gossipsub:
- Peers can optionally subscribe to N topics.
- Messages can be valid on a subset of the N topics.
- Messages should be published on each of the topics they are valid on.
Ideally, a peer only requests an IWANT
for a message once, even though it may have been notified of the same message across multiple topics.
I’m currently running into the following issue:
- If I use a different
message_id
for each topic, the peer willIWANT
the same logical message multiple times, increasing network traffic. - If I use the same
message_id
for each topic, theseen
cache will reject the publish. Thus, a message can only be sent on one topic.
Is there a way that I can achieve this?
Potential solution:
seen
cache is scoped to a topic during publish, but is cross-topic when issuing IWANT messages