-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: migrate from sqlite to VSS (WIP) #57
Conversation
Left a couple minor comments :) Also, do we actually need to do this in the builder?.. Maybe we could expose a separate FFI function, implemented in a separate module even, that would copy data from one |
@rdmitr I can't see the comments (maybe you need to finish the review?)
I don't think moving this into a separate tool is good because there's more chance the user runs it while their alby hub is running, which risks corrupting the migration, and this increases friction when ideally we want users to migrate as soon as possible. If people have to go through multiple steps and download extra software to do this, I think things will go wrong and less people will do it. I think this also might be used more, as users will need to migrate once they update their subscription, or if they cancel their subscription. Also, this is an imperfect migration. To properly migrate from VSS back to sqlite we would need to clear the all the VSS data, which I think is not possible right now (This needs a change upstream in rust-lightning to be able to list all keys across all namespaces to be able to clear them). I would prefer to wait for LDK to implement this and officially implement migrations before we support migrating back from VSS to Sqlite. For me the priority here is to enable a one way upgrade from Sqlite to VSS. @bumi do you have any thoughts? |
as discussed I think moving it in a separate module sounds good to me. (I always like moving things out :D ) |
On the hub side, I would update the Alby Account page to allow the user to manually enable VSS (currently a one-way upgrade), which would save user configs (
LdkVssEnabled=true
andLdkMigrateStorage="VSS"
) and shut down the node, and then ask them to login. When they login, the user config entry will be checked, removed, and the migration to VSS will occur, usingbuilder.MigrateStorage(ldk_node.MigrateStorageVss)
. (in the same way we have methods to reset some node state right now)How it works:
There could be some edge cases to consider (e.g. if there are pending channel monitor updates we should not proceed with the migration), and some TODOs to address.
LDK-nodes original migration script is below, but not all the keys are needed, and I'm not sure it's 100% correct.