-
Notifications
You must be signed in to change notification settings - Fork 175
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
[BFT] Reporting basic consensus protocol violations #4174
Conversation
…d structuring of consensus related consumers. Fixed tests and dependant code
…ages. Integrated BaseProtocolViolationConsumer in compliance engine of consensus follower
…thub.com/onflow/flow-go into yurii/4125-reporting-protocol-violations
Codecov Report
@@ Coverage Diff @@
## master #4174 +/- ##
==========================================
- Coverage 53.87% 53.84% -0.03%
==========================================
Files 869 869
Lines 80465 80453 -12
==========================================
- Hits 43349 43321 -28
- Misses 33704 33723 +19
+ Partials 3412 3409 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Jordan Schalm <jordan@dapperlabs.com>
…/4125-reporting-protocol-violations
… specific events. Updated relevant code
…w-go into alex/4174-suggestions
Suggestions for PR 4174
…g of InvalidProposalError
…/4125-reporting-protocol-violations
state protocol.FollowerState, | ||
follower module.HotStuffFollower, | ||
validator hotstuff.Validator, | ||
sync module.BlockRequester, | ||
tracer module.Tracer, | ||
) (*ComplianceCore, error) { | ||
onEquivocation := func(block, otherBlock *flow.Block) { | ||
finalizationConsumer.OnDoubleProposeDetected(model.BlockFromFlow(block.Header), model.BlockFromFlow(otherBlock.Header)) | ||
followerConsumer.OnDoubleProposeDetected(model.BlockFromFlow(block.Header), model.BlockFromFlow(otherBlock.Header)) |
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.
Thank you, I would appreciate the revision 🙇
The cache here is already very specific to the follower. We can always generalize it should want to use the cache somewhere else ... honestly though, I think the chances of us using the cache elsewhere is reasonably low in my opinion. Therefore, I think specificity to improve the code's clarity is in my opinion the way to go.
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 is an amazing refactoring. It improves modularity and code clarity in sooo many ways. Thank you for your hard work with multiple iterations.
I think it woudl be great to include the two suggestions above still in this PR, as they are tiny changes:
- rename
NoopPartialConsumer
as proposed in my comment above - extend the declaration of interfaces implemented by the
SlashingViolationsConsumer
as proposed in my comment above
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
…/4125-reporting-protocol-violations
bors merge |
4350: [BFT] Reporting compliance engine protocol violations r=durkmurder a=durkmurder ### Context This is a follow-up PR which addresses outstanding comments in [previous](#4174) PR. In compliance engine I have removed usage of `engine.InvalidInputError` since I wanted to consolidate slashing evidence reporting in one place(which works with `model.InvalidProposalError`) and `engine.InvalidInputError` was just adding another level of wrapping without real benefit. I've decided to replace it with `model.InvalidProposalError` which simplified error handling. Reference comments: [1](#4174 (comment)), [2](#4174 (comment)), [3](#4174 (comment)) Co-authored-by: Yurii Oleksyshyn <yuraolex@gmail.com> Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Context
In order to address reporting of protocol violations this PR refactors existing code and introduces new interface for reporting basic consensus protocol violations that can and have to be detected by all node types.
As part of this PR:
FollowerConsumer
which combines separate interfaces usable by consensus follower(FinalizationConsumer
andBaseProtocolViolationConsumer
).