-
Notifications
You must be signed in to change notification settings - Fork 678
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
Fix: correct burn view for miner block broadcast #5515
base: develop
Are you sure you want to change the base?
Conversation
|
…tenure nor extend the ongoing tenure, and fail-out of continue_tenure
…cks-core into fix/burn-view
Signed-off-by: Jacinta Ferrant <[email protected]>
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.
Just a few questions.
… cleanup even if it works
…cks-core into fix/burn-view
…ew-fix-burn-checks
…ew-fix-burn-checks
…checks Fix: explicit burnchain checks in miner thread
match Self::can_continue_tenure( | ||
&self.sortdb, | ||
&mut self.chainstate, | ||
sn.consensus_hash, | ||
mining_pkh_opt, | ||
) { |
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.
Does can_continue_tenure
need to be invoked here? After the recent changes to this PR, can_continue_tenure
checks if there's a sortition in the most recent snapshot, and if there is, it returns None
. I think this can just be replaced with return Some(MinerDirective::StopTenure)
-- everything else is functionally dead code.
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.
Yes, I can remove this and just stop the tenure.
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 this was a bad suggestion -- can_continue_tenure
does return Ok(Some(..))
here in the event that the next tenure is a reorg, which is the correct behavior (and its roughly how the miner works in develop already). That's why miner_forking
and tenure_extend_after_bad_commit
started failing.
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.
This LGTM, will approve once merge conflicts are resolved and tests pass (which I think they should already).
/// We would do this if we were the miner of the ongoing tenure, but did not win the last | ||
/// sortition, and the winning miner never produced a block. | ||
/// Try to start up a tenure-extend. | ||
/// Only do this if the miner won the last-ever sortition but the burn view has changed. |
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.
Should this say "the last valid sortition"?
This fixes the burn view calculation for the Nakamoto miner when accepting and broadcasting a block.
It builds atop #5508, so don't bother merging until #5508 is in
develop
.