Skip to content
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

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

romac
Copy link
Member

@romac romac commented Jun 4, 2024

Otherwise we dont move to next round when the threshold was for Nil.

…reached

Otherwise we dont move to next round when the threshold was for `Nil`.
@romac romac requested a review from ancazamfir June 4, 2024 14:17
Comment on lines 375 to 381
// 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))?;
Copy link
Member Author

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?

Copy link
Collaborator

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.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.71%. Comparing base (2ae7f78) to head (e99dcea).

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     
Flag Coverage Δ
integration 83.71% <100.00%> (-0.12%) ⬇️
mbt 17.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -330,57 +327,22 @@ where
}
}

let check_threshold = if let DriverInput::Vote(vote) = &input {
Copy link
Member Author

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.

@romac romac force-pushed the romac/fix-threshold-timeout-cancel branch from f9c7d0f to e99dcea Compare June 4, 2024 14:34
Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 👍

@ancazamfir ancazamfir merged commit 9bdb9f0 into main Jun 5, 2024
12 checks passed
@ancazamfir ancazamfir deleted the romac/fix-threshold-timeout-cancel branch June 5, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants