Browse Source

chore: remove deprecated gossip_host CLI argument (#9058)

* chore: remove deprecated gossip_host CLI argument

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>

* chore: remove deprecated --gossip-host CLI argument

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>

* chore: remove deprecated flag reference from help text

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>

---------

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
Avhi 4 days ago
parent
commit
4b58cb8afb

+ 2 - 17
gossip-bin/src/main.rs

@@ -6,7 +6,7 @@ use {
         crate_description, crate_name, value_t, value_t_or_exit, App, AppSettings, Arg, ArgMatches,
         crate_description, crate_name, value_t, value_t_or_exit, App, AppSettings, Arg, ArgMatches,
         SubCommand,
         SubCommand,
     },
     },
-    log::{error, info, warn},
+    log::{error, info},
     solana_clap_utils::{
     solana_clap_utils::{
         hidden_unless_forced,
         hidden_unless_forced,
         input_parsers::{keypair_of, pubkeys_of},
         input_parsers::{keypair_of, pubkeys_of},
@@ -37,19 +37,12 @@ fn parse_matches() -> ArgMatches<'static> {
         .validator(is_port)
         .validator(is_port)
         .help("Gossip port number for the node");
         .help("Gossip port number for the node");
 
 
-    let gossip_host_arg = clap::Arg::with_name("gossip_host")
-        .long("gossip-host")
-        .value_name("HOST")
-        .takes_value(true)
-        .validator(solana_net_utils::is_host)
-        .help("DEPRECATED: --gossip-host is no longer supported. Use --bind-address instead.");
-
     let bind_address_arg = clap::Arg::with_name("bind_address")
     let bind_address_arg = clap::Arg::with_name("bind_address")
         .long("bind-address")
         .long("bind-address")
         .value_name("HOST")
         .value_name("HOST")
         .takes_value(true)
         .takes_value(true)
         .validator(solana_net_utils::is_host)
         .validator(solana_net_utils::is_host)
-        .help("IP address to bind the node to for gossip (replaces --gossip-host)");
+        .help("IP address to bind the node to for gossip");
 
 
     App::new(crate_name!())
     App::new(crate_name!())
         .about(crate_description!())
         .about(crate_description!())
@@ -98,7 +91,6 @@ fn parse_matches() -> ArgMatches<'static> {
                 )
                 )
                 .arg(&shred_version_arg)
                 .arg(&shred_version_arg)
                 .arg(&gossip_port_arg)
                 .arg(&gossip_port_arg)
-                .arg(&gossip_host_arg)
                 .arg(&bind_address_arg)
                 .arg(&bind_address_arg)
                 .setting(AppSettings::DisableVersion),
                 .setting(AppSettings::DisableVersion),
         )
         )
@@ -153,7 +145,6 @@ fn parse_matches() -> ArgMatches<'static> {
                 )
                 )
                 .arg(&shred_version_arg)
                 .arg(&shred_version_arg)
                 .arg(&gossip_port_arg)
                 .arg(&gossip_port_arg)
-                .arg(&gossip_host_arg)
                 .arg(&bind_address_arg)
                 .arg(&bind_address_arg)
                 .arg(
                 .arg(
                     Arg::with_name("timeout")
                     Arg::with_name("timeout")
@@ -172,12 +163,6 @@ fn parse_bind_address(matches: &ArgMatches, entrypoint_addr: Option<SocketAddr>)
             eprintln!("failed to parse bind-address: {e}");
             eprintln!("failed to parse bind-address: {e}");
             exit(1);
             exit(1);
         })
         })
