Skip to content
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

Add keyUID to table when migrating from v1 to v2 #20046

Open
cammellos opened this issue May 15, 2024 · 0 comments · May be fixed by #20151
Open

Add keyUID to table when migrating from v1 to v2 #20046

cammellos opened this issue May 15, 2024 · 0 comments · May be fixed by #20151

Comments

@cammellos
Copy link
Member

When migrating from v1 to v2, there's a field that is not being computed for the accounts table:

https://github.com/status-im/status-go/blob/c9ee0e04c25d9079bf8a4b9617ad10df6d33fff8/appdatabase/migrations/sql/1683627613_accounts_and_keycards_improvements.up.sql#L8

This CHECK constrainst fails from account of the app v1, since key_uid is blank.

To overcome this we need a migration outside our normal migration system to calculate keyUID:

	keyUID := sha256.Sum256(crypto.FromECDSAPub(&a.privateKey.PublicKey))

If that can be done at the SQL layer, better, but not sure it's feasible/possible. It would have to be a migration outside our normal migration process.

I can provide some databases for the old version and there's already some tests running them, ping me for the setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment