Skip to content

feat(profile-sync-controller): use KeyringController to resolve entropySourceIds instead of @metamask/message-signing-snap - #9794

Open
mathieuartu wants to merge 5 commits into
mainfrom
feat/use-keyring-for-entropy-sources
Open

feat(profile-sync-controller): use KeyringController to resolve entropySourceIds instead of @metamask/message-signing-snap#9794
mathieuartu wants to merge 5 commits into
mainfrom
feat/use-keyring-for-entropy-sources

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Explanation

From CHANGELOG:

### Changed

- Resolve HD entropy source IDs from `KeyringController` instead of the message-signing snap (`getBearerToken` primary ID, `performSignIn` SRP enumeration). New shared helpers live in `shared/utils/entropy-source.ts` (also used by `UserStorageController`).

References

Related to: https://consensyssoftware.atlassian.net/browse/MUL-2057
Extension test-drive PR: MetaMask/metamask-extension#45250

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 communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes how primary and multi-SRP IDs are resolved in the sign-in and token paths; incorrect keyring ordering or empty keyrings could mis-tag logins or fail auth, though behavior is intended to mirror the prior snap enumeration.

Overview
Authentication and user storage now derive HD entropy source IDs from KeyringController keyring metadata instead of the message-signing snap’s getAllPublicKeys, so paths like getBearerToken() and performSignIn SRP enumeration are not blocked on snap boot.

Shared helpers in shared/utils/entropy-source.ts (getHdKeyringEntropySourceIds, getPrimaryHdKeyringEntropySourceId) centralize that logic; UserStorageController adopts them in place of inline filtering. AuthenticationController drops snap getAllPublicKeys, the cached primary-ID field, and the createSnapAllPublicKeysRequest helper—snap remains for getPublicKey / signMessage during login. Primary/canonical resolution is now synchronous off keyring state; missing HD keyrings throw no HD keyring available instead of snap-specific errors.

Reviewed by Cursor Bugbot for commit 98d77bc. Bugbot is set up for automated code reviews on this repo. Configure here.

…py source IDs instead of message-signing-snap
@mathieuartu mathieuartu self-assigned this Aug 5, 2026
@mathieuartu
mathieuartu requested review from a team as code owners August 5, 2026 13:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 99fd724. Configure here.

