This partly does the job, but not completely.
Not sure if this is a bug, but even if we use subscription filters, it doesn’t prevent graft requests from other peers.
In other words, say peer A uses a subscription filter that blocks peer B from subscribing to topic X.
This will prevent peer B from getting added to
p.topics[X], but the problem is that the gossipsub implementation also picks gossipsub peers to publish the message to: go-libp2p-pubsub/gossipsub.go at master · libp2p/go-libp2p-pubsub · GitHub
And the subscription filter does not prevent peer B from getting added to
gs.mesh[X], which may happen during a graft.
Is this the intended behavior? Or would this be a bug?