Skip to content

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Sep 10, 2025

Description

This refactors the MetaMetrics controller to use the messenger and init pattern, and updates controllers calling the MetaMetrics controller, to call it through the messenger. This is a prerequisite for MetaMask/core#6112.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@metamaskbot metamaskbot added the team-core-platform Core Platform team label Sep 10, 2025
@Mrtenz Mrtenz added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Sep 10, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Sep 10, 2025

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/core-platform (2 files, +8 -4)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 messengers/
          • 📁 snaps/
            • 📄 snap-controller-messenger.ts +4 -1
        • 📁 snaps/
          • 📄 snap-controller-init.ts +4 -3

🪪 @MetaMask/identity (9 files, +135 -22)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 identity/
          • 📄 authentication-controller-init.test.ts +10 -3
          • 📄 authentication-controller-init.ts +12 -5
          • 📄 user-storage-controller-init.test.ts +11 -2
          • 📄 user-storage-controller-init.ts +10 -8
        • 📁 messengers/
          • 📁 identity/
            • 📄 authentication-controller-messenger.test.ts +16 -1
            • 📄 authentication-controller-messenger.ts +26 -0
            • 📄 index.ts +8 -2
            • 📄 user-storage-controller-messenger.test.ts +16 -1
            • 📄 user-storage-controller-messenger.ts +26 -0

💸 @MetaMask/transactions (2 files, +45 -33)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 smart-transactions/
          • 📄 smart-transactions-controller-init.test.ts +23 -12
          • 📄 smart-transactions-controller-init.ts +22 -21

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 0727fc0 | Date: 9/10/2025

📄 https://metamask.github.io/test-dapp/

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.30s (±42ms) 🟡 | historical mean value: 1.31s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 975ms (±38ms) 🟢 | historical mean value: 985ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 95ms (±37ms) 🟢 | historical mean value: 95ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.30s 42ms 1.27s 1.54s 1.41s 1.54s
domContentLoaded 975ms 38ms 946ms 1.21s 1.07s 1.21s
firstPaint 95ms 37ms 72ms 284ms 196ms 284ms
firstContentfulPaint 95ms 37ms 72ms 284ms 196ms 284ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [0727fc0]
UI Startup Metrics (1232 ± 59 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1232112113915912761333
load106992612006011021171
domContentLoaded106191911926110921162
domInteractive18145081741
firstPaint63390117243610771165
backgroundConnect25224035112255263
firstReactRender24178382636
getState1453671826
initialActions50536614
loadScripts81667592559851923
setupStore962631016
WebpackHomeuiStartup20521544257127022382500
load16511224195921317991938
domContentLoaded16401213194621517931921
domInteractive181284141555
firstPaint1636636362184310
backgroundConnect3718350463364
firstReactRender92373367386316
getState3343087315274
initialActions10222327717
loadScripts16361210193421417891918
setupStore187304391427
FirefoxBrowserifyHomeuiStartup13921203183211014431606
load1204105815118012521346
domContentLoaded1203105815118012511345
domInteractive1063328650109238
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3520144223494
firstReactRender27226762936
getState739112622
initialActions40456311
loadScripts1176104214847712291298
setupStore10410013845
WebpackHomeuiStartup16341430210414517361905
load13941207168112815131611
domContentLoaded13931207168112815121610
domInteractive1102834462105298
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect33207783844
firstReactRender45365754854
getState62193612
initialActions511521537
loadScripts13701175166413014911590
setupStore963241017
Benchmark value 253 exceeds gate value 10 for chrome browserify home mean backgroundConnect
Benchmark value 25 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions
Benchmark value 42 exceeds gate value 41 for chrome browserify home p95 domInteractive
Benchmark value 264 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 14 exceeds gate value 1.2 for chrome browserify home p95 initialActions
Benchmark value 34 exceeds gate value 29 for chrome webpack home mean getState
Benchmark value 10 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 2500 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 274 exceeds gate value 195 for chrome webpack home p95 getState
Benchmark value 17 exceeds gate value 7 for chrome webpack home p95 initialActions
Benchmark value 35 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 27 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 238 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 94 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 11 exceeds gate value 2 for firefox browserify home p95 initialActions
Benchmark value 45 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1634 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1394 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1394 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 110 exceeds gate value 100 for firefox webpack home mean domInteractive
Benchmark value 34 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 46 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 5 exceeds gate value 1 for firefox webpack home mean initialActions
Benchmark value 1370 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 298 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 54 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 7 exceeds gate value 2 for firefox webpack home p95 initialActions
Sum of mean exceeds: 362ms | Sum of p95 exceeds: 639.8ms
Sum of all benchmark exceeds: 1001.8ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.18 KiB (0.09%)
  • ui: -3 Bytes (0%)
  • common: 16 Bytes (0%)

@Mrtenz Mrtenz marked this pull request as ready for review September 10, 2025 11:32
@Mrtenz Mrtenz requested review from a team as code owners September 10, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-L team-core-platform Core Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants