Skip to content

Commit 18be1fe

Browse files
committed
chore: address PR feedback
1 parent 30292cb commit 18be1fe

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

stackslib/src/net/download/nakamoto/tenure_downloader_set.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl From<&mut NakamotoTenureDownloader> for CompletedTenure {
9494
}
9595
}
9696

97-
pub const PEER_DEPRIORITIZATION_TIME: u64 = 60;
97+
pub const PEER_DEPRIORITIZATION_TIME_SECS: u64 = 60;
9898

9999
/// A set of confirmed downloader state machines assigned to one or more neighbors. The block
100100
/// downloader runs tenure-downloaders in parallel, since the downloader for the N+1'st tenure
@@ -152,7 +152,7 @@ impl NakamotoTenureDownloaderSet {
152152
) {
153153
deprioritized_peers.insert(
154154
peer.clone(),
155-
get_epoch_time_secs() + PEER_DEPRIORITIZATION_TIME,
155+
get_epoch_time_secs() + PEER_DEPRIORITIZATION_TIME_SECS,
156156
);
157157
}
158158

@@ -482,20 +482,11 @@ impl NakamotoTenureDownloaderSet {
482482
continue;
483483
};
484484

485-
let attempt_count = if let Some(attempt_count) = self.attempted_tenures.get(&ch) {
486-
*attempt_count
487-
} else {
488-
0
489-
};
485+
let attempt_count = *self.attempted_tenures.get(&ch).unwrap_or(&0);
490486
self.attempted_tenures
491487
.insert(ch.clone(), attempt_count.saturating_add(1));
492488

493-
let attempt_failed_count =
494-
if let Some(attempt_failed_count) = self.attempt_failed_tenures.get(&ch) {
495-
*attempt_failed_count
496-
} else {
497-
0
498-
};
489+
let attempt_failed_count = *self.attempt_failed_tenures.get(&ch).unwrap_or(&0);
499490

500491
info!("Download tenure {}", &ch;
501492
"peer" => %naddr,
@@ -511,15 +502,6 @@ impl NakamotoTenureDownloaderSet {
511502
"tenure_end_reward_cycle" => tenure_info.end_reward_cycle,
512503
"tenure_burn_height" => tenure_info.tenure_id_burn_block_height);
513504

514-
debug!(
515-
"Download tenure {} (start={}, end={}) (rc {},{}) burn_height {}",
516-
&ch,
517-
&tenure_info.start_block_id,
518-
&tenure_info.end_block_id,
519-
tenure_info.start_reward_cycle,
520-
tenure_info.end_reward_cycle,
521-
tenure_info.tenure_id_burn_block_height,
522-
);
523505
let tenure_download = NakamotoTenureDownloader::new(
524506
ch.clone(),
525507
tenure_info.start_block_id.clone(),

testnet/stacks-node/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ impl Default for NodeConfig {
19401940
max_microblocks: u16::MAX as u64,
19411941
wait_time_for_microblocks: 30_000,
19421942
wait_time_for_blocks: 30_000,
1943-
next_initiative_delay: 1_000,
1943+
next_initiative_delay: 10_000,
19441944
prometheus_bind: None,
19451945
marf_cache_strategy: None,
19461946
marf_defer_hashing: true,

testnet/stacks-node/src/nakamoto_node/relayer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,6 @@ impl RelayerThread {
12081208
};
12091209

12101210
let directive = if let Some(directive) = initiative_directive.take() {
1211-
debug!("Relayer: initiative from directive");
12121211
directive
12131212
} else {
12141213
// channel was drained, so do a time-bound recv
@@ -1217,7 +1216,6 @@ impl RelayerThread {
12171216
)) {
12181217
Ok(directive) => {
12191218
// only do this once, so we can call .initiative() again
1220-
debug!("Relayer: initiative from recv_timeout");
12211219
directive
12221220
}
12231221
Err(RecvTimeoutError::Timeout) => {

0 commit comments

Comments
 (0)