Skip to content

chore: use wallet_createSession from @metamask/multichain-api-middleware #33511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

wenfix
Copy link

@wenfix wenfix commented Jun 6, 2025

Description

Bumps @metamask/multichain-api-middleware to v0.4.0 and replace local wallet_createSession handler with the one from this package. Adds a SessionRequested event tracking hook and removes sendMetrics and metamaskState hooks that are no longer used by multichain middleware.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5101

Manual testing steps

  1. Navigate to a Multichain enabled dapp
  2. Create a session to invoke wallet_createSession
  3. Should be able to create a session successfully
    3.1 SessionRequested event should fire

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.

Copy link
Contributor

github-actions bot commented Jun 6, 2025

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.

Copy link

socket-security bot commented Jun 6, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​multichain-api-middleware@​0.1.1 ⏵ 0.4.085 +210074 +194 +1100
Updated@​metamask/​chain-agnostic-permission@​0.2.0 ⏵ 0.7.098 +310075 +194 -2100
Updated@​metamask/​api-specs@​0.10.15 ⏵ 0.14.099 +510087 +194 -1100

View full report

@wenfix
Copy link
Author

wenfix commented Jun 6, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

No policy changes

@metamaskbot
Copy link
Collaborator

Builds ready [cb924c4]
UI Startup Metrics (1237 ± 75 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1237109414967512871364
load107393913077311201185
domContentLoaded106693612977311151179
domInteractive16133541628
firstPaint74890124842710961183
backgroundConnect84263813
firstReactRender19152622024
getState1463372027
initialActions001001
loadScripts822694103271866936
setupStore74162811
WebpackHomeuiStartup20761658250524222792470
load16211309192218817671897
domContentLoaded16151305190518717591888
domInteractive15114981340
firstPaint1626641759177275
backgroundConnect20113862333
firstReactRender13244365107104347
getState175334441219
initialActions317134
loadScripts16121304189618517571876
setupStore4073258518309
FirefoxBrowserifyHomeuiStartup13541187171010714121598
load1192105114739312541361
domContentLoaded1192105114739312541361
domInteractive1053527938108174
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2513182212253
firstReactRender24205552427
getState14519733838
initialActions001001
loadScripts1171103714248812361337
setupStore8412513715
WebpackHomeuiStartup15101342206212315821733
load13101167171511413511524
domContentLoaded13101167171411413501523
domInteractive76442312279114
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2315259252130
firstReactRender40296144247
getState84304915
initialActions103111
loadScripts12901150166310913301506
setupStore10520220826
Benchmark value 1238 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1073 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1067 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 1183 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 41 exceeds gate value 32 for chrome webpack home mean setupStore
Benchmark value 2470 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 309 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 14 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 38 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 28ms | Sum of p95 exceeds: 277ms
Sum of all benchmark exceeds: 305ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 13.41 KiB (0.26%)
  • ui: -6 Bytes (0%)
  • common: 0 Bytes (0%)

ffmcgee725
ffmcgee725 previously approved these changes Jun 6, 2025
@wenfix
Copy link
Author

wenfix commented Jun 6, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

metamaskbot commented Jun 6, 2025

✨ Files requiring CODEOWNER review ✨

🧩 @MetaMask/extension-devs (3 files, +3 -33)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +1 -11
      • 📁 flask/
        • 📄 policy.json +1 -11
      • 📁 main/
        • 📄 policy.json +1 -11

📜 @MetaMask/policy-reviewers (3 files, +3 -33)

[!TIP]
Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.

  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +1 -11
      • 📁 flask/
        • 📄 policy.json +1 -11
      • 📁 main/
        • 📄 policy.json +1 -11

🔗 @MetaMask/supply-chain (3 files, +3 -33)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +1 -11
      • 📁 flask/
        • 📄 policy.json +1 -11
      • 📁 main/
        • 📄 policy.json +1 -11

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs-multichain failed. View the html report here.

@metamaskbot
Copy link
Collaborator

Builds ready [0f5ae31]
UI Startup Metrics (1207 ± 59 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1207110214095912451319
load104894611705510901145
domContentLoaded104092411645610821138
domInteractive16133441628
firstPaint65971117142410621129
backgroundConnect94306825
firstReactRender19163022026
getState1443971930
initialActions001001
loadScripts79768892255841889
setupStore75152811
WebpackHomeuiStartup20931670263022022542449
load16311304207017717471897
domContentLoaded16251301205517617421884
domInteractive161192111340
firstPaint1636260975173310
backgroundConnect2410325312438
firstReactRender13843365109138357
getState144305301320
initialActions612993035
loadScripts16221299204417517401873
setupStore2873185917236
FirefoxBrowserifyHomeuiStartup14041236184611214471607
load12451093162910013101442
domContentLoaded12451093162910013101442
domInteractive1014317823116143
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2414238252252
firstReactRender24213022429
getState10417518811
initialActions001001
loadScripts1223108215289712601422
setupStore9418418712
WebpackHomeuiStartup15801373210714716791867
load13651190169712614621576
domContentLoaded13641189169712614621575
domInteractive82322852986120
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21166372133
firstReactRender42355034447
getState85303812
initialActions001011
loadScripts13471175168112514441561
setupStore15548553813
Benchmark value 26 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 236 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 1246 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1246 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 42 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 15 exceeds gate value 13 for firefox webpack home mean setupStore
Sum of mean exceeds: 14ms | Sum of p95 exceeds: 179ms
Sum of all benchmark exceeds: 193ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 13.2 KiB (0.25%)
  • ui: -6 Bytes (0%)
  • common: -3 Bytes (0%)

@wenfix
Copy link
Author

wenfix commented Jun 6, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs-multichain failed. View the html report here.

@metamaskbot
Copy link
Collaborator

Builds ready [db929c9]
UI Startup Metrics (1235 ± 73 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1235108416247312791346
load107094214587011011172
domContentLoaded106393814437010941167
domInteractive1813105111632
firstPaint69475145243510781149
backgroundConnect84395821
firstReactRender20174942124
getState15678111929
initialActions001001
loadScripts816695117668849918
setupStore85334814
WebpackHomeuiStartup21521677265020722872498
load16711315204916617791923
domContentLoaded16651311203916517751914
domInteractive161268101343
firstPaint1676448566211303
backgroundConnect231476102542
firstReactRender15446355111301343
getState2853476817306
initialActions317134
loadScripts16621309202716417721902
setupStore287320581937
FirefoxBrowserifyHomeuiStartup13871190168810514481600
load1227106015459512821418
domContentLoaded1227106015449512821417
domInteractive1053626233117172
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect231382112350
firstReactRender23213022428
getState11517923912
initialActions001001
loadScripts1207104615299612641399
setupStore84618725
WebpackHomeuiStartup15271341208912316121735
load13261153179011714041541
domContentLoaded13251153178911714041541
domInteractive83553384581142
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2315270252229
firstReactRender41275744347
getState11425725822
initialActions002111
loadScripts13051137153911013901525
setupStore85212813
Benchmark value 1236 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1063 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 16 exceeds gate value 15 for chrome browserify home mean getState
Benchmark value 21 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 2499 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 306 exceeds gate value 195 for chrome webpack home p95 getState
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 8ms | Sum of p95 exceeds: 159ms
Sum of all benchmark exceeds: 167ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: -149.46 KiB (-2.87%)
  • ui: -2 Bytes (0%)
  • common: 7.07 KiB (0.09%)

@wenfix
Copy link
Author

wenfix commented Jun 6, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

Builds ready [9dd3c8d]
UI Startup Metrics (1246 ± 76 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1246110914267613081377
load107893412307011251204
domContentLoaded107193112227011171197
domInteractive16133541628
firstPaint796140122841911091207
backgroundConnect84264923
firstReactRender21164042132
getState1564082028
initialActions001001
loadScripts82469897869873947
setupStore85243913
WebpackHomeuiStartup20731675249922322312426
load16221276193117917361865
domContentLoaded16161271191617717321855
domInteractive15116191340
firstPaint1566544457181240
backgroundConnect2095072433
firstReactRender13744342101151328
getState144311301425
initialActions3115235
loadScripts16121264190917617311844
setupStore3273197118311
FirefoxBrowserifyHomeuiStartup13341192184110413751557
load1179104514558612301389
domContentLoaded1179104514558612301389
domInteractive963433538104140
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect211398132136
firstReactRender23205842328
getState12419626830
initialActions001001
loadScripts1161103014338512161348
setupStore84629734
WebpackHomeuiStartup15811386210814016511809
load13701206178312714541592
domContentLoaded13701205178212714541591
domInteractive80302873184139
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2316238222328
firstReactRender42345544548
getState11526025913
initialActions002111
loadScripts13491185176712314381571
setupStore9516416811
Benchmark value 1246 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1079 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1071 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 1377 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1204 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1198 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 1208 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 947 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 33 exceeds gate value 32 for chrome webpack home mean setupStore
Benchmark value 311 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 12 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 30 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 34 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 43 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 38ms | Sum of p95 exceeds: 343ms
Sum of all benchmark exceeds: 381ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: -22.29 KiB (-0.43%)
  • ui: -15 Bytes (0%)
  • common: 7.32 KiB (0.09%)

@wenfix wenfix marked this pull request as ready for review June 6, 2025 15:13
@wenfix wenfix requested review from a team as code owners June 6, 2025 15:13
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.

3 participants