Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mechanism to send the message to the application level if a topic validation fails. #445

Open
synzhu opened this issue Aug 12, 2021 · 1 comment

Comments

@synzhu
Copy link
Contributor

synzhu commented Aug 12, 2021

Context: https://discuss.libp2p.io/t/topicvalidator-which-delivers-to-the-application-but-does-not-forward-to-the-network/1010

We would like a way to enable messages to still be sent to the application level, even if the message is invalidated (ValidationIgnore) by a topic validator.

Perhaps we could introduce a new type of Validation Response like ValidationIntercept, which signals that we don't want to forward or gossip the message, but we want to still have the message delivered to us at the application level.

One important thing to note here is that we may actually have to allow the application to modify the message data in order to do the validation. For example, the message payload may be serialized, but we may need to look at the deserialized data in order to do the validation. We wouldn't then want to pass the original message to the application, since then it would need to deserialize a second time.

Today, this can be accomplished by passing the message from the validation function into a side channel, but this is a hack and I would like to design a better way of supporting this use case.

@synzhu
Copy link
Contributor Author

synzhu commented Aug 13, 2021

@vyzo Could you move this one to pubsub as well, and perhaps provide some thoughts?

@Stebalien Stebalien transferred this issue from libp2p/go-libp2p Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant