Skip to content

Commit a2dcd4c

Browse files
authored
Merge pull request #5305 from stacks-network/fix/nakamoto-downloader-at-reward-cycle-boundary
Fix/nakamoto downloader at reward cycle boundary
2 parents 4bceb29 + 2011946 commit a2dcd4c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,12 @@ impl TenureStartEnd {
325325
wt_start.winning_block_id.clone(),
326326
wt_end.winning_block_id.clone(),
327327
rc,
328-
downloader_block_height_to_reward_cycle(
329-
pox_constants,
330-
first_burn_height,
331-
wt_start.burn_height,
332-
)
333-
.expect(&format!(
334-
"FATAL: tenure from before system start ({} <= {})",
335-
wt_start.burn_height, first_burn_height
336-
)),
328+
pox_constants
329+
.block_height_to_reward_cycle(first_burn_height, wt_start.burn_height)
330+
.expect(&format!(
331+
"FATAL: tenure from before system start ({} <= {})",
332+
wt_start.burn_height, first_burn_height
333+
)),
337334
wt.processed,
338335
);
339336
tenure_start_end.fetch_end_block = true;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ impl NakamotoTenureDownloaderSet {
407407
continue;
408408
};
409409

410+
info!("Download tenure {}", &ch;
411+
"tenure_start_block" => %tenure_info.start_block_id,
412+
"tenure_end_block" => %tenure_info.end_block_id,
413+
"tenure_start_reward_cycle" => tenure_info.start_reward_cycle,
414+
"tenure_end_reward_cycle" => tenure_info.end_reward_cycle);
415+
410416
debug!(
411417
"Download tenure {} (start={}, end={}) (rc {},{})",
412418
&ch,

stackslib/src/net/inv/nakamoto.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ impl NakamotoTenureInv {
679679
}
680680
StacksMessageType::Nack(nack_data) => {
681681
info!("{:?}: remote peer NACKed our GetNakamotoInv", network.get_local_peer();
682+
"remote_peer" => %self.neighbor_address,
682683
"error_code" => nack_data.error_code);
683684

684685
if nack_data.error_code != NackErrorCodes::NoSuchBurnchainBlock {

0 commit comments

Comments
 (0)