Skip to content

Commit

Permalink
Add a warning if users pass --sentry or --sentry-nodes (paritytech#6779)
Browse files Browse the repository at this point in the history
* Add a warning if users pass --sentry or --sentry-nodes

* Apply suggestions from code review

Co-authored-by: Max Inden <[email protected]>

* Fix text

Co-authored-by: parity-processbot <>
Co-authored-by: Max Inden <[email protected]>
  • Loading branch information
tomaka and mxinden authored Aug 12, 2020
1 parent d7979d0 commit f6d66db
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
known_addresses.push((reserved.peer_id.clone(), reserved.multiaddr.clone()));
}

let print_deprecated_message = match &params.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, 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."
);
}

let mut sentries_and_validators = HashSet::new();
match &params.role {
Role::Sentry { validators } => {
Expand Down

0 comments on commit f6d66db

Please sign in to comment.