-
Notifications
You must be signed in to change notification settings - Fork 106
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
refactor(storage/participants): change key structure, add cleanup job #1845
base: stage
Are you sure you want to change the base?
Conversation
d1b4b08
to
e3d2042
Compare
@anatolie-ssv i made a few small refactors, can you please review? |
Co-authored-by: moshe-blox <89339422+moshe-blox@users.noreply.github.com>
098bc41
to
a89011d
Compare
qbftstorage "github.com/ssvlabs/ssv/protocol/v2/qbft/storage" | ||
"github.com/ssvlabs/ssv/storage/basedb" | ||
) | ||
|
||
const ( | ||
highestInstanceKey = "highest_instance" | ||
instanceKey = "instance" | ||
participantsKey = "participants" | ||
participantsKey = "pt" |
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 change isn't backward compatible, it means we have to do one of the following:
- need to do migration
- resync the db
- search by the old key if the search is from older slot
or we just leave the old key as is.
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.
yes, there's a migration I just haven't committed it because I wanted to finish testing of the main functionalities without dropping old keys, will add it at a later point.
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 guess we can't do a migration since the db is too big, so we need to instruct whoever updates on how to deal with it (reset the db).
prefix: []byte{role}, | ||
oldPrefix: prefix.String(), |
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.
the change in prefix has the same meaning as I mentioned above for the database key change.
Co-authored-by: moshe-blox <89339422+moshe-blox@users.noreply.github.com>
Replace
convert.RunnerRole
with BeaconRole from spectypes.convert
packageCloses: #1810