-
Notifications
You must be signed in to change notification settings - Fork 693
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
Only consider target_block_height when relevant #2780
Changes from all commits
7d7479b
e9f01fd
b510e02
f67eaeb
7ceec25
56c776d
d520e83
5a4a392
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1209,16 +1209,25 @@ impl Burnchain { | |
|
||
debug!( | ||
"Sync'ed headers from {} to {}. DB at {}", | ||
start_block, end_block, db_height | ||
sync_height, end_block, db_height | ||
); | ||
|
||
if let Some(target_block_height) = target_block_height_opt { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, there's no test? How was this change tested and why do we know it is an improvement? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, no, unfortunately there's no test. The code coverage for this routine is pretty bad because this function is doing way too many things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Can you just summarize this in the PR description? |
||
if target_block_height < end_block { | ||
// `target_block_height` is used as a hint, but could also be completely off | ||
// in certain situations. This function is directly reading the | ||
// headers and syncing with the bitcoin-node, and the interval of blocks | ||
// to download computed here should be considered as our source of truth. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the comment on line 1144 need to change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. This function is still returning a burnchain tip, at least as high as target_block_height_opt if given. |
||
if target_block_height > start_block && target_block_height < end_block { | ||
debug!( | ||
"Will download up to max burn block height {}", | ||
target_block_height | ||
); | ||
end_block = target_block_height; | ||
} else { | ||
debug!( | ||
"Ignoring target block height {} considered as irrelevant", | ||
target_block_height | ||
); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the debug statement above should be
Could you fix this as part of this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with latest