authority-discovery: Populate DHT records with public listen addresses (#6298)
This PR's main goal is to add public listen addresses to the DHT authorities records. This change improves the discoverability of validators that did not provide the `--public-addresses` flag. This PR populates the authority DHT records with public listen addresses if any. The change effectively ensures that addresses are added to the DHT record in following order: 1. Public addresses provided by CLI `--public-addresses` 2. Maximum of 4 public (global) listen addresses (if any) 3. Any external addresses discovered from the network (ie from `/identify` protocol) While at it, this PR adds the following constraints on the number of addresses: - Total number of addresses cached is bounded at 16 (increased from 10). - A maximum number of 32 addresses are published to DHT records (previously unbounded). - A maximum of 4 global listen addresses are utilized. This PR also removes the following warning: `WARNING: No public address specified, validator node may not be reachable.` ### Next Steps - [ ] deploy and monitor in versi network Closes: https://github.com/paritytech/polkadot-sdk/issues/6280 Part of: https://github.com/paritytech/polkadot-sdk/issues/5266 cc @paritytech/networking --------- Signed-off-by:Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
Dmitry Markin <dmitry@markin.tech> Co-authored-by:
Bastian Köcher <git@kchr.de>
parent
2ae79be8
Showing
- prdoc/pr_6298.prdoc 25 additions, 0 deletionsprdoc/pr_6298.prdoc
- substrate/client/authority-discovery/src/worker.rs 125 additions, 51 deletionssubstrate/client/authority-discovery/src/worker.rs
- substrate/client/authority-discovery/src/worker/tests.rs 2 additions, 2 deletionssubstrate/client/authority-discovery/src/worker/tests.rs
- substrate/client/cli/src/commands/run_cmd.rs 1 addition, 11 deletionssubstrate/client/cli/src/commands/run_cmd.rs