@mathieuartu

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.6.1-preview-98d77bc2a
@metamask-previews/accounts-controller@39.0.7-preview-98d77bc2a
@metamask-previews/address-book-controller@7.1.2-preview-98d77bc2a
@metamask-previews/ai-controllers@0.8.0-preview-98d77bc2a
@metamask-previews/analytics-controller@2.0.0-preview-98d77bc2a
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-98d77bc2a
@metamask-previews/announcement-controller@8.1.0-preview-98d77bc2a
@metamask-previews/app-metadata-controller@2.0.1-preview-98d77bc2a
@metamask-previews/approval-controller@9.0.2-preview-98d77bc2a
@metamask-previews/assets-controller@13.1.1-preview-98d77bc2a
@metamask-previews/assets-controllers@111.0.0-preview-98d77bc2a
@metamask-previews/authenticated-user-storage@3.0.1-preview-98d77bc2a
@metamask-previews/base-controller@9.1.0-preview-98d77bc2a
@metamask-previews/base-data-service@0.1.3-preview-98d77bc2a
@metamask-previews/bitcoin-regtest-up@1.0.0-preview-98d77bc2a
@metamask-previews/bridge-controller@79.0.1-preview-98d77bc2a
@metamask-previews/bridge-status-controller@75.0.0-preview-98d77bc2a
@metamask-previews/build-utils@3.0.4-preview-98d77bc2a
@metamask-previews/chain-agnostic-permission@1.7.0-preview-98d77bc2a
@metamask-previews/chomp-api-service@4.0.0-preview-98d77bc2a
@metamask-previews/claims-controller@0.5.4-preview-98d77bc2a
@metamask-previews/client-controller@1.0.1-preview-98d77bc2a
@metamask-previews/client-utils@2.0.1-preview-98d77bc2a
@metamask-previews/compliance-controller@2.1.0-preview-98d77bc2a
@metamask-previews/composable-controller@12.0.1-preview-98d77bc2a
@metamask-previews/config-registry-controller@2.0.1-preview-98d77bc2a
@metamask-previews/connectivity-controller@0.3.0-preview-98d77bc2a
@metamask-previews/controller-utils@12.3.0-preview-98d77bc2a
@metamask-previews/core-backend@8.1.1-preview-98d77bc2a
@metamask-previews/delegation-controller@3.0.2-preview-98d77bc2a
@metamask-previews/earn-controller@12.2.4-preview-98d77bc2a
@metamask-previews/eip-5792-middleware@3.0.5-preview-98d77bc2a
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-98d77bc2a
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-98d77bc2a
@metamask-previews/ens-controller@19.1.6-preview-98d77bc2a
@metamask-previews/eth-block-tracker@15.0.1-preview-98d77bc2a
@metamask-previews/eth-json-rpc-middleware@24.0.0-preview-98d77bc2a
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-98d77bc2a
@metamask-previews/foundryup@1.0.1-preview-98d77bc2a
@metamask-previews/gas-fee-controller@26.3.1-preview-98d77bc2a
@metamask-previews/gator-permissions-controller@5.0.1-preview-98d77bc2a
@metamask-previews/geolocation-controller@1.0.0-preview-98d77bc2a
@metamask-previews/java-tron-up@1.0.0-preview-98d77bc2a
@metamask-previews/json-rpc-engine@10.5.0-preview-98d77bc2a
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-98d77bc2a
@metamask-previews/keyring-controller@27.1.1-preview-98d77bc2a
@metamask-previews/local-node-utils@1.0.0-preview-98d77bc2a
@metamask-previews/logging-controller@8.0.2-preview-98d77bc2a
@metamask-previews/message-manager@14.1.2-preview-98d77bc2a
@metamask-previews/messenger@2.0.0-preview-98d77bc2a
@metamask-previews/messenger-cli@0.2.0-preview-98d77bc2a
@metamask-previews/money-account-api-data-service@0.4.0-preview-98d77bc2a
@metamask-previews/money-account-balance-service@2.4.1-preview-98d77bc2a
@metamask-previews/money-account-controller@1.0.0-preview-98d77bc2a
@metamask-previews/money-account-upgrade-controller@3.0.1-preview-98d77bc2a
@metamask-previews/money-account-utils@1.1.0-preview-98d77bc2a
@metamask-previews/multichain-account-service@13.0.1-preview-98d77bc2a
@metamask-previews/multichain-api-middleware@4.0.2-preview-98d77bc2a
@metamask-previews/multichain-network-controller@3.2.3-preview-98d77bc2a
@metamask-previews/multichain-transactions-controller@7.1.2-preview-98d77bc2a
@metamask-previews/name-controller@9.1.2-preview-98d77bc2a
@metamask-previews/network-connection-banner-controller@0.1.2-preview-98d77bc2a
@metamask-previews/network-controller@35.0.1-preview-98d77bc2a
@metamask-previews/network-enablement-controller@6.0.3-preview-98d77bc2a
@metamask-previews/notification-services-controller@26.0.1-preview-98d77bc2a
@metamask-previews/passkey-controller@3.0.0-preview-98d77bc2a
@metamask-previews/permission-controller@13.1.1-preview-98d77bc2a
@metamask-previews/permission-log-controller@5.1.0-preview-98d77bc2a
@metamask-previews/perps-controller@10.0.0-preview-98d77bc2a
@metamask-previews/phishing-controller@17.3.1-preview-98d77bc2a
@metamask-previews/platform-api-docs@0.0.0-preview-98d77bc2a
@metamask-previews/polling-controller@16.0.9-preview-98d77bc2a
@metamask-previews/preferences-controller@23.1.0-preview-98d77bc2a
@metamask-previews/profile-metrics-controller@4.0.3-preview-98d77bc2a
@metamask-previews/profile-sync-controller@29.0.0-preview-98d77bc2a
@metamask-previews/ramps-controller@20.0.0-preview-98d77bc2a
@metamask-previews/rate-limit-controller@7.0.1-preview-98d77bc2a
@metamask-previews/react-data-query@0.2.2-preview-98d77bc2a
@metamask-previews/remote-feature-flag-controller@5.0.0-preview-98d77bc2a
@metamask-previews/sample-controllers@5.0.4-preview-98d77bc2a
@metamask-previews/seedless-onboarding-controller@10.1.1-preview-98d77bc2a
@metamask-previews/selected-network-controller@26.1.6-preview-98d77bc2a
@metamask-previews/sentinel-api-service@1.0.0-preview-98d77bc2a
@metamask-previews/shield-controller@5.1.3-preview-98d77bc2a
@metamask-previews/signature-controller@39.2.9-preview-98d77bc2a
@metamask-previews/smart-transactions-controller@25.1.0-preview-98d77bc2a
@metamask-previews/snap-account-service@2.1.2-preview-98d77bc2a
@metamask-previews/social-controllers@2.7.1-preview-98d77bc2a
@metamask-previews/solana-test-validator-up@1.0.0-preview-98d77bc2a
@metamask-previews/stellar-quickstart-up@0.0.0-preview-98d77bc2a
@metamask-previews/storage-service@1.0.2-preview-98d77bc2a
@metamask-previews/subscription-controller@6.2.2-preview-98d77bc2a
@metamask-previews/transaction-controller@69.5.0-preview-98d77bc2a
@metamask-previews/transaction-pay-controller@26.2.3-preview-98d77bc2a
@metamask-previews/user-operation-controller@41.2.8-preview-98d77bc2a
@metamask-previews/wallet@9.0.0-preview-98d77bc2a
@metamask-previews/wallet-cli@0.0.0-preview-98d77bc2a

@mathieuartu mathieuartu changed the title feat(profile-sync-controller): use KeyringController to resolve entropy source IDs instead of message-signing-snap feat(profile-sync-controller): use KeyringController to resolve entropySourceIds instead of @metamask/message-signing-snap Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant