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

feat: improve universe comms #6533

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
6 changes: 3 additions & 3 deletions base_layer/p2p/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ pub struct TorTransportConfig {
/// When these peer addresses are encountered when dialing another peer, the tor proxy is bypassed and the
/// connection is made directly over TCP. /ip4, /ip6, /dns, /dns4 and /dns6 are supported.
pub proxy_bypass_addresses: Vec<Multiaddr>,
/// When set to true, outbound TCP connections bypass the tor proxy. Defaults to false for better privacy, setting
/// to true may improve network performance for TCP nodes.
/// When set to true, outbound TCP connections bypass the tor proxy. Defaults to 'true' for better network
/// performance for TCP nodes; set it to 'false' for better privacy.
pub proxy_bypass_for_outbound_tcp: bool,
/// If set, instructs tor to forward traffic the provided address. Otherwise, an OS-assigned port on 127.0.0.1
/// is used.
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Default for TorTransportConfig {
control_auth: TorControlAuthentication::Auto,
onion_port: NonZeroU16::new(18141).unwrap(),
proxy_bypass_addresses: vec![],
proxy_bypass_for_outbound_tcp: false,
proxy_bypass_for_outbound_tcp: true,
forward_address: None,
listener_address_override: None,
identity: None,
Expand Down
6 changes: 3 additions & 3 deletions common/config/presets/c_base_node_c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ listener_self_liveness_check_interval = 15
# When these peer addresses are encountered when dialing another peer, the tor proxy is bypassed and the connection is
# made directly over TCP. /ip4, /ip6, /dns, /dns4 and /dns6 are supported. (e.g. ["/dns4/my-foo-base-node/tcp/9998"])
#tor.proxy_bypass_addresses = []
# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to false for
# better privacy
#tor.proxy_bypass_for_outbound_tcp = false
# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to 'true' for
# better network performance for TCP nodes; set it to 'false' for better privacy.
#tor.proxy_bypass_for_outbound_tcp = true
# If set, instructs tor to forward traffic the provided address. (e.g. "/dns4/my-base-node/tcp/32123") (default = OS-assigned port)
#tor.forward_address =
# If set, the listener will bind to this address instead of the forward_address. You need to make sure that this listener is connectable from the forward_address.
Expand Down
6 changes: 3 additions & 3 deletions common/config/presets/d_console_wallet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ event_channel_size = 3500
# When these peer addresses are encountered when dialing another peer, the tor proxy is bypassed and the connection is
# made directly over TCP. /ip4, /ip6, /dns, /dns4 and /dns6 are supported. (e.g. ["/dns4/my-foo-base-node/tcp/9998"])
#tor.proxy_bypass_addresses = []
# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to false for
# better privacy
#tor.proxy_bypass_for_outbound_tcp = false
# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to 'true' for
# better network performance for TCP nodes; set it to 'false' for better privacy.
#tor.proxy_bypass_for_outbound_tcp = true
# If set, instructs tor to forward traffic the provided address. (e.g. "/ip4/127.0.0.1/tcp/0") (default = )
#tor.forward_address =

Expand Down
13 changes: 12 additions & 1 deletion comms/core/src/connection_manager/dialer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,18 @@ where
DialState,
Result<(NoiseSocket<TTransport::Output>, Multiaddr), ConnectionManagerError>,
) {
let addresses = dial_state.peer().addresses.clone().into_vec();
let addresses = dial_state
.peer()
.addresses
.clone()
.into_vec()
.iter()
.filter(|&a| {
a == &"/memory/0".parse::<Multiaddr>().expect("will not fail") || // Used for tests, allowed
a != &ConnectionManagerConfig::default().listener_address // Not allowed to dial the default
})
.cloned()
.collect::<Vec<_>>();
if addresses.is_empty() {
let node_id_hex = dial_state.peer().node_id.clone().to_hex();
trace!(
Expand Down
Loading