-
-
Notifications
You must be signed in to change notification settings - Fork 261
feat: reduce KDF computing cost on clients #6097
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
base: main
Are you sure you want to change the base?
Conversation
|
@metamaskbot publish-preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
mirceanis
left a comment
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.
Looks good!
Perhaps we can rephrase the changelog to reenforce the reason for this change.
Since this PR deals with encryption "soft" migration I'd take the opportunity to make sure that future "hard" migrations fail gracefully, meaning that clients don't fail entire operations if one of the entries does not decrypt. See lines like if (encryptedData.v === '1').... else throw.
WDYT @mathieuartu ?
mirceanis
left a comment
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.
looks good
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
159efb2 to
ffa6d7a
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
Going back to draft again as it seems to be working fine now but may have introduced a UI bug on mobile when adding or renaming accounts. Investigating. |
Explanation
Nscryptparameter used to compute the encryption key in order to significantly increase performance on clients.The tests below have been done measuring 30 consecutive clean onboardings and the time it took to encrypt or decrypt the first entry (before caching the key from the KDF)
References
Fixes:
Test drive client PRs:
Changelog
Checklist
Note
Lowers scrypt N and introduces a new shared salt with auto-migration, adds encrypt/decrypt callbacks, updates caching/derivation logic, and refreshes tests and changelog.
SCRYPT_N_V2 = 2) and introduceSHARED_SALT_V2.doesEntryNeedReEncryptionand auto-migrate entries encrypted with old salt or oldN.onEncrypt/onDecrypt) and fire them with payload metadata.sha2import.getItem,getAllFeatureItems,setItem,batchSetItems.EncryptedPayload), constants/plumbing adjustments.config.encryption.onEncrypt/onDecryptand forward to SDK in all storage operations.N/salt, and caching behavior; update CHANGELOG under Unreleased.Written by Cursor Bugbot for commit b5439f2. This will update automatically on new commits. Configure here.