libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
319 stars 185 forks source link

Published Messages Are Dropped In Gossipsub #398

Closed nisdas closed 3 years ago

nisdas commented 3 years ago

Currently before a message can be broadcasted to all peers in a mesh, it has to pass a series of steps before it can be sent to its peers.

This can lead to messages going missing in the above case. While it does make sense to drop inbound messages in the event our validation queue is full, dropping messages originating from the host (rather than re-propagated) does not seem correct. As given the host is the source and originator of the particular message it should be special cased.

The issue is similar to #217, something like WaitUntilQueued would be very useful here to specify the importance of the message.

vyzo commented 3 years ago

Yeah, we could make it synchronous at some level and make sure it doesn't get dropped because of full validator queues.

Stebalien commented 3 years ago

@vyzo any reason not to just skip validation for our own messages? If we really want, we could even validate before pushing...

vyzo commented 3 years ago

I think that validating our own messages is paramount for correctness -- otherwise we can have some nasty bugs that will be very hard to diagnose.

vyzo commented 3 years ago

From synchronous discussion with @Stebalien we concluded that the right way to solve this issue is to perform validation for own messages synchronously on publish, and return an error if validation fails.

vyzo commented 3 years ago

See #406 for implementation -- @nisdas this should finally resolve this very thorny issue.

Thanks for bringing this up.