-
Notifications
You must be signed in to change notification settings - Fork 631
[DEVOPS-1250] backport RCD-47 fix about 'hasSpendingPassword' metadata with extra sanity check #4112
[DEVOPS-1250] backport RCD-47 fix about 'hasSpendingPassword' metadata with extra sanity check #4112
Conversation
784b416
to
434eae1
Compare
…a with extra sanity check Since a few users have already ran the migration, they might have migrated wallet with incorrect metadata, wrongly stating that their wallet has no spending password, and as a consequence, preventing them from doing anything with their wallet. So, we do now run an extra sanity check upon every start to make sure that the wallet acid state metadata matches what we find in the keystore.
434eae1
to
af431e8
Compare
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.
LGTM, pending QA.
forM_ wKeys $ \esk -> do | ||
let hasSpendingPassword = case checkPassMatches mempty esk of | ||
Nothing -> HD.HasSpendingPassword lastUpdateNow | ||
Just _ -> HD.NoSpendingPassword |
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.
Yep, ok. So the Just
case is when the password does match the empty password, hence NoSpendingPassword
.
(_, Left e) -> | ||
return $ Left e | ||
(HD.HasSpendingPassword _, Right root) | root ^. HD.hdRootHasPassword == HD.NoSpendingPassword -> | ||
action rootId hasSpendingPassword |
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.
Yep, logic seems right here too.
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.
It's not entirely necessary but I thought it would be a good idea to only make updates to the DB when necessary.
bors r+ |
4112: [DEVOPS-1250] backport RCD-47 fix about 'hasSpendingPassword' metadata with extra sanity check r=disassembler a=KtorZ ## Description <!--- A brief description of this PR and the problem is trying to solve --> Since a few users have already ran the migration, they might have migrated wallet with incorrect metadata, wrongly stating that their wallet has no spending password, and as a consequence, preventing them from doing anything with their wallet. So, we do now run an extra sanity check upon every start to make sure that the wallet acid state metadata matches what we find in the keystore. ## Linked issue <!--- Put here the relevant issue from YouTrack --> [[DEVOPS-150]](https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-1250) Co-authored-by: KtorZ <[email protected]> Co-authored-by: Samuel Leathers <[email protected]>
Build succeeded |
Description
Since a few users have already ran the migration, they might have migrated wallet with incorrect metadata, wrongly stating that
their wallet has no spending password, and as a consequence, preventing them from doing anything with their wallet. So, we do now
run an extra sanity check upon every start to make sure that the wallet acid state metadata matches what we find in the keystore.
Linked issue
[DEVOPS-150]
Type of change
Developer checklist
Testing checklist
QA Steps
Creating Wallets on 1.3.x
Migrating wallet (without patch) from 1.3.x --> 3.0.x
Logs
Wallet State
Restarting (with patch) an already migrated wallet (without patch) from 1.3.x --> 3.0.x
Logs
Wallet State
Migrating wallet (with patch) from 1.3.x --> 3.0.x
Logs
Wallet State
Screenshots (if available)
How to merge
Send the message
bors r+
to merge this PR. For more information, seedocs/how-to/bors.md
.