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

perf!: Use mnemonic seed for state persistence key derivation #3217

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Mar 12, 2025

Bump key-tree to the latest version which includes a bunch of performance improvements. One of these performance improvements is the ability to use .fromSeed. This PR adds functionality to derive the keys used for state encryption using the mnemonic seed instead of the mnemonic phrase. This should save us more than half of the compute time required for deriving keys used for state persistence.

This PR does not yet tackle getEntropy or getBipEntropy methods, these will be supported in a follow-up.

Closes #3218

Breaking changes

  • SnapController now expects a getMnemonicSeed hook that must return the BIP39 seed for the user's primary mnemonic.

Copy link

socket-security bot commented Mar 12, 2025

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@noble/[email protected]

View full report↗︎

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.94%. Comparing base (61853b0) to head (56637c4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3217   +/-   ##
=======================================
  Coverage   94.93%   94.94%           
=======================================
  Files         507      507           
  Lines       11185    11195   +10     
  Branches     1722     1723    +1     
=======================================
+ Hits        10619    10629   +10     
  Misses        566      566           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding marked this pull request as ready for review March 12, 2025 10:32
@FrederikBolding FrederikBolding requested a review from a team as a code owner March 12, 2025 10:32
@FrederikBolding FrederikBolding requested a review from Mrtenz March 12, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use mnemonic seed for state persistence key derivation
1 participant