From 81945d024810c5d3417e23348f243661d4c78520 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 31 Jul 2020 10:08:31 +0200 Subject: [PATCH 1/3] Add a warning if users pass --sentry or --sentry-nodes --- client/network/src/service.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/network/src/service.rs b/client/network/src/service.rs index c11a620c56720..e8072a926c86e 100644 --- a/client/network/src/service.rs +++ b/client/network/src/service.rs @@ -179,6 +179,20 @@ impl NetworkWorker { known_addresses.push((reserved.peer_id.clone(), reserved.multiaddr.clone())); } + let print_deprecated_message = match ¶ms.role { + Role::Sentry { .. } => true, + Role::Authority { sentry_nodes } if !sentry_nodes.is_empty() => true, + _ => false, + }; + if print_deprecated_message { + log::warn!( + "🙇 Sentry nodes are deprecated for the time being, and the `--sentry` and + `--sentry-nodes` CLI options will be removed in a future version. The Substrate + and Polkadot networking protocol require validators to be publicly-accessible. + Please do not block access to your validator nodes." + ); + } + let mut sentries_and_validators = HashSet::new(); match ¶ms.role { Role::Sentry { validators } => { From 0c456e1c1224cfa69fadee734c4a39a48817c165 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 7 Aug 2020 15:51:28 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Max Inden --- client/network/src/service.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/network/src/service.rs b/client/network/src/service.rs index 8d057cce95e45..6a89b9e1a0711 100644 --- a/client/network/src/service.rs +++ b/client/network/src/service.rs @@ -187,10 +187,11 @@ impl NetworkWorker { }; if print_deprecated_message { log::warn!( - "🙇 Sentry nodes are deprecated for the time being, and the `--sentry` and - `--sentry-nodes` CLI options will be removed in a future version. The Substrate + "🙇 Sentry nodes are deprecated, and the `--sentry` and + `--sentry-nodes` CLI options will eventually be removed in a future version. The Substrate and Polkadot networking protocol require validators to be publicly-accessible. - Please do not block access to your validator nodes." + Please do not block access to your validator nodes. + For details see https://github.com/paritytech/substrate/issues/6845. ); } From 76bba3281d5a17b79a5e1fede95c7e7ede7f6740 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 7 Aug 2020 15:53:23 +0200 Subject: [PATCH 3/3] Fix text --- client/network/src/service.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/network/src/service.rs b/client/network/src/service.rs index 6a89b9e1a0711..11fdfc0beec3f 100644 --- a/client/network/src/service.rs +++ b/client/network/src/service.rs @@ -187,11 +187,11 @@ impl NetworkWorker { }; if print_deprecated_message { log::warn!( - "🙇 Sentry nodes are deprecated, and the `--sentry` and - `--sentry-nodes` CLI options will eventually be removed in a future version. The Substrate - and Polkadot networking protocol require validators to be publicly-accessible. - Please do not block access to your validator nodes. - For details see https://github.com/paritytech/substrate/issues/6845. + "🙇 Sentry nodes are deprecated, and the `--sentry` and `--sentry-nodes` \ + CLI options will eventually be removed in a future version. The Substrate \ + and Polkadot networking protocol require validators to be \ + publicly-accessible. Please do not block access to your validator nodes. \ + For details, see https://github.com/paritytech/substrate/issues/6845." ); }