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
Cleanup slasher codebase #4698
Cleanup slasher codebase #4698
Conversation
…cleanup-slasher
…cleanup-slasher
Codecov Report
@@ Coverage Diff @@
## master #4698 +/- ##
=========================================
Coverage ? 12.26%
=========================================
Files ? 77
Lines ? 6260
Branches ? 0
=========================================
Hits ? 768
Misses ? 5360
Partials ? 132 |
…o cleanup-slasher
…cleanup-slasher
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.
Just two comments
var status SlashingStatus | ||
var found bool | ||
key := encodeTypeRoot(SlashingType(Attestation), root) | ||
root, err := hashutil.HashProto(slashing) |
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 isnt really a root, just a hash - maybe rename?
slasher/service/data_update.go
Outdated
@@ -14,7 +14,7 @@ import ( | |||
"google.golang.org/grpc/status" | |||
) | |||
|
|||
// finalisedChangeUpdater this is a stub for the comming PRs #3133 | |||
// finalisedChangeUpdater this is a stub for the coming PRs #3133 |
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.
finalized*
slasher/db/min_max_span.go
Outdated
@@ -15,28 +15,28 @@ var highestValidatorIdx uint64 | |||
func saveToDB(validatorIdx uint64, _ uint64, value interface{}, cost int64) { | |||
log.Tracef("evicting span map for validator id: %d", validatorIdx) | |||
|
|||
err := d.batch(func(tx *bolt.Tx) error { | |||
err := d.update(func(tx *bolt.Tx) 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.
this method might be called from many go routines maybe its better to keep it batch
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.
had one comment. thanks
…cleanup-slasher
…o cleanup-slasher
* First wave of changes * More changes * More renames, changes * Fix errors * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Fix errors, more cleaning * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Merge branch 'master' into cleanup-slasher * fix err * Merge branch 'cleanup-slasher' of https://github.com/0xKiwi/Prysm into cleanup-slasher * Fix strings * More cleanup * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Fix interface * Fix * Merge branch 'master' into cleanup-slasher * Merge branch 'master' into cleanup-slasher * Merge branch 'master' into cleanup-slasher * Address comments * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Merge branch 'cleanup-slasher' of https://github.com/0xKiwi/Prysm into cleanup-slasher
* First wave of changes * More changes * More renames, changes * Fix errors * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Fix errors, more cleaning * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Merge branch 'master' into cleanup-slasher * fix err * Merge branch 'cleanup-slasher' of https://github.com/0xKiwi/Prysm into cleanup-slasher * Fix strings * More cleanup * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Fix interface * Fix * Merge branch 'master' into cleanup-slasher * Merge branch 'master' into cleanup-slasher * Merge branch 'master' into cleanup-slasher * Address comments * Merge branch 'master' of https://github.com/prysmaticlabs/Prysm into cleanup-slasher * Merge branch 'cleanup-slasher' of https://github.com/0xKiwi/Prysm into cleanup-slasher
This PR is me going through the slasher client and cleaning up/improving whatever I find. Includes function renames, improvements to the codebase and readability improvements.