Skip to content

Commit

Permalink
feat: add default exclude dial (#6607)
Browse files Browse the repository at this point in the history
Description
---
Added default exclude dial

Motivation and Context
---
Too many dials to test addresses

How Has This Been Tested?
---
To be evaluated in testnet

What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
hansieodendaal authored Oct 7, 2024
1 parent 27ffefa commit 332068f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
9 changes: 1 addition & 8 deletions base_layer/wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,7 @@ where
target: LOG_TARGET,
"Transaction sending mechanism is {}", config.transaction_service_config.transaction_routing_mechanism
);
trace!(
target: LOG_TARGET,
"Wallet config: {:?}, {:?}, {:?}, buffer_size: {}",
config.base_node_service_config,
config.output_manager_service_config,
config.transaction_service_config,
config.buffer_size,
);
trace!(target: LOG_TARGET, "Wallet config: {:?}", config);
let stack = StackBuilder::new(shutdown_signal)
.add_initializer(P2pInitializer::new(
config.p2p.clone(),
Expand Down
2 changes: 1 addition & 1 deletion common/config/presets/c_base_node_c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,4 @@ database_url = "data/base_node/dht.db"
# `excluded_dial_addresses = ["/ip4/127.*.0:49.*/tcp/*", "/ip4/127.*.101:255.*/tcp/*"]`
# or
# `excluded_dial_addresses = ["/ip4/127.0:0.1/tcp/122", "/ip4/127.0:0.1/tcp/1000:2000"]`
#excluded_dial_addresses = []
excluded_dial_addresses = ["/ip4/127.*.*.*/tcp/*"]
2 changes: 1 addition & 1 deletion common/config/presets/d_console_wallet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,4 @@ network_discovery.initial_peer_sync_delay = 25
# `excluded_dial_addresses = ["/ip4/127.*.0:49.*/tcp/*", "/ip4/127.*.101:255.*/tcp/*"]`
# or
# `excluded_dial_addresses = ["/ip4/127.0:0.1/tcp/122", "/ip4/127.0:0.1/tcp/1000:2000"]`
#excluded_dial_addresses = []
excluded_dial_addresses = ["/ip4/127.*.*.*/tcp/*"]
12 changes: 3 additions & 9 deletions comms/dht/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::{path::Path, str::FromStr, time::Duration};
use std::{path::Path, time::Duration};

use serde::{Deserialize, Serialize};
use tari_common::configuration::serializers;
use tari_comms::{
net_address::{MultiaddrRange, MultiaddrRangeList, IP4_TCP_TEST_ADDR_RANGE},
peer_validator::PeerValidatorConfig,
};
use tari_comms::{net_address::MultiaddrRangeList, peer_validator::PeerValidatorConfig};

use crate::{
actor::OffenceSeverity,
Expand Down Expand Up @@ -202,10 +199,7 @@ impl Default for DhtConfig {
max_permitted_peer_claims: 5,
offline_peer_cooldown: Duration::from_secs(24 * 60 * 60),
peer_validator_config: Default::default(),
excluded_dial_addresses: vec![
MultiaddrRange::from_str(IP4_TCP_TEST_ADDR_RANGE).expect("should not fail static string")
]
.into(),
excluded_dial_addresses: vec![].into(),
}
}
}
Expand Down

0 comments on commit 332068f

Please sign in to comment.