-    } else if let Some(gossip_host) = matches.value_of("gossip_host") {
-        warn!("--gossip-host is deprecated. Use --bind-address instead.");
-        solana_net_utils::parse_host(gossip_host).unwrap_or_else(|e| {
-            eprintln!("failed to parse gossip-host: {e}");
-            exit(1);
-        })
     } else if let Some(entrypoint_addr) = entrypoint_addr {
     } else if let Some(entrypoint_addr) = entrypoint_addr {
         solana_net_utils::get_public_ip_addr_with_binding(
         solana_net_utils::get_public_ip_addr_with_binding(
             &entrypoint_addr,
             &entrypoint_addr,

+ 1 - 10
validator/src/bin/solana-test-validator.rs

@@ -154,13 +154,6 @@ fn main() {
     let ticks_per_slot = value_t!(matches, "ticks_per_slot", u64).ok();
     let ticks_per_slot = value_t!(matches, "ticks_per_slot", u64).ok();
     let slots_per_epoch = value_t!(matches, "slots_per_epoch", Slot).ok();
     let slots_per_epoch = value_t!(matches, "slots_per_epoch", Slot).ok();
     let inflation_fixed = value_t!(matches, "inflation_fixed", f64).ok();
     let inflation_fixed = value_t!(matches, "inflation_fixed", f64).ok();
-    let gossip_host = matches.value_of("gossip_host").map(|gossip_host| {
-        warn!("--gossip-host is deprecated. Use --bind-address instead.");
-        solana_net_utils::parse_host(gossip_host).unwrap_or_else(|err| {
-            eprintln!("Failed to parse --gossip-host: {err}");
-            exit(1);
-        })
-    });
     let gossip_port = value_t!(matches, "gossip_port", u16).ok();
     let gossip_port = value_t!(matches, "gossip_port", u16).ok();
     let dynamic_port_range = matches.value_of("dynamic_port_range").map(|port_range| {
     let dynamic_port_range = matches.value_of("dynamic_port_range").map(|port_range| {
         solana_net_utils::parse_port_range(port_range).unwrap_or_else(|| {
         solana_net_utils::parse_port_range(port_range).unwrap_or_else(|| {
@@ -178,9 +171,7 @@ fn main() {
         exit(1);
         exit(1);
     });
     });
 
 
-    let advertised_ip = if let Some(ip) = gossip_host {
-        ip
-    } else if !bind_address.is_unspecified() && !bind_address.is_loopback() {
+    let advertised_ip = if !bind_address.is_unspecified() && !bind_address.is_loopback() {
         bind_address
         bind_address
     } else {
     } else {
         IpAddr::V4(Ipv4Addr::LOCALHOST)
         IpAddr::V4(Ipv4Addr::LOCALHOST)

+ 0 - 10
validator/src/cli.rs

@@ -136,16 +136,6 @@ fn deprecated_arguments() -> Vec<DeprecatedArg> {
             .help("Use CUDA"),
             .help("Use CUDA"),
         usage_warning: "CUDA support will be dropped"
         usage_warning: "CUDA support will be dropped"
     );
     );
-    add_arg!(
-        // deprecated in v3.0.0
-        Arg::with_name("gossip_host")
-            .long("gossip-host")
-            .value_name("HOST")
-            .takes_value(true)
-            .validator(solana_net_utils::is_host),
-            replaced_by : "bind-address",
-            usage_warning:"Use --bind-address instead",
-    );
     add_arg!(
     add_arg!(
         // deprecated in v3.1.0
         // deprecated in v3.1.0
         Arg::with_name("tpu_coalesce_ms")
         Arg::with_name("tpu_coalesce_ms")

+ 1 - 15
validator/src/commands/run/execute.rs

@@ -724,18 +724,6 @@ pub fn execute(
         },
         },
     );
     );
 
 
-    let gossip_host = matches
-        .value_of("gossip_host")
-        .map(|gossip_host| {
-            warn!(
-                "--gossip-host is deprecated. Use --bind-address or rely on automatic public IP \
-                 discovery instead."
-            );
-            solana_net_utils::parse_host(gossip_host)
-                .map_err(|err| format!("failed to parse --gossip-host: {err}"))
-        })
-        .transpose()?;
-
     let advertised_ip = matches
     let advertised_ip = matches
         .value_of("advertised_ip")
         .value_of("advertised_ip")
         .map(|advertised_ip| {
         .map(|advertised_ip| {
@@ -744,9 +732,7 @@ pub fn execute(
         })
         })
         .transpose()?;
         .transpose()?;
 
 
-    let advertised_ip = if let Some(ip) = gossip_host {
-        ip
-    } else if let Some(cli_ip) = advertised_ip {
+    let advertised_ip = if let Some(cli_ip) = advertised_ip {
         cli_ip
         cli_ip
     } else if !bind_addresses.active().is_unspecified() && !bind_addresses.active().is_loopback() {
     } else if !bind_addresses.active().is_unspecified() && !bind_addresses.active().is_loopback() {
         bind_addresses.active()
         bind_addresses.active()