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
Change slasher DB structure to mirror beacon-chains #4848
Change slasher DB structure to mirror beacon-chains #4848
Conversation
slasher/db/iface/interface.go
Outdated
) | ||
|
||
// SlasherDB defines the necessary methods for a Prysm slasher DB. | ||
type SlasherDB interface { |
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.
Would be good to separate this to read only and read + write
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.
+1 , define different interfaces for different access patterns
@@ -0,0 +1,54 @@ | |||
package types |
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.
Why is types under /slasher/db
, do you think it should be under /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.
Should I move all types in there then? Types like Service, Config, Server?
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.
These types are highly specific only to the db, I think we should just leave them as a subpackage under slasher/db/types
@terencechain
Codecov Report
@@ Coverage Diff @@
## master #4848 +/- ##
=========================================
Coverage ? 24.52%
=========================================
Files ? 168
Lines ? 11749
Branches ? 0
=========================================
Hits ? 2881
Misses ? 8373
Partials ? 495 |
@@ -0,0 +1,54 @@ | |||
package types |
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.
These types are highly specific only to the db, I think we should just leave them as a subpackage under slasher/db/types
@terencechain
* Add interface and move slashing types to /types package * WIP restructure to match beacon chain DB * Fix build * Fix comment * Fix comments * fix comments for sure * Use wrapper function for evict * Remove unused * Update slasher/db/kv/kv.go * Update slasher/db/testing/BUILD.bazel * Update slasher/db/types/BUILD.bazel * Update slasher/db/types/types.go Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Add interface and move slashing types to /types package * WIP restructure to match beacon chain DB * Fix build * Fix comment * Fix comments * fix comments for sure * Use wrapper function for evict * Remove unused * Update slasher/db/kv/kv.go * Update slasher/db/testing/BUILD.bazel * Update slasher/db/types/BUILD.bazel * Update slasher/db/types/types.go Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This PR changes the DB structure of the slasher to mirror the beacon chains DB, including a
kv
,testing
, andiface
package.No functionality changes.