You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This updates the targeted confirmation and transaction selectors to stop using deep-equality memoization where controller-backed state already provides stable references. It also replaces a few per-ID transaction lookups with bounded parameterized selectors to avoid cache thrash across multiple transaction IDs.
Transactions: replace deep-equality selectors with standard memoization
incomingTxListSelectorAllChains
getApprovedAndSignedTransactions
incomingTxListSelector
These now use createSelector directly over stable transaction/account inputs.
Approvals and confirmations: remove unnecessary deep memoization
selectPendingApprovalsForNavigation now uses createSelector
getUnapprovedConfirmations now uses createSelector
This keeps the existing filtering behavior while removing deep comparison from selectors operating on immer-backed approval state.
Per-transaction selectors: switch to bounded parameterized caches
getFullTxData was also adjusted to memoize on primitive override inputs separately instead of bundling them into a fresh object each call.
Confirmations account selector: parameterized by account
selectAccountGroupNameByInternalAccount now uses createParameterizedSelector(20)
This keeps lookups scoped by account argument instead of relying on deep-equality over a synthesized input object.
Targeted selector coverage
Added focused assertions around parameterized transaction selector caching behavior.
Example:
constcreateTransactionSelector=createParameterizedSelector(50);exportconstgetTransaction=createTransactionSelector(getCurrentNetworkTransactions,(_,transactionId)=>transactionId,(transactions,transactionId)=>transactions.find(({ id })=>id===transactionId)||EMPTY_OBJECT,);
CopilotAI
changed the title
[WIP] Audit createDeepEqualSelector usages in Confirmations team
perf(6594): audit createDeepEqualSelector for confirmation selectors
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG entry: null
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6594
This updates the targeted confirmation and transaction selectors to stop using deep-equality memoization where controller-backed state already provides stable references. It also replaces a few per-ID transaction lookups with bounded parameterized selectors to avoid cache thrash across multiple transaction IDs.
Transactions: replace deep-equality selectors with standard memoization
incomingTxListSelectorAllChainsgetApprovedAndSignedTransactionsincomingTxListSelectorThese now use
createSelectordirectly over stable transaction/account inputs.Approvals and confirmations: remove unnecessary deep memoization
selectPendingApprovalsForNavigationnow usescreateSelectorgetUnapprovedConfirmationsnow usescreateSelectorThis keeps the existing filtering behavior while removing deep comparison from selectors operating on immer-backed approval state.
Per-transaction selectors: switch to bounded parameterized caches
getUnapprovedTransaction→createParameterizedSelector(20)getTransaction→createParameterizedSelector(50)getFullTxData→createParameterizedSelector(20)getFullTxDatawas also adjusted to memoize on primitive override inputs separately instead of bundling them into a fresh object each call.Confirmations account selector: parameterized by account
selectAccountGroupNameByInternalAccountnow usescreateParameterizedSelector(20)This keeps lookups scoped by account argument instead of relying on deep-equality over a synthesized input object.
Targeted selector coverage
Example: