authority-discovery: Populate DHT records with public listen addresses#6298
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
| eprintln!( | ||
| "WARNING: No public address specified, validator node may not be reachable. | ||
| Consider setting `--public-addr` to the public IP address of this node. | ||
| This will become a hard requirement in future versions." | ||
| ); |
There was a problem hiding this comment.
Honestly, I would keep this warning, because there is no guarantee we will have a global listen address nor that the external address will be discovered correctly (with libp2p address translation). Especially since there is a practice of "hiding" validators behind firewalls / NATs.
Versi Network Triage Report
|
addreses Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
|
I have moved the warning to the authority-discovery mechanism instead of removing it. This has the following implications:
|
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Is it printed soon enough for a node operator to notice? |
|
From my testing it should be printed roughly within 10 seconds: I used cumulus/zombienet/tests/0003-full_node_catching_up.toml to double check this:
|
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
|
Who would be a good second reviewer of this code? I would love to get it approved, but it is too far from my domain to review in a meaningful way. |
|
I would ask @alexggh |
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6298-to-stable2407
git worktree add --checkout .worktree/backport-6298-to-stable2407 backport-6298-to-stable2407
cd .worktree/backport-6298-to-stable2407
git reset --hard HEAD^
git cherry-pick -x 762f824cb3adf23c72a6645f575057bfb543850b
git push --force-with-lease |
#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: #6280 Part of: #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> (cherry picked from commit 762f824)
|
Successfully created backport PR for |
* master: (129 commits) pallet-revive: Use `RUSTUP_TOOLCHAIN` if set (#6365) [eth-rpc] proxy /health (#6360) [Release|CI/CD] adjust release pipelines (#6366) Bump the known_good_semver group across 1 directory with 3 updates (#6339) Run check semver in MQ (#6287) [Deprecation] deprecate treasury `spend_local` call and related items (#6169) refactor and harden check_core_index (#6217) litep2p: Update litep2p to v0.8.0 (#6353) [pallet-staking] Additional check for virtual stakers (#5985) migrate pallet-remarks to v2 bench syntax (#6291) Remove leftover references of Wococo (#6361) snowbridge: allow account conversion for Ethereum accounts (#6221) authority-discovery: Populate DHT records with public listen addresses (#6298) Bounty Pallet: add `approve_bounty_with_curator` call to `bounties` pallet (#5961) Silent annoying log (#6351) [pallet-revive] rework balance transfers (#6187) `statement-distribution`: RFC103 implementation (#5883) Disable flaky tests reported in #6343 / #6345 (#6346) migrate pallet-recovery to benchmark V2 syntax (#6299) inclusion emulator: correctly handle UMP signals (#6178) ...
|
|
||
| if let Some(multiaddr::Protocol::P2p(peer_id)) = address.iter().last() { | ||
| if peer_id != *local_peer_id.as_ref() { | ||
| error!( |
There was a problem hiding this comment.
This line for sure breaks this test:
Does it need to be error? If so, I can adjust the condition in test to be 1.
There was a problem hiding this comment.
I can change it back to warning for now, sorry missed that 🙏
There was a problem hiding this comment.
The error is coming from the validator setup:
2024-11-05 20:07:15.454
2024-11-05 18:07:15.454 ERROR tokio-runtime-worker sub-authority-discovery: No public addresses configured and no global listen addresses found. Authority DHT record may contain unreachable addresses. Consider setting `--public-addr` to the public IP address of this node. This will become a hard requirement in future versions for authorities.
Will adjust the testing instead to accommodate this 🙏
This PR fixes the `0002-validators-warp-sync` zombienet test by matching for a specific error case. The following PR introduced a new error for validators that don't have public addresses available for publishing in the DHT: - #6298 The log line was moved from `eprintln!("Warning: ...` in sc-cli to the authority discovery where it is printed properly as an error. cc @paritytech/sdk-node Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
…6380) This PR ensures that external addresses with different PeerIDs are not propagated to the higher layer of the network code. While at it, this ensures that libp2p only adds the `/p2p/peerid` part to the discovered address if it does not contain it already. This is a followup from: - #6298 cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Dmitry Markin <dmitry@markin.tech>
…6380) This PR ensures that external addresses with different PeerIDs are not propagated to the higher layer of the network code. While at it, this ensures that libp2p only adds the `/p2p/peerid` part to the discovered address if it does not contain it already. This is a followup from: - #6298 cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Dmitry Markin <dmitry@markin.tech>
…6380) This PR ensures that external addresses with different PeerIDs are not propagated to the higher layer of the network code. While at it, this ensures that libp2p only adds the `/p2p/peerid` part to the discovered address if it does not contain it already. This is a followup from: - #6298 cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Dmitry Markin <dmitry@markin.tech>
#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: #6280 Part of: #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>
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-addressesflag.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:
--public-addresses/identifyprotocol)While at it, this PR adds the following constraints on the number of addresses:
This PR also removes the following warning:
WARNING: No public address specified, validator node may not be reachable.Next Steps
Closes: #6280
Part of: #5266
cc @paritytech/networking