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

core/qbft: add drop tests and fix bugs #504

Merged
merged 1 commit into from
May 10, 2022
Merged

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented May 9, 2022

Add the 10% dropped message test, which found some bugs:

  • Condition J2 doesn't require quorum identical preparedValue, only a single RC with that value (confirmed this with GoQuorum quorum/consensus/istanbul/qbft/core/justification.go:79).
  • Typo on line 652.
  • Trimming older rounds removes required PREPARE message. Disable for now.
  • Adds a fail fast if quorum round changes are not justified.

category: bug
ticket: #445
feature_set: alpha

@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #504 (485fcb3) into main (1921e77) will increase coverage by 0.02%.
The diff coverage is 86.36%.

@@            Coverage Diff             @@
##             main     #504      +/-   ##
==========================================
+ Coverage   56.47%   56.49%   +0.02%     
==========================================
  Files          87       87              
  Lines        7983     7989       +6     
==========================================
+ Hits         4508     4513       +5     
- Misses       2874     2878       +4     
+ Partials      601      598       -3     
Impacted Files Coverage Δ
core/qbft/qbft.go 69.50% <86.36%> (-0.56%) ⬇️
app/app.go 64.20% <0.00%> (+0.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1921e77...485fcb3. Read the comment docs.

Copy link
Contributor

@OisinKyne OisinKyne left a comment

Choose a reason for hiding this comment

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

I like the spacing changes to align everything 😅

Comment on lines +202 to +217
// TODO(corver): Fix trimming.
// var selected []Msg[I, V]
// for _, msg := range buffer {
// if msg.Round() >= round-1 {
// selected = append(selected, msg)
// }
// }
// buffer = selected
//
// dedup := make(map[dedupKey]bool)
// for k := range dedupIn {
// if k.Round >= round {
// dedup[k] = true
// }
// }
// dedupIn = dedup
Copy link
Contributor

Choose a reason for hiding this comment

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

what is wrong with this approach? I assume there would be cases where we would need message of rounds before round-1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We sometimes loose some PREPAREs from previous rounds, then we cannot trigger UnponQuorumRoundChange singe Qrc isn't justified. I have a plan to fix this in PR.

Base automatically changed from corver/qbftformula to main May 10, 2022 06:53
@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 10, 2022
@obol-bulldozer obol-bulldozer bot merged commit 051b60c into main May 10, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/droptests branch May 10, 2022 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants