Skip to content

Commit

Permalink
network-libp2p: Remove autonat_allow_non_global_ips config option
Browse files Browse the repository at this point in the history
The AutoNAT V2 behaviour no longer has this config option
  • Loading branch information
Eligioo authored and jsdanielh committed Oct 10, 2024
1 parent 7b2bfd2 commit c4443d1
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion lib/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ impl ClientInner {
required_services,
tls_config,
config.network.desired_peer_count,
config.network.autonat_allow_non_global_ips,
config.network.only_secure_ws_connections,
config.network.allow_loopback_addresses,
config
Expand Down
5 changes: 0 additions & 5 deletions lib/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ pub struct NetworkConfig {
#[builder(default = "12")]
pub desired_peer_count: usize,

/// Optional setting to allow network autonat to use non global IPs
#[builder(default)]
pub autonat_allow_non_global_ips: bool,

/// Optional bool to only accept secure websocket connections
#[builder(default)]
pub only_secure_ws_connections: bool,
Expand Down Expand Up @@ -758,7 +754,6 @@ impl ClientConfigBuilder {
desired_peer_count: config_file.network.desired_peer_count,

tls: config_file.network.tls.as_ref().map(|s| s.clone().into()),
autonat_allow_non_global_ips: config_file.network.autonat_allow_non_global_ips,
only_secure_ws_connections: false,
allow_loopback_addresses: config_file.network.allow_loopback_addresses,
dht_quorum: config_file.network.dht_quorum,
Expand Down
4 changes: 0 additions & 4 deletions lib/src/config/config_file/client.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ seed_nodes = [
# Default: Generated from version, operating system and processor architecture
#user_agent = "core-rs-albatross/0.1.0 (native; linux x86_64)"

# If the network should allow the autonat feature to use non-global IPs.
# Default: false
#autonat_allow_non_global_ips = false

# If the node should try to connect to loopback addresses, which are usually not reachable
# from the public internet. This setting is useful for testing inside a local (Docker) network.
# Default: false
Expand Down
2 changes: 0 additions & 2 deletions lib/src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ pub struct NetworkSettings {
#[serde(default = "NetworkSettings::default_desired_peer_count")]
pub desired_peer_count: usize,
#[serde(default)]
pub autonat_allow_non_global_ips: bool,
#[serde(default)]
pub allow_loopback_addresses: bool,
#[serde(default)]
pub dht_quorum: Option<NonZeroU8>,
Expand Down
3 changes: 0 additions & 3 deletions network-libp2p/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub struct Config {
pub required_services: Services,
pub tls: Option<TlsConfig>,
pub desired_peer_count: usize,
pub autonat_allow_non_global_ips: bool,
pub only_secure_ws_connections: bool,
pub allow_loopback_addresses: bool,
pub dht_quorum: NonZeroU8,
Expand All @@ -47,7 +46,6 @@ impl Config {
required_services: Services,
tls_settings: Option<TlsConfig>,
desired_peer_count: usize,
autonat_allow_non_global_ips: bool,
only_secure_ws_connections: bool,
allow_loopback_addresses: bool,
dht_quorum: NonZeroU8,
Expand Down Expand Up @@ -96,7 +94,6 @@ impl Config {
required_services,
tls: tls_settings,
desired_peer_count,
autonat_allow_non_global_ips,
only_secure_ws_connections,
allow_loopback_addresses,
dht_quorum,
Expand Down
1 change: 0 additions & 1 deletion network-libp2p/tests/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fn network_config(address: Multiaddr) -> Config {
required_services: Services::all(),
tls: None,
desired_peer_count: 3,
autonat_allow_non_global_ips: true,
only_secure_ws_connections: false,
allow_loopback_addresses: true,
dht_quorum: NonZeroU8::new(1).unwrap(),
Expand Down
1 change: 0 additions & 1 deletion network-libp2p/tests/request_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ fn network_config(address: Multiaddr) -> Config {
required_services: Services::all(),
tls: None,
desired_peer_count: 3,
autonat_allow_non_global_ips: true,
only_secure_ws_connections: false,
allow_loopback_addresses: true,
dht_quorum: NonZeroU8::new(1).unwrap(),
Expand Down
1 change: 0 additions & 1 deletion scripts/devnet/templates/node_conf.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ seed_nodes = [
]

{% endif %}
autonat_allow_non_global_ips = true
desired_peer_count = {{ min_peers }}

[consensus]
Expand Down
1 change: 0 additions & 1 deletion test-utils/src/test_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl TestNetwork for Network {
Services::all(),
None,
3,
true,
false,
true,
NonZeroU8::new(1).unwrap(),
Expand Down

0 comments on commit c4443d1

Please sign in to comment.