-
Notifications
You must be signed in to change notification settings - Fork 95
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
Fix: Use Share PublicKey for Share Removal #1140
Conversation
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.
Code looks good 💪
Unrelated to this fix, I think there's another bug: RemoveShare
is called from a task and not from event handler. This means that it's not part of the DB transaction and task failures are ignored (whereas event handling failures are retried).
I think we should fix it in this PR because this would make the primary fix testable in TestHandleBlockEventsStream
(which doesn't run tasks) by adding a check on the SP data in the already existing test that removes a validator.
Wdyt? @y0sher @olegshmuelov
I strongly agree that any code that plays with database should be as part of the tx in |
Concern: Migration for Existing SharesWhile this PR fixes the issue of shares and SP data being incorrectly removed by the validator's public key, it's worth noting that there may be existing shares in the ETH Key Manager storage that were not properly deleted due to this bug. I recommend considering the creation of a migration script that scans for and deletes these improperly removed shares, particularly those that were not deleted by the |
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.
@olegshmuelov I agree about the migration point, though I think even without the migration there is no hard of having old shares in your DB. so we should make it a point to release the new version with this migration but it dosen't have to be a part of this task. I can create a task for it.
@moshe-blox wdyt?
Problem
Previously, shares were being removed based on the validator's public key, which was incorrect.
Solution
This fix introduces the proper way to delete a share by using the share's public key instead of the validator's public key. This ensures that the correct share is removed from the EKM (ETH Key Manager) storage.
UPD: based on @moshe-blox comment
added a logic that interact with database to be as part of the tx in eventhandler.