Skip to content
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

networking: Disable private IPs by default. #1732

Merged
merged 1 commit into from
Aug 1, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(super) fn configure_dsn(
bootstrap_nodes,
piece_cache_size,
provided_keys_limit,
disable_private_ips,
enable_private_ips,
reserved_peers,
in_connections,
out_connections,
Expand Down Expand Up @@ -145,7 +145,7 @@ pub(super) fn configure_dsn(
let config = Config {
reserved_peers,
listen_on,
allow_non_global_addresses_in_dht: !disable_private_ips,
allow_non_global_addresses_in_dht: enable_private_ips,
networking_parameters_registry: Some(networking_parameters_registry),
request_response_protocols: vec![
PieceByHashRequestHandler::create(
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-farmer/src/bin/subspace-farmer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct DsnArgs {
provided_keys_limit: NonZeroUsize,
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in Kademlia DHT.
#[arg(long, default_value_t = false)]
disable_private_ips: bool,
enable_private_ips: bool,
/// Multiaddrs of reserved nodes to maintain a connection to, multiple are supported
#[arg(long)]
reserved_peers: Vec<Multiaddr>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum Command {
pending_out_peers: u32,
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in Kademlia DHT.
#[arg(long, default_value_t = false)]
disable_private_ips: bool,
enable_private_ips: bool,
/// Defines path for the provider record storage DB (optional).
#[arg(long, value_hint = ValueHint::FilePath)]
db_path: Option<PathBuf>,
Expand Down Expand Up @@ -122,7 +122,7 @@ async fn main() -> anyhow::Result<()> {
out_peers,
pending_in_peers,
pending_out_peers,
disable_private_ips,
enable_private_ips,
db_path,
piece_providers_cache_size,
protocol_version,
Expand Down Expand Up @@ -168,7 +168,7 @@ async fn main() -> anyhow::Result<()> {
let config = Config {
networking_parameters_registry,
listen_on,
allow_non_global_addresses_in_dht: !disable_private_ips,
allow_non_global_addresses_in_dht: enable_private_ips,
reserved_peers,
max_established_incoming_connections: in_peers,
max_established_outgoing_connections: out_peers,
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-node/src/bin/subspace-node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ fn main() -> Result<(), Error> {
listen_on: cli.dsn_listen_on,
bootstrap_nodes: dsn_bootstrap_nodes,
reserved_peers: cli.dsn_reserved_peers,
allow_non_global_addresses_in_dht: !cli.dsn_disable_private_ips,
allow_non_global_addresses_in_dht: cli.dsn_enable_private_ips,
max_in_connections: cli.dsn_in_connections,
max_out_connections: cli.dsn_out_connections,
max_pending_in_connections: cli.dsn_pending_in_connections,
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub struct Cli {
/// Determines whether we allow keeping non-global (private, shared, loopback..) addresses
/// in Kademlia DHT for the DSN.
#[arg(long, default_value_t = false)]
pub dsn_disable_private_ips: bool,
pub dsn_enable_private_ips: bool,

/// Enables DSN-sync on startup.
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
Expand Down