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

Allow discovery of the peers when slots for functional connections are consumed #2743

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Feb 21, 2025

Closes #2741

Rework of #2644 PR

The max_discovery_peers_connected__nodes_will_discover_new_peers_if_first_peer_is_full test was flaky and was failing in our CI(plus sometimes locally for me).

This PR reimplement the discovery feature from #2644 in a more stable way. Plus, this change also takes into account reserved nodes(which was missed in the previous PR).

The approach is simple, when number of functional connections is full, we return Dummy handler for connections, which doesn't support any protocols and do nothing. It is done for all behaviours except discovery, connection limitation and blacklisting.

It allows us to continue processing peers, which are connected via the discovery protocol. Also, because we don't return an error now, we will not close the connection, allowing bootstrap nodes to accumulate more nodes/IPs that can later be shared with connected nodes.

Because full nodes don't support any protocol, a request to them will fail automatically on the sender side.

Also, this change adds support for the limited number of outbound connections to solve over-connection of the network.

@xgreenx xgreenx requested a review from a team February 21, 2025 08:56
@xgreenx xgreenx self-assigned this Feb 21, 2025
Increased the default value of nodes to discover to 10k
Added support for the limited number of outbound connections to solve over connection of the network.
Copy link
Member

@rymnc rymnc left a comment

Choose a reason for hiding this comment

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

nice refactor, left a couple comments

@xgreenx xgreenx requested a review from rymnc February 21, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix flaky max_discovery_peers_connected__nodes_will_discover_new_peers_if_first_peer_is_full
2 participants