Skip to content

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Nov 21, 2025

Description

It seems that having concurrent calls to keyring_createAccount cause some synchronization issues between Snap's accounts and MetaMask accounts. We're not sure of the real root cause yet for this, but preventing concurrent calls seems to mitigate (or even completely prevent) this kind of issues.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Mitigates (partially): #37228

Manual testing steps

Nothing special to tests for this.

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.

Note

Adds a shared Snap provider config with maxConcurrency=1, applies it to BTC/TRX providers, registers it for SOL, and updates tests accordingly.

  • Multichain account service init (app/scripts/controller-init/multichain/multichain-account-service-init.ts):
    • Introduces snapAccountProviderConfig with maxConcurrency: 1 and tuned timeouts.
    • Passes config to BtcAccountProvider and TrxAccountProvider via AccountProviderWrapper.
    • Sets providerConfigs[{SOL_ACCOUNT_PROVIDER_NAME}] to snapAccountProviderConfig when creating MultichainAccountService.
  • Tests (app/scripts/controller-init/multichain/multichain-account-service-init.test.ts):
    • Expects providerConfigs in MultichainAccountService constructor args.

Written by Cursor Bugbot for commit a5da3f4. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

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.

@ccharly ccharly changed the title fix: use maxConcurrency=1 for Snap account providers fix: use maxConcurrency=1 for Snap account providers Nov 21, 2025
@metamaskbot metamaskbot added the team-accounts-framework Accounts Framework team label Nov 21, 2025
@ccharly ccharly marked this pull request as ready for review November 21, 2025 11:54
@metamaskbot
Copy link
Collaborator

