-
-
Notifications
You must be signed in to change notification settings - Fork 9
perf(keyring-eth-hd): store computed account address #373
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
Conversation
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.
Pull Request Overview
This PR optimizes the HD keyring by pre-computing and storing Ethereum account addresses alongside HD keys to avoid repeated address calculations during account operations.
- Store computed addresses in a new
WalletDatastructure containing both HDKey and address - Eliminate redundant address computations in
getAccounts(),removeAccount(), and#getWalletForAccount() - Simplify address lookups by using pre-stored values instead of deriving from public keys
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ccharly
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.
LGTM! I'll wait for @mikesposito review too.
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions (from the Expand for full list of packages and versions. |
mikesposito
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.
Great find, LGTM!
Store the computed account address together with the HD node. This should prevent the need to recompute the address when listing accounts or finding an account by its address.