TopicValidator which delivers to the application but does not forward to the network

Hi,

We are trying to find a way for a node to accept pubsub messages from specific nodes on a topic but not gossip those messages to other nodes since these specific nodes are not part of the core network but are just trying to follow the chain.
We were considering using TopicValidator but I realized it does not has an option to send the message to the application but not forward it to the network.

  1. Do you know of a way we could achieve that?
  2. We were considering passing in a TopicValidator which rejects the messages from these nodes so that they don’t get forward to the network but then delivers it to our application (using a channel or some other mechanism). Do you see any issues around that approach?

thanks in advance,
Vishal

We discussed adding this feature, but I think it hasn’t been implemented yet. @vyzo can advise.

yeah, we didnt have the need for it yet, so it wasnt implemented; if you open an issue to track it, we can consider adding support for it.

For now you can achieve the same effect with a stateful validator that returns ValidationIgnore yet delivers the message with a side channel.

Hey @raul, I would love to clarify one thing about the validation.

I understand that it validates whether or not we want to receive / forward a message, but how does it affect gossip? In other words, I just want to ensure it is not possible that we gossip about a message (IHAVESEEN) even though the validation of the message itself failed when we received it.

thanks @vyzo
And delivering the message via a side channel should not have any side-effects, correct? we will be bypassing the stack in that case as the message will not propagate through the regular subscription.

yes, as long as you return ValidationIgnore.

@vyzo @raul btw, what is the best way to reach you guys to chat about some things? I tried using the discord but it seems like nobody is active there