Builds ready [1b6f76a]
UI Startup Metrics (1245 ± 94 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1245108314849413011426
load106090012809211211225
domContentLoaded105489712749111151218
domInteractive2514116212084
firstPaint4837412934029731204
backgroundConnect21819125611223238
firstReactRender28185993146
getState341875124061
initialActions107113
loadScripts8436841075929141008
setupStore1153241220
numNetworkReqs1257720573
BrowserifyPower User HomeuiStartup18661555242219119802295
load99487615721549771435
domContentLoaded98186915651549621427
domInteractive36152364029150
firstPaint5058214693649161001
backgroundConnect22019925511226240
firstReactRender80431281789120
getState17013026628186236
initialActions106112
loadScripts77567013581547581223
setupStore191098112340
numNetworkReqs1346831357177292
WebpackStandard HomeuiStartup820734111575846978
load61756880058628783
domContentLoaded61256379458622775
domInteractive241595192182
firstPaint24297810164222607
backgroundConnect1163671429
firstReactRender29217473338
getState291467103647
initialActions104113
loadScripts60956178556620764
setupStore1243151422
numNetworkReqs1257720569
WebpackPower User HomeuiStartup13801048187818114581765
load629551999106618927
domContentLoaded619542993105607916
domInteractive32161623029118
firstPaint33299997221568732
backgroundConnect1466581531
firstReactRender77481171283100
getState15513325221159203
initialActions102011
loadScripts617540985103605907
setupStore18646101943
numNetworkReqs1456432757188286
FirefoxBrowserifyStandard HomeuiStartup12011062160210512471417
load101590711927410621143
domContentLoaded101390311927410611142
domInteractive56301913577113
firstPaint------
backgroundConnect3421153173563
firstReactRender20175152031
getState11515315918
initialActions103112
loadScripts99389211736910401118
setupStore13516322930
numNetworkReqs1156515753
BrowserifyPower User HomeuiStartup25051882362333127033293
load1138907171116811511581
domContentLoaded1137906171116811501580
domInteractive12732627136105494
firstPaint------
backgroundConnect13932838159128562
firstReactRender85381742398127
getState26980914215413749
initialActions208226
loadScripts1106888165916711271562
setupStore1516760193161660
numNetworkReqs91612044480196
WebpackStandard HomeuiStartup14651313197612515061742
load1243109414549212941426
domContentLoaded1243109414549212931426
domInteractive64281793682132
firstPaint------
backgroundConnect4421171244594
firstReactRender29217083140
getState156118191247
initialActions103012
loadScripts1217107514318612581380
setupStore166185261170
numNetworkReqs1256817662
WebpackPower User HomeuiStartup27462131342528729883236
load13761147182015613921719
domContentLoaded13761147182015613921719
domInteractive11330646111107401
firstPaint------
backgroundConnect13436549116137462
firstReactRender85422182692129
getState30987878229498777
initialActions4158938
loadScripts13421128179714913571641
setupStore96958412794494
numNetworkReqs91592164276186
📊 Page Load Benchmark Results

Current Commit: 1b6f76a | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±38ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±36ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 38ms 1.02s 1.32s 1.07s 1.32s
domContentLoaded 726ms 36ms 707ms 998ms 756ms 998ms
firstPaint 76ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 76ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 213 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 20 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [a5da3f4]
UI Startup Metrics (1207 ± 98 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1207105815959812691366
load102588313079210971179
domContentLoaded101988113009110861173
domInteractive231396171873
firstPaint51390131341110071166
backgroundConnect21019026912215235
firstReactRender30195183746
getState341675114257
initialActions105112
loadScripts816675108991880975
setupStore1263351325
numNetworkReqs1257721575
BrowserifyPower User HomeuiStartup18621595298421919462347
load98487219041659631413
domContentLoaded97186718851649451404
domInteractive33152013527140
firstPaint5809918934269451413
backgroundConnect22019827711227238
firstReactRender82431371991120
getState17012828732181241
initialActions103112
loadScripts76667216731627411193
setupStore20966112342
numNetworkReqs1356632056178298
WebpackStandard HomeuiStartup803719100569842959
load60254180759607789
domContentLoaded59753679858603783
domInteractive2313110172167
firstPaint266105806186227636
backgroundConnect1163361224
firstReactRender29204263438
getState291368113549
initialActions106112
loadScripts59453478756601774
setupStore1253251422
numNetworkReqs1257519570
WebpackPower User HomeuiStartup14331196215318815481777
load6665791324121666989
domContentLoaded6565721314121653984
domInteractive35172033432134
firstPaint271821071193258655
backgroundConnect1484761723
firstReactRender79511191386100
getState14912522919153192
initialActions103112
loadScripts6545701302119651975
setupStore21952122548
numNetworkReqs1436734759187284
FirefoxBrowserifyStandard HomeuiStartup11941025164112112551432
load100988013428510771161
domContentLoaded100887613428610771161
domInteractive56312103675148
firstPaint------
backgroundConnect39202103039107
firstReactRender21174752133
getState1158313946
initialActions102012
loadScripts98686811877610501135
setupStore105627922
numNetworkReqs1156815655
BrowserifyPower User HomeuiStartup24251845334229425573013
load1116929164915411151517
domContentLoaded1115923164915511151516
domInteractive12429535113115415
firstPaint------
backgroundConnect1082865712794496
firstReactRender78481242089121
getState23273816201224725
initialActions3023337
loadScripts1090909162915410851481
setupStore1285679160135551
numNetworkReqs92622064079191
WebpackStandard HomeuiStartup15041321192212815431792
load12781119162710513301492
domContentLoaded12771119162710513291492
domInteractive73292314183183
firstPaint------
backgroundConnect43221452544119
firstReactRender28224353137
getState1164971222
initialActions103122
loadScripts1252110415949913091432
setupStore12667111146
numNetworkReqs1257117665
WebpackPower User HomeuiStartup26622207363426927923174
load13461110200018714001712
domContentLoaded13451110200018713991712
domInteractive1083052711595447
firstPaint------
backgroundConnect12025631117121448
firstReactRender79401581988114
getState26064826224371816
initialActions3136537
loadScripts13091093198018213601673
setupStore127677118586606
numNetworkReqs905319135125159
📊 Page Load Benchmark Results

Current Commit: a5da3f4 | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±45ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±42ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 45ms 1.03s 1.37s 1.08s 1.37s
domContentLoaded 739ms 42ms 717ms 1.03s 756ms 1.03s
firstPaint 78ms 11ms 60ms 168ms 88ms 168ms
firstContentfulPaint 78ms 11ms 60ms 168ms 88ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 213 Bytes (0%)
  • ui: 865 Bytes (0.01%)
  • common: 20 Bytes (0%)

@ccharly ccharly changed the title fix: use maxConcurrency=1 for Snap account providers fix: use maxConcurrency=1 for Snap account providers cp-13.11.0 Nov 21, 2025
@ccharly ccharly enabled auto-merge November 21, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S team-accounts-framework Accounts Framework team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants