feat(p2p): Seed connectivity tuning options: max-incoming-connection-time, incoming-connection-window #532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Clients connecting to seed nodes never disconnect, causing seed to reject new clients due to lack of "free slots".
What was done?
max-incoming-connection-time
that will drop incoming connections from non-persistent peers after configured time.incoming-connection-window
setting in config, to allow blocking immediate reconnect attemptsThese settings, together with
max-outgoing-connections
,max-connections
andpersistent-peers
, makes it possible to create seed node configuration that will disconnect clients from seed once it retrieves initial peer list.Configuration of seed nodes
Suggested configuration of a seed node is as follows:
persistent-peers
(for example, 5 persistent peers) (optional)max-outgoing-connections
to a number slightly bigger than num of persistent peers (for example,10
)max-connections
to some value much larger than max-outgoing-connections (example:50
)max-incoming-connection-time
to a few seconds (example:"20s"
)incoming-connection-window
to a few minutes (example:"1m"
)Note: numbers above require tuning on the actual network, they are just some kind of guess
How Has This Been Tested?
E2E
Using e2e framework, created a network of 20 nodes, and configured seed with the following settings:
The network started successfully.
DevNet
Devnet test scenario
Configuration of seed node
In section [p2p], set the following settings:
Expected behavior
Once the network is provisioned, nodes should very slowly join the network, with performance of ~4 nodes per minute.
This should be monitored; it is expected that all nodes will join the network in approx. 15-20 minutes.
Once all nodes join the network, the seed should maintain 2 outgoing connections, and 0-2 incoming connections (this can be monitored with netstat inside the container). Incoming connections should be disconnected after 30 seconds.
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only