-
Notifications
You must be signed in to change notification settings - Fork 677
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
Miner changes for time-based tenure extends #5493
Miner changes for time-based tenure extends #5493
Conversation
With this change, the signer will accept a tenure extend from miner N-1 when miner N wins a sortition but commits to the wrong parent tenure.
The previous design using a global singleton causes trouble in testing, when we have multiple miners running in different threads of the same process.
This is useful when checking the behavior during forking.
`SignerDBListener` struct is for a new thread that is always processing StackerDB messages from the signers during a mining tenure. `SignerCoordinator` is the interface that the miner uses with the `SignerDBListener`, to propose a block and wait for signatures.
Should the |
Oh, right. It's signer messages in the stacker db. I guess the signerdb is another thing. Oops. Thanks! |
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.
My biggest feedback here is that the code mixes a lot of low-level thread synchronization code into the business logic, which I think is something we should strive to avoid. The synchronization logic may change down the road depending on what other threads need to interact with signature-gathering, so we should do what we do elsewhere and wrap all of the thread synchronization / state-sharing behind a "Comms" struct, and provide methods there that better reflect the business logic's needs.
Note to reviewers - there is an integration test for this behavior in #5471. |
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.
Mainly requesting changes about not reloading the reward_set when we don't need to. Otherwise, looks great! Nice refactor and smartly implemented.
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.
Noice! LGTM but CI test cache is failing.
Will reapprove once addressed.
Fixed. I previously failed to commit one of the changes for one of those refactorings. |
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.
LGTM!
061da00
into
feat/time-based-tenure-extend
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See #5468
This currently also includes #5452, since it has changes that would conflict. Once that is merged into
develop
, I will mergedevelop
intofeat/time-based-tenure-extend
and then clean this branch up.