Closed lukasz-zimnoch closed 4 years ago
There is no reason to pass messages if we are not subscribing, that's a DoS waiting to happen. We are considering adding a relay-only option to pubsub that would enable relaying without subscription.
We are considering adding a relay-only option to pubsub that would enable relaying without subscription.
Is there any PR or issue for that one where we could learn more and potentially contribute?
Unless I misunderstood, I think this is what @lukasz-zimnoch is asking about. If there is a peer that is not subscribed to the given topic and this peer is the only point currently connecting two other peers subscribed to that topic, we could have a relay-only somewhere in pubsub allowing to pass-thru messages.
Yes, issue #28 has been open for a while.
@vyzo I see there was already a contribution https://github.com/libp2p/go-libp2p-pubsub/pull/229 but has been closed. We are interested in contributing here but we need to know more. Why #229 didn't pass and what is a must for a complete solution here? Could you provide those details?
@lukasz-zimnoch @vyzo What if we close this issue as it kinda duplicates #28 and we'll continue the discussion there?
I wanted to avoid distractions while the gossipsub v1.1 work was in progress; we can certainly reopen that pr.
Actually there were a couple of things wrong with that pr, if you are interested in opening a new one it should use a reference counter and avoid the use of a relay object -- just the topic handle will do.
edit: the issue is that it conflates subscriptions with relaying and only allows it to happen once.
I think we can indeed close this issue and continue discussion in #28.
Looking at
handleIncomingRPC
method defined inpubsub.go
we can see a part which forwards received messages if ourpubsub
instance has an existing subscription to the given message topic:If our pubsub doesn't have this subscription, we are just ignoring the current message. Also,
HandleRPC
is a no-op in floodsub implementation so we don't do anything with therpc
later.The question: is there a particular reason why
pubsub
ignores messages they are not subscribed to, instead of just passing them to other peers and gain on the delivery rate?