-
Notifications
You must be signed in to change notification settings - Fork 13
Avoid loading round state for dropped messages #300
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
gpbft/gpbft.go
Outdated
| roundsReceived := map[uint64]struct{}{} | ||
| for _, msg := range msgs { | ||
| if err := i.receiveOne(msg); err != nil { | ||
| if _, err := i.receiveOne(msg); err != nil { |
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.
This path is reached only once per instance, so I don't think it's worth the check here. But I can accumulate a stateChanged here too if requested.
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.
We're limited to maxLookaheadRounds * powerLookback anyways (except for justified messages). So I'd say this is fine.
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.
Although... it should be trivial to just not add this round to roundsReceived, right?
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.
Yes,done
| if !state.prepared.ReceivedFromWeakQuorum() { | ||
| return nil, nil, false | ||
| } |
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.
Moved this cheaper and harder-to-meet check to happen first
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
==========================================
- Coverage 85.66% 85.33% -0.34%
==========================================
Files 14 14
Lines 1458 1459 +1
==========================================
- Hits 1249 1245 -4
- Misses 130 136 +6
+ Partials 79 78 -1
|
gpbft/gpbft.go
Outdated
| roundsReceived := map[uint64]struct{}{} | ||
| for _, msg := range msgs { | ||
| if err := i.receiveOne(msg); err != nil { | ||
| if _, err := i.receiveOne(msg); err != nil { |
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.
We're limited to maxLookaheadRounds * powerLookback anyways (except for justified messages). So I'd say this is fine.
gpbft/gpbft.go
Outdated
| roundsReceived := map[uint64]struct{}{} | ||
| for _, msg := range msgs { | ||
| if err := i.receiveOne(msg); err != nil { | ||
| if _, err := i.receiveOne(msg); err != nil { |
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.
Although... it should be trivial to just not add this round to roundsReceived, right?
9c8bf3f to
a61c437
Compare
a61c437 to
f01fae6
Compare
Closes #208