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

chore: Reserve % of max connections for relay #3163

Open
AlbertoSoutullo opened this issue Oct 30, 2024 · 0 comments · May be fixed by #3184
Open

chore: Reserve % of max connections for relay #3163

AlbertoSoutullo opened this issue Oct 30, 2024 · 0 comments · May be fixed by #3184
Assignees
Labels
effort/days Estimated to be completed in a few days, less than a week

Comments

@AlbertoSoutullo
Copy link

AlbertoSoutullo commented Oct 30, 2024

Background

max-connections is used to set the maximum amount of concurrent connections that the switch accepts.
Currently, it is also being used to set the max-relay-peers, here.
This allows the waku node to always have room for other protocols.
However, this is not something that happens in the other way around. This means that other protocols can fill the number of max-connections, disabling the ability of relaying messages for the waku node.

Details

Given the following scenario, in the following order:

  1. Setup a bootstrap only node.
  2. Setup a filter relay node with max-connections=5
  3. Setup 5 filter client nodes, connected to the filter relay node. This will cap the number of connections.
  4. Setup another filter relay node, and connect them to the bootstrap node.

If we inject messages to the nodes in point 4, the node in point 1 will not be able to receive them, as it will not connect to those nodes due to the maximum number of connections reached.

Acceptance criteria

In the same way that a node has always 20% connections for other protocols, should also have at least d_low connections reserved for relay as well.
If not, there can happen a lot of bad situations that might be complex to find the root of the issue.
If by any chance a relay node has disconnections to other relay nodes and has less than d_low relay connections, and in the meantime new filter client nodes are connected, unless those clients are disconnected again, the node will stop relaying messages.
This can be checked because it will start logging that there are not enough peers to publish, but if it loses connections to ALL other relay nodes, it will not log anything, and it will stop receiving messages.

@Ivansete-status Ivansete-status moved this to Priority in Waku Oct 30, 2024
@Ivansete-status Ivansete-status added the effort/days Estimated to be completed in a few days, less than a week label Oct 30, 2024
@darshankabariya darshankabariya moved this from Priority to In Progress in Waku Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to be completed in a few days, less than a week
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants