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
Verify Slashing Signatures Before Putting Into Blocks #5071
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5071 +/- ##
==========================================
- Coverage 44.79% 43.52% -1.28%
==========================================
Files 216 215 -1
Lines 16811 16749 -62
==========================================
- Hits 7531 7290 -241
- Misses 7982 8195 +213
+ Partials 1298 1264 -34 |
"errors" | ||
"fmt" | ||
"sort" | ||
|
||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" | ||
"go.opencensus.io/trace" | ||
|
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.
Please remove space
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.
Maybe we should move verify to the rpc endpoint?
defer span.End() | ||
|
||
if err := blocks.VerifyProposerSlashing(state, slashing); err != nil { | ||
numPendingAttesterSlashingFailedSigVerify.Inc() |
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.
Good call with the metrics
No tracking issue.
Description
Write why you are making the changes in this pull request
Currently, our slashing pool does not verify signatures, causing some bad slashings to be attempted to put into blocks, causing issues. Bad slashings are not cleared from pool today.
Write a summary of the changes you are making
This PR ensures we verify the attester/proposer slashing before giving it to a proposer. If it fails for any reason, we clear it from the pool.
Link anything that would be helpful or relevant to the reviewers
This PR fixes old tests and adds regression tests.