-
Notifications
You must be signed in to change notification settings - Fork 204
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
Pseudo slashing fixes #4630
Pseudo slashing fixes #4630
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/optimise-consensus-sigcheck #4630 +/- ##
===================================================================
Coverage ? 71.23%
===================================================================
Files ? 664
Lines ? 86296
Branches ? 0
===================================================================
Hits ? 61474
Misses ? 20305
Partials ? 4517 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -302,39 +302,28 @@ func (sr *subroundEndRound) doEndRoundJobByLeader() bool { | |||
sig, err := sr.SignatureHandler().AggregateSigs(bitmap, sr.Header.GetEpoch()) |
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.
I think you can extract L301-L328 in a separate method which will return bitmap, sig and err, actually you can directly return from there sr.handleInvalidSignersOnAggSigFail(), and make the code easier to read there without so much if else levels. Here you should have only something like this:
bitmap, sig, err := sr.aggregateSigsAndHandleInvalidSigners(bitmap)
if err != nil {
log.Debug("doEndRoundJobByLeader.aggregateSigsAndHandleInvalidSigners", "error", err.Error())
return false
}
func (sr *subroundEndRound) handleInvalidSignersOnAggSigFail() ([]byte, []byte, error) { | ||
invalidPubKeys, err := sr.verifyNodesOnAggSigFail() | ||
if err != nil { | ||
log.Debug("doEndRoundJobByLeader.verifyNodesOnAggSigVerificationFail", "error", err.Error()) |
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.
.verifyNodesOnAggSigFail
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.
no additional comments
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?