perf: remove identities, lostIdentities, selectedAddress states from the PreferencesController#40417
perf: remove identities, lostIdentities, selectedAddress states from the PreferencesController#40417
identities, lostIdentities, selectedAddress states from the PreferencesController#40417Conversation
… from the PreferencesController
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/extension-platform (2 files, +2 -8)
🧪 @MetaMask/qa (2 files, +2 -8)
👨🔧 @MetaMask/wallet-integrations (3 files, +14 -20)
|
identities, lostIdentities, selectedAddress states from the PreferencesControlleridentities, lostIdentities, selectedAddress states from the PreferencesController
Builds ready [a30ed7d]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [9622aa5]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
| }); | ||
| }); | ||
|
|
||
| describe('setAccountLabel', () => { |
There was a problem hiding this comment.
Removed the test for this since it used identities, this method is also unused and only called in dead code. Will remove this in a follow up PR since removing in this PR blows the scope up too much.
Builds ready [bd972df]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [cd18de6]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [096d879]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [883e033]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|



Description
Removed usage of
identities,lostIdentities,selectedAddressstates across the extension. The main driver for this change was to prevent the preferences controller from iterating through the accounts in the accounts controller every time there was a state change. This was done to keep the identities states in sync with the internal accounts, identities is an artifact of how we used to handle accounts and these states can safely be removed.Changelog
CHANGELOG entry: null
Related issues
Fixes: N/A
Manual testing steps
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches account-selection and metrics/backup codepaths while removing widely-referenced state fields, so regressions would mainly show up as wrong selected account or missing account counts in events/fixtures. Migration
198mitigates stale persisted data risk by deleting obsolete fields from stored state.Overview
Stops mirroring accounts inside
PreferencesController. The controller no longer maintains/syncsidentities,lostIdentities, orselectedAddress(including removing the AccountsController state-change subscription and deprecated selected-address helpers), and Sentry state filters/types are updated accordingly.Moves remaining consumers to
internalAccounts. Metrics (DappViewed), RPC handler tracking, account import flow, and account selection during hardware unlock/new/import now derive totals/selection viaAccountsControllerinstead of preferences state.Cleans persisted/test data. Adds migration
198to delete the obsolete preferences fields from storage, and updates backup/fixtures/mocks/tests/storybook data to stop generating or asserting on those properties.Written by Cursor Bugbot for commit bd972df. This will update automatically on new commits. Configure here.