-
Notifications
You must be signed in to change notification settings - Fork 709
Bugfix/cleanup outdated signers #4513
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dream-team-fixes #4513 +/- ##
====================================================
+ Coverage 83.23% 83.25% +0.02%
====================================================
Files 452 452
Lines 326113 326170 +57
Branches 323 323
====================================================
+ Hits 271436 271560 +124
+ Misses 54669 54602 -67
Partials 8 8
... and 20 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Signed-off-by: Jacinta Ferrant <[email protected]>
Signed-off-by: Jacinta Ferrant <[email protected]>
6dd744d
to
59f2377
Compare
stacks-signer/src/runloop.rs
Outdated
debug!("{signer}: Signer's tenure has completed."); | ||
// We don't really need this state, but it's useful for debugging | ||
signer.state = SignerState::TenureCompleted; | ||
to_delete.push(signer.reward_cycle % 2); |
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'm still going through this logic to understand what's happening, but my current question is how do we ensure that the signer for say cycle N-2 does not cause the signer for cycle N to get deleted?
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.
Yeah it seems a little strange that this HashMap is indexed by whether the reward cycle is even or odd. I get that we only care about either last/current, or current/next cycles. But it seems like there should be a cleaner way to do this.
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.
Looking at this again, I see why you're doing this. Really I'd like to just do the following before the loop, but then we don't get a log for each one.
// Filter out signers for cycles which have now passed.
self.stacks_signers
.retain(|_, signer| signer.reward_cycle >= current_reward_cycle);
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 just pushed a commit to make it a little more clear.
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. |
Signers need to remove outdated reward cycle signer states from their map