client/authority-discovery: Limit number of connections to authorities
Instead of connecting to all sentry nodes of all authorities, with this patch the authority discovery module does the following: - Choose one sentry node per authority at random. - Choose MAX_NUM_AUTHORITY_CONN out of the above at random. The module uses randomness to prevent hot spots, e.g. all nodes trying to connect to a single node. If the authority discovery module would choose the nodes to connect to at random on each new address that it learns of, the node would go through a lot of connection churn. Instead it creates a random seed at start up and uses this seed for its RNG on each update cycle.
Showing
- Cargo.lock 1 addition, 0 deletionsCargo.lock
- client/authority-discovery/Cargo.toml 7 additions, 6 deletionsclient/authority-discovery/Cargo.toml
- client/authority-discovery/src/error.rs 4 additions, 0 deletionsclient/authority-discovery/src/error.rs
- client/authority-discovery/src/lib.rs 104 additions, 79 deletionsclient/authority-discovery/src/lib.rs
Please register or sign in to comment