-
Notifications
You must be signed in to change notification settings - Fork 189
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
gossip methods: renames and predicate adjustment #204
Conversation
@raulk No problem with these changes, however when I've spoken to @vyzo about changing the predicate in the past he has mentioned that this is an intentional change. So we may need to first decide whether the real issue is docs or implementation (i.e. libp2p/docs#66). My understanding of the argument to leave the predicate alone is that we'd actually like the effective If we are onboard with the above logic (or if @vyzo has other points that I'm missing) we must fix the documentation (@vyzo disagrees and says this is just an implementation optimization), otherwise people implementing simulations will achieve different results from us. Additionally, if we wanted we could make the logic a little more predictable by using the proposed predicate (filtering based on existing peers), but setting the number to be based on the fraction of peers not in the mesh e.g. No complaint about simply adopting this PR if we do not think the above argument is sufficient. However, we should also make sure to change it in the simulations so that they stay consistent. EDIT: Also, if we do this change we should make sure to propagate this information to the JS and Rust implementations. |
@aschmahmann Thoughts:
I think Rust already behaves the way proposed herein: https://github.com/libp2p/rust-libp2p/pull/898/files#diff-88fd6ff4aa853343221bf015d3c5a32bR768 (follow the breadcrumbs). gossipsub-js seems to not impose an upper limit on gossip: https://github.com/ChainSafe/gossipsub-js/blob/a6bd1850085176b912bc9e1c350122e34c8eefed/src/index.js#L547-L556 |
Let me be more precise:
This behaviour is specified in the specs (libp2p/specs#219). If this is deliberate, we should explain the motivation. |
@raulk I'm confused. The line right before the ones you linked to limits the gossip to |
Let's fix the naming of |
Great, merging. |
This PR proposes minor renames for accuracy.
It also uses the predicate on
ps.getPeers
to exclude the exclusion set, to sure we source as many asD
peers to push gossip to. With the current logic, we might select peers that later end up being excluded, resulting in us gossiping to less thanD
peers.