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: fix trimming issue #507

Merged
merged 3 commits into from
May 10, 2022
Merged

core/qbft: fix trimming issue #507

merged 3 commits into from
May 10, 2022

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented May 10, 2022

Fixes buffer trimming issue:

  • There is only a few uses for Justification messages:
    • a) Check if a received PRE-PREPARE is justified (only use justifications of that single message)
    • b) Check if a received ROUND-CHANGE is justified (only use justifications of that single message)
    • c) Generate justification of a quorum ROUND-CHANGEs (select from all buffered messages and their justifications)
  • We only need previously received justifications for (c), and we can get that by flattening the buffer.
  • Since we do not add old justifications to the buffer anymore
  • We can trim all old messages again.

Also make code a bit more explicit and readable.
Also ensure that send-to-self in the test is always first and never drops or jitters.

category: bug
ticket: #445

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #507 (7435c25) into main (051b60c) will decrease coverage by 0.17%.
The diff coverage is 44.11%.

@@            Coverage Diff             @@
##             main     #507      +/-   ##
==========================================
- Coverage   56.44%   56.26%   -0.18%     
==========================================
  Files          87       87              
  Lines        7989     8001      +12     
==========================================
- Hits         4509     4502       -7     
- Misses       2883     2898      +15     
- Partials      597      601       +4     
Impacted Files Coverage Δ
core/qbft/qbft.go 65.53% <44.11%> (-2.97%) ⬇️
app/app.go 63.31% <0.00%> (-0.89%) ⬇️

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 051b60c...7435c25. Read the comment docs.

// Get all RoundChange messages with round (rj) higher than current round (ri)
frc, ok := getFPlus1RoundChanges(d, msgs, round)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need to filter again, the input is already Frc

Copy link
Contributor

@xenowits xenowits left a comment

Choose a reason for hiding this comment

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

LGTM!

@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 2558bb0 into main May 10, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/qbfttrim branch May 10, 2022 09:39
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.

None yet

3 participants