-
Notifications
You must be signed in to change notification settings - Fork 12
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(code): Do not cancel prevote/precommit timeout when threshold is reached #208
Conversation
…reached Otherwise we dont move to next round when the threshold was for `Nil`.
code/actors/src/consensus.rs
Outdated
// TODO - check on this. For L47 (PrecommitAny) the spec says: | ||
// upon 2f + 1 (PRECOMMIT, hp, roundp, *) for the first time do | ||
// schedule OnTimeoutPrecommit(hp , roundp) to be executed after timeoutPrecommit(roundp) | ||
// If we cancel the timeout we will not move to next round | ||
state.timers.cast(TimersMsg::CancelTimeout(timeout))?; | ||
// | ||
// info!("Threshold met for {threshold:?} at round {round}, cancelling {timeout}"); | ||
// state.timers.cast(TimersMsg::CancelTimeout(timeout))?; |
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.
Shall we remove this whole block of commented out code altogether?
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, let's remove. we should do a code walkthrough later to make sure we don't leave timers running that can cause issues.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #208 +/- ##
==========================================
- Coverage 83.83% 83.71% -0.12%
==========================================
Files 67 67
Lines 4779 4757 -22
==========================================
- Hits 4006 3982 -24
- Misses 773 775 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -330,57 +327,22 @@ where | |||
} | |||
} | |||
|
|||
let check_threshold = if let DriverInput::Vote(vote) = &input { |
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 always felt like this was a big hack when I added it, so I am glad we can actually likely remove it altogether.
f9c7d0f
to
e99dcea
Compare
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! 👍
Otherwise we dont move to next round when the threshold was for
Nil
.