-
Notifications
You must be signed in to change notification settings - Fork 784
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
Attempt to publish to at least mesh_n peers #5357
Attempt to publish to at least mesh_n peers #5357
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good to me 👍
Looks like the test_publish_without_flood_publishing
test needs a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great fix 🎉
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at fc8f1a4 |
As we have now disabled flood-publish, we only publish to mesh peers. The mesh can be difficult to manage as the management rules follow the gossipsub specification.
Thanks to @pawanjay176 - We've noticed that it can be the case that we have connected peers on topics but these peers are not in our mesh (perhaps due to their own mesh requirements). Currently, we fail to publish the message if there are no peers in our mesh.
This PR adjusts this logic to always attempt to publish to at least
mesh_n
peers. If we have peers that are subscribed to a topic, we will now attempt to publish messages to them (provided they have the required score).While I was here, I also separated the error types between insufficient peers and whether the queue is full, to help debugging and avoid any confusion in the future.