Skip to content

Remove getMemoizedInterface(s) deep-equal wrappers in interfaceController once input stability is verified #31497

Description

@MajorLift

Performance audit finding · Severity: Low · Effort: Easy · Fix risk: Simple · Test safety net: Partial
Owner: CODEOWNERS best-effort (snaps)
File: app/selectors/snaps/interfaceController.ts:27,43

What is this about?

getMemoizedInterfaces and getMemoizedInterface are createDeepEqualSelector wrappers whose getMemoized* naming marks them as band-aids added downstream of unstable inputs. Deep-equal selectors run a deep comparison on every evaluation; if the underlying input slice is reference-stable when unchanged, plain createSelector suffices and the deep compares are pure overhead. If the input genuinely is replaced wholesale, the wrapper is justified — verify which contract holds before changing anything.

Technical Details

Log prev === next for the input slice across two unrelated dispatches (the reference-stability contract test). Stable: downgrade both to createSelector and delete the getMemoized prefix. Unstable: keep, and document why at the definition so the next audit doesn't re-flag it. getMemoizedInternalAccountByAddress (the third wrapper found by the sweep) is filed separately with a different fix: #31491.

Acceptance Criteria

  • Contract verified and recorded; wrappers downgraded or annotated accordingly.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    INVALID-ISSUE-TEMPLATEIssue's body doesn't match any issue template.Sev3area-performanceIssues relating to slowness of app, cpu usage, and/or blank screens.ta-triaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    To be fixed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions