Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions validator/src/admin_rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ impl AdminRpc for AdminRpcImpl {
let mut write_staked_nodes = meta.staked_nodes_overrides.write().unwrap();
write_staked_nodes.clear();
write_staked_nodes.extend(loaded_config);
info!("Staked nodes overrides loaded from {}", path);
debug!("overrides map: {:?}", write_staked_nodes);
info!("Staked nodes overrides loaded from {path}");
debug!("overrides map: {write_staked_nodes:?}");
Ok(())
}

Expand All @@ -548,7 +548,7 @@ impl AdminRpc for AdminRpcImpl {
}

fn select_active_interface(&self, meta: Self::Metadata, interface: IpAddr) -> Result<()> {
debug!("select_active_interface received: {}", interface);
debug!("select_active_interface received: {interface}");
meta.with_post_init(|post_init| {
let node = post_init.node.as_ref().ok_or_else(|| {
jsonrpc_core::Error::invalid_params("`Node` not initialized in post_init")
Expand All @@ -557,8 +557,7 @@ impl AdminRpc for AdminRpcImpl {
node.switch_active_interface(interface, &post_init.cluster_info)
.map_err(|e| {
jsonrpc_core::Error::invalid_params(format!(
"Switching failed due to error {}",
e
"Switching failed due to error {e}"
))
})?;
info!("Switched primary interface to {interface}");
Expand Down Expand Up @@ -623,10 +622,7 @@ impl AdminRpc for AdminRpcImpl {
meta: Self::Metadata,
pubkey_str: String,
) -> Result<HashMap<RpcAccountIndex, usize>> {
debug!(
"get_secondary_index_key_size rpc request received: {:?}",
pubkey_str
);
debug!("get_secondary_index_key_size rpc request received: {pubkey_str:?}");
let index_key = verify_pubkey(&pubkey_str)?;
meta.with_post_init(|post_init| {
let bank = post_init.bank_forks.read().unwrap().root_bank();
Expand Down Expand Up @@ -832,7 +828,7 @@ pub fn run(ledger_path: &Path, metadata: AdminRpcRequestMetadata) {

match server {
Err(err) => {
warn!("Unable to start admin rpc service: {:?}", err);
warn!("Unable to start admin rpc service: {err:?}");
}
Ok(server) => {
info!("started admin rpc service!");
Expand Down Expand Up @@ -919,7 +915,7 @@ where
pub fn load_staked_nodes_overrides(
path: &String,
) -> std::result::Result<StakedNodesOverrides, Box<dyn error::Error>> {
debug!("Loading staked nodes overrides configuration from {}", path);
debug!("Loading staked nodes overrides configuration from {path}");
if Path::new(&path).exists() {
let file = std::fs::File::open(path)?;
Ok(serde_yaml::from_reader(file)?)
Expand Down
13 changes: 6 additions & 7 deletions validator/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ fn get_vetted_rpc_nodes(
Err(err) => {
error!(
"Failed to get RPC nodes: {err}. Consider checking system clock, removing \
`--no-port-check`, or adjusting `--known-validator ...` arguments as \
applicable"
`--no-port-check`, or adjusting `--known-validator ...` arguments as \
applicable"
);
exit(1);
}
Expand Down Expand Up @@ -953,8 +953,7 @@ fn build_known_snapshot_hashes<'a>(
if is_any_same_slot_and_different_hash(&full_snapshot_hash, known_snapshot_hashes.keys()) {
warn!(
"Ignoring all snapshot hashes from node {node} since we've seen a different full \
snapshot hash with this slot.\
\nfull snapshot hash: {full_snapshot_hash:?}"
snapshot hash with this slot. full snapshot hash: {full_snapshot_hash:?}"
);
debug!(
"known full snapshot hashes: {:#?}",
Expand All @@ -980,9 +979,9 @@ fn build_known_snapshot_hashes<'a>(
) {
warn!(
"Ignoring incremental snapshot hash from node {node} since we've seen a \
different incremental snapshot hash with this slot.\
\nfull snapshot hash: {full_snapshot_hash:?}\
\nincremental snapshot hash: {incremental_snapshot_hash:?}"
different incremental snapshot hash with this slot. full snapshot hash: \
{full_snapshot_hash:?}, incremental snapshot hash: \
{incremental_snapshot_hash:?}"
);
debug!(
"known incremental snapshot hashes based on this slot: {:#?}",
Expand Down
35 changes: 19 additions & 16 deletions validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub fn warn_for_deprecated_arguments(matches: &ArgMatches) {
}
}
// this can not rely on logger since it is not initialized at the time of call
eprintln!("{}", msg);
eprintln!("{msg}");
}
}
}
Expand Down Expand Up @@ -472,8 +472,8 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.takes_value(true)
.validator(is_url_or_moniker)
.help(
"URL for Solana's JSON RPC or moniker (or their first letter): \
[mainnet-beta, testnet, devnet, localhost]",
"URL for Solana's JSON RPC or moniker (or their first letter): [mainnet-beta, \
testnet, devnet, localhost]",
),
)
.arg(
Expand All @@ -484,8 +484,8 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.takes_value(true)
.help(
"Address of the mint account that will receive tokens created at genesis. If \
the ledger already exists then this parameter is silently ignored \
[default: client keypair]",
the ledger already exists then this parameter is silently ignored [default: \
client keypair]",
),
)
.arg(
Expand Down Expand Up @@ -716,15 +716,15 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.parse::<f64>()
.map_err(|err| format!("error parsing '{value}': {err}"))
.and_then(|rate| match rate.partial_cmp(&0.0) {
Some(Ordering::Greater) | Some(Ordering::Equal) => Ok(()),
Some(Ordering::Less) | None => Err(String::from("value must be >= 0")),
Some(Ordering::Greater) | Some(Ordering::Equal) => Ok(()),
Some(Ordering::Less) | None => Err(String::from("value must be >= 0")),
})
})
.takes_value(true)
.allow_hyphen_values(true)
.help(
"Override default inflation with fixed rate. If the ledger already exists then \
this parameter is silently ignored",
"Override default inflation with fixed rate. If the ledger already exists \
then this parameter is silently ignored",
),
)
.arg(
Expand All @@ -749,7 +749,10 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.takes_value(true)
.validator(solana_net_utils::is_host)
.default_value("127.0.0.1")
.help("IP address to bind the validator ports [default: 127.0.0.1]. Can be repeated to specify multihoming options."),
.help(
"IP address to bind the validator ports [default: 127.0.0.1]. Can be repeated \
to specify multihoming options.",
),
)
.arg(
Arg::with_name("clone_account")
Expand All @@ -774,9 +777,9 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.multiple(true)
.requires("json_rpc_url")
.help(
"Copy an address lookup table and all accounts it references from the cluster referenced by the --url \
argument in the genesis configuration. If the ledger already exists then this \
parameter is silently ignored",
"Copy an address lookup table and all accounts it references from the cluster \
referenced by the --url argument in the genesis configuration. If the ledger \
already exists then this parameter is silently ignored",
),
)
.arg(
Expand Down Expand Up @@ -917,9 +920,9 @@ pub fn test_app<'a>(version: &'a str, default_args: &'a DefaultTestArgs) -> App<
.takes_value(false)
.requires("json_rpc_url")
.help(
"Copy a feature set from the cluster referenced by the --url \
argument in the genesis configuration. If the ledger \
already exists then this parameter is silently ignored",
"Copy a feature set from the cluster referenced by the --url argument in the \
genesis configuration. If the ledger already exists then this parameter is \
silently ignored",
),
)
}
Expand Down
6 changes: 4 additions & 2 deletions validator/src/commands/authorized_voter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ pub fn command<'a>() -> App<'a, 'a> {
.takes_value(true)
.validator(is_keypair)
.help(
"Path to keypair of the authorized voter to add [default: read JSON keypair from stdin]",
"Path to keypair of the authorized voter to add [default: read JSON \
keypair from stdin]",
),
)
.after_help(
"Note: the new authorized voter only applies to the currently running validator instance",
"Note: the new authorized voter only applies to the currently running \
validator instance",
),
)
.subcommand(
Expand Down
12 changes: 6 additions & 6 deletions validator/src/commands/exit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ pub fn command<'a>() -> App<'a, 'a> {
.long("force")
.takes_value(false)
.help(
"Request the validator exit immediately instead of waiting for a restart window",
"Request the validator exit immediately instead of waiting for a restart \
window",
),
)
.arg(
Expand All @@ -86,9 +87,7 @@ pub fn command<'a>() -> App<'a, 'a> {
.validator(is_parsable::<usize>)
.value_name("MINUTES")
.default_value(DEFAULT_MIN_IDLE_TIME)
.help(
"Minimum time that the validator should not be leader before restarting",
),
.help("Minimum time that the validator should not be leader before restarting"),
)
.arg(
Arg::with_name("max_delinquent_stake")
Expand Down Expand Up @@ -134,8 +133,9 @@ pub fn execute(matches: &ArgMatches, ledger_path: &Path) -> Result<()> {
// Since PostExitAction::Wait case is opt-in (via --wait-for-exit), the
// result is checked ONLY in that case to provide a friendlier upgrade
// path for users who are NOT using --wait-for-exit
const WAIT_FOR_EXIT_UNSUPPORTED_ERROR: &str =
"remote process exit cannot be waited on. `--wait-for-exit` is not supported by the remote process";
const WAIT_FOR_EXIT_UNSUPPORTED_ERROR: &str = "remote process exit cannot be waited on. \
`--wait-for-exit` is not supported by the \
remote process";
Comment thread
steviez marked this conversation as resolved.
let post_exit_action = exit_args.post_exit_action.clone();
let validator_pid = admin_rpc_service::runtime().block_on(async move {
let admin_client = admin_rpc_service::connect(ledger_path).await?;
Expand Down
6 changes: 4 additions & 2 deletions validator/src/commands/repair_whitelist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ pub fn command<'a>() -> App<'a, 'a> {
.help("Set the validator's repair protocol whitelist"),
)
.after_help(
"Note: repair protocol whitelist changes only apply to the currently running validator instance",
"Note: repair protocol whitelist changes only apply to the currently running \
validator instance",
),
)
.subcommand(
SubCommand::with_name("remove-all")
.about("Clear the validator's repair protocol whitelist")
.after_help(
Comment thread
steviez marked this conversation as resolved.
"Note: repair protocol whitelist changes only apply to the currently running validator instance",
"Note: repair protocol whitelist changes only apply to the currently running \
validator instance",
),
)
}
Expand Down
Loading
Loading