-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli/net_params: Warn on empty public-addr when starting a validator node #5240
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2144701
net_params: Request for public-addr when starting a validator node
lexnv dc5f96d
Add prdoc
lexnv c02d7b3
cli: Place warns after logger init
lexnv 5b0295f
Update prdoc location
lexnv 2c34fb4
cli: Fix clippy
lexnv 4f801e9
cli: Link github issue
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
title: Warn on empty public-addr when starting a validator node | ||
|
||
doc: | ||
- audience: Node Operator | ||
description: | | ||
This PR shows a warning when the `--public-addr` CLI parameter is missing for validators. | ||
In the future, we'll transform this warning into a hard failure. | ||
Validators are encouraged to provide this parameter for better availability over the network. | ||
|
||
crates: | ||
- name: sc-cli | ||
bump: patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,7 +172,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized { | |
node_key: NodeKeyConfig, | ||
default_listen_port: u16, | ||
) -> Result<NetworkConfiguration> { | ||
Ok(if let Some(network_params) = self.network_params() { | ||
let network_config = if let Some(network_params) = self.network_params() { | ||
network_params.network_config( | ||
chain_spec, | ||
is_dev, | ||
|
@@ -185,7 +185,12 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized { | |
) | ||
} else { | ||
NetworkConfiguration::new(node_name, client_id, node_key, Some(net_config_dir)) | ||
}) | ||
}; | ||
|
||
// TODO: Return error here in the next release. | ||
// if is_validator && network_config.public_addresses.is_empty() {} | ||
|
||
Ok(network_config) | ||
} | ||
|
||
/// Get the keystore configuration. | ||
|
@@ -638,6 +643,14 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized { | |
|
||
logger.init()?; | ||
|
||
if config.role.is_authority() && config.network.public_addresses.is_empty() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you check parachain collators(is_authorithy returns true) won't get this warning? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
warn!( | ||
"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." | ||
); | ||
} | ||
|
||
match fdlimit::raise_fd_limit() { | ||
Ok(fdlimit::Outcome::LimitRaised { to, .. }) => | ||
if to < RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have an issue for this and link the place where to add IMO. Already too many dead TODOs in the code 😬