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

Multi srp mvp #5112

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Multi srp mvp #5112

wants to merge 7 commits into from

Conversation

PatrykLucka
Copy link

Explanation

References

Changelog

@metamask/package-a

  • : Your change here
  • : Your change here

@metamask/package-b

  • : Your change here
  • : Your change here

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@PatrykLucka PatrykLucka self-assigned this Jan 8, 2025
@PatrykLucka
Copy link
Author

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-e96ca40c",
  "@metamask-previews/address-book-controller": "6.0.2-preview-e96ca40c",
  "@metamask-previews/announcement-controller": "7.0.2-preview-e96ca40c",
  "@metamask-previews/approval-controller": "7.1.1-preview-e96ca40c",
  "@metamask-previews/assets-controllers": "45.1.2-preview-e96ca40c",
  "@metamask-previews/base-controller": "7.0.2-preview-e96ca40c",
  "@metamask-previews/build-utils": "3.0.2-preview-e96ca40c",
  "@metamask-previews/chain-controller": "0.2.2-preview-e96ca40c",
  "@metamask-previews/composable-controller": "10.0.0-preview-e96ca40c",
  "@metamask-previews/controller-utils": "11.4.4-preview-e96ca40c",
  "@metamask-previews/ens-controller": "15.0.1-preview-e96ca40c",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-e96ca40c",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-e96ca40c",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-e96ca40c",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-e96ca40c",
  "@metamask-previews/keyring-controller": "19.0.2-preview-e96ca40c",
  "@metamask-previews/logging-controller": "6.0.3-preview-e96ca40c",
  "@metamask-previews/message-manager": "11.0.3-preview-e96ca40c",
  "@metamask-previews/multichain": "1.1.2-preview-e96ca40c",
  "@metamask-previews/name-controller": "8.0.2-preview-e96ca40c",
  "@metamask-previews/network-controller": "22.1.1-preview-e96ca40c",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-e96ca40c",
  "@metamask-previews/permission-controller": "11.0.4-preview-e96ca40c",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-e96ca40c",
  "@metamask-previews/phishing-controller": "12.3.1-preview-e96ca40c",
  "@metamask-previews/polling-controller": "12.0.2-preview-e96ca40c",
  "@metamask-previews/preferences-controller": "15.0.1-preview-e96ca40c",
  "@metamask-previews/profile-sync-controller": "3.1.1-preview-e96ca40c",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-e96ca40c",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-e96ca40c",
  "@metamask-previews/remote-feature-flag-controller": "1.2.0-preview-e96ca40c",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-e96ca40c",
  "@metamask-previews/signature-controller": "23.1.0-preview-e96ca40c",
  "@metamask-previews/transaction-controller": "42.0.0-preview-e96ca40c",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-e96ca40c"
}

PatrykLucka and others added 6 commits January 13, 2025 14:00
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
The `KeyringController.verifySeedPhrase` method was not included in the
mutable methods that lock the controller mutex because it doesn't change
the state. Though, if another operation gets somehow overlapped (e.g. a
consumer calls `addNewAccount`), the call to `verifySeedPhrase` can
potentially fail.

To fix this, this PR is moving verifySeedPhrase behind
KeyringController's mutex. Since `addNewAccount` internally calls
`verifySeedPhrase`, and having a lock on both would create a deadlock,
the `verifySeedPhrase` implementation has been moved to an internal
method.

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

- **FIXED**:  `verifySeedPhrase` is now mutually exclusive

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Copy link

socket-security bot commented Jan 13, 2025

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

Package New capabilities Transitives Size Publisher
npm/[email protected] None 0 23 kB alizain

View full report↗︎

@PatrykLucka
Copy link
Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "20.0.2-preview-407f96d",
  "@metamask-previews/address-book-controller": "6.0.2-preview-407f96d",
  "@metamask-previews/announcement-controller": "7.0.2-preview-407f96d",
  "@metamask-previews/approval-controller": "7.1.1-preview-407f96d",
  "@metamask-previews/assets-controllers": "45.1.2-preview-407f96d",
  "@metamask-previews/base-controller": "7.1.0-preview-407f96d",
  "@metamask-previews/build-utils": "3.0.2-preview-407f96d",
  "@metamask-previews/chain-controller": "0.2.2-preview-407f96d",
  "@metamask-previews/composable-controller": "10.0.0-preview-407f96d",
  "@metamask-previews/controller-utils": "11.4.4-preview-407f96d",
  "@metamask-previews/ens-controller": "15.0.1-preview-407f96d",
  "@metamask-previews/eth-json-rpc-provider": "4.1.7-preview-407f96d",
  "@metamask-previews/gas-fee-controller": "22.0.2-preview-407f96d",
  "@metamask-previews/json-rpc-engine": "10.0.2-preview-407f96d",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.6-preview-407f96d",
  "@metamask-previews/keyring-controller": "19.0.2-preview-407f96d",
  "@metamask-previews/logging-controller": "6.0.3-preview-407f96d",
  "@metamask-previews/message-manager": "11.0.3-preview-407f96d",
  "@metamask-previews/multichain": "2.0.0-preview-407f96d",
  "@metamask-previews/name-controller": "8.0.2-preview-407f96d",
  "@metamask-previews/network-controller": "22.1.1-preview-407f96d",
  "@metamask-previews/notification-services-controller": "0.15.0-preview-407f96d",
  "@metamask-previews/permission-controller": "11.0.4-preview-407f96d",
  "@metamask-previews/permission-log-controller": "3.0.2-preview-407f96d",
  "@metamask-previews/phishing-controller": "12.3.1-preview-407f96d",
  "@metamask-previews/polling-controller": "12.0.2-preview-407f96d",
  "@metamask-previews/preferences-controller": "15.0.1-preview-407f96d",
  "@metamask-previews/profile-sync-controller": "3.3.0-preview-407f96d",
  "@metamask-previews/queued-request-controller": "8.0.2-preview-407f96d",
  "@metamask-previews/rate-limit-controller": "6.0.2-preview-407f96d",
  "@metamask-previews/remote-feature-flag-controller": "1.3.0-preview-407f96d",
  "@metamask-previews/selected-network-controller": "20.0.2-preview-407f96d",
  "@metamask-previews/signature-controller": "23.2.0-preview-407f96d",
  "@metamask-previews/transaction-controller": "42.1.0-preview-407f96d",
  "@metamask-previews/user-operation-controller": "21.0.0-preview-407f96d"
}

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.

2 participants