-
Notifications
You must be signed in to change notification settings - Fork 179
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
Khalil/6743 Slashing Violations Consumer ALSP misbehavior report integration #4512
Conversation
…lashing-violations-consumer-alsp
Codecov Report
@@ Coverage Diff @@
## master #4512 +/- ##
==========================================
- Coverage 56.25% 51.94% -4.31%
==========================================
Files 653 636 -17
Lines 64699 59330 -5369
==========================================
- Hits 36396 30819 -5577
- Misses 25362 26055 +693
+ Partials 2941 2456 -485
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…b.com:onflow/flow-go into khalil/6743-slashing-violations-consumer-alsp
network/slashing/consumer.go
Outdated
if err != nil { | ||
c.log.Fatal(). | ||
Err(err). | ||
Bool(logging.KeySuspicious, true). |
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 isn't really suspicious since any error is from a misconfigured argument passed in.
looking at the code, this isn't actually possible here as the code is written, but it could be in the future. Can you add a comment about how this failure would occur?
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.
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.
🚀
cmd/scaffold.go
Outdated
@@ -502,6 +499,7 @@ func (fnb *FlowNodeBuilder) InitFlowNetworkWithConduitFactory( | |||
} | |||
|
|||
fnb.Network = net | |||
fnb.MisbehaviorReportConsumer = net |
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.
fnb.MisbehaviorReportConsumer = net | |
Please remove fnb.MisbehaviorReportConsumer
as it is unused.
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.
cmd/node_builder.go
Outdated
@@ -224,6 +224,9 @@ type NodeConfig struct { | |||
// UnicastRateLimiterDistributor notifies consumers when a peer's unicast message is rate limited. | |||
UnicastRateLimiterDistributor p2p.UnicastRateLimiterDistributor | |||
|
|||
// MisbehaviorReportConsumer consumers used to disseminate misbehavior reports to the ALSP misbehavior report manager. | |||
MisbehaviorReportConsumer network.MisbehaviorReportConsumer |
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.
MisbehaviorReportConsumer network.MisbehaviorReportConsumer |
Please eliminate this field; given the recent modifications, it is now obsolete. Moreover, it is imperative to avoid exposing internal attributes of networking components through the builder.
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.
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
…lashing-violations-consumer-alsp
This PR integrates the ALSP misbehavior reporter into the slashing violations consumer. The slashing violations consumer will now not only log a potentially slashable offense but also report the misbehavior using the misbehavior reporter. Currently, all slashing violations use the default score penalty and all slashable offenses have now been moved to the ALSP package and included with the list of misbehaviors. This PR also upgrades all authorization and topic validator tests that utilize the slashing violations consumer, now these tests incorporate a mock misbehavior report consumer and ensure a misbehavior report is disseminated or not as expected.