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

Attempt to publish to at least mesh_n peers #5357

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

AgeManning
Copy link
Member

@AgeManning AgeManning commented Mar 6, 2024

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.

@AgeManning AgeManning added the ready-for-review The code is ready for review label Mar 6, 2024
@AgeManning AgeManning added the v5.1.0 Q2 2024 label Mar 6, 2024
Copy link
Member

@jimmygchen jimmygchen left a 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.

Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great fix 🎉

beacon_node/lighthouse_network/src/gossipsub/behaviour.rs Outdated Show resolved Hide resolved
@AgeManning AgeManning added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Mar 7, 2024
@AgeManning
Copy link
Member Author

@Mergifyio queue

Copy link

mergify bot commented Mar 7, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at fc8f1a4

mergify bot added a commit that referenced this pull request Mar 7, 2024
mergify bot added a commit that referenced this pull request Mar 7, 2024
@mergify mergify bot merged commit fc8f1a4 into sigp:unstable Mar 7, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge. v5.1.0 Q2 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants