Skip to content

Commit 6324422

Browse files
committed
chore: expose walk_seed_probability and log_neighbors_freq connection opts
1 parent b721cf6 commit 6324422

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testnet/stacks-node/src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ lazy_static! {
558558
max_http_clients: 1000, // maximum number of HTTP connections
559559
max_neighbors_of_neighbor: 10, // maximum number of neighbors we'll handshake with when doing a neighbor walk (I/O for this can be expensive, so keep small-ish)
560560
walk_interval: 60, // how often, in seconds, we do a neighbor walk
561+
walk_seed_probability: 0.1, // 10% of the time when not in IBD, walk to a non-seed node even if we aren't connected to a seed node
562+
log_neighbors_freq: 60_000, // every minute, log all peer connections
561563
inv_sync_interval: 45, // how often, in seconds, we refresh block inventories
562564
inv_reward_cycles: 3, // how many reward cycles to look back on, for mainnet
563565
download_interval: 10, // how often, in seconds, we do a block download scan (should be less than inv_sync_interval)
@@ -2424,6 +2426,8 @@ pub struct ConnectionOptionsFile {
24242426
pub soft_max_clients_per_host: Option<u64>,
24252427
pub max_sockets: Option<u64>,
24262428
pub walk_interval: Option<u64>,
2429+
pub walk_seed_probability: Option<f64>,
2430+
pub log_neighbors_freq: Option<u64>,
24272431
pub dns_timeout: Option<u64>,
24282432
pub max_inflight_blocks: Option<u64>,
24292433
pub max_inflight_attachments: Option<u64>,
@@ -2528,6 +2532,12 @@ impl ConnectionOptionsFile {
25282532
walk_interval: self
25292533
.walk_interval
25302534
.unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.walk_interval.clone()),
2535+
walk_seed_probability: self
2536+
.walk_seed_probability
2537+
.unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.walk_seed_probability),
2538+
log_neighbors_freq: self
2539+
.log_neighbors_freq
2540+
.unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.log_neighbors_freq),
25312541
dns_timeout: self
25322542
.dns_timeout
25332543
.map(|dns_timeout| dns_timeout as u128)

0 commit comments

Comments
 (0)