Skip to content

feat: Static Assets Polling#39448

Merged
stanleyyconsensys merged 39 commits intomainfrom
feat/static-asset-polling
Feb 4, 2026
Merged

feat: Static Assets Polling#39448
stanleyyconsensys merged 39 commits intomainfrom
feat/static-asset-polling

Conversation

@stanleyyconsensys
Copy link
Copy Markdown
Contributor

@stanleyyconsensys stanleyyconsensys commented Jan 22, 2026

Description

This pull request adds a new StaticAssetsController that implements polling functionality to fetch and add top static assets (tokens) for enabled chains. The controller fetches assets from the MetaMask tokens API and filters them against the user's ignored tokens list before adding them to the TokensController.

Changes:

  • Added StaticAssetsController that polls for top assets on enabled chains and adds them automatically
  • Integrated polling with the existing asset polling infrastructure via a new useStaticTokensPolling React hook
  • Updated package dependencies to include @metamask/polling-controller v16.0.2 as a direct dependency

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Added a static assets polling controller

Related issues

Jira: https://consensyssoftware.atlassian.net/browse/NEB-285

Manual testing steps

  1. For new / existing user, add MegaETH if it is not enabled yet
  2. Switch network list to MegaETH
  3. The top X token list should be populated even there is no balance on it
  4. When adding a new account, the top X token list should be auto populated again

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

Medium Risk
Introduces a new background polling controller that periodically fetches token data from an external API and mutates TokensController state; regressions could affect token lists, network usage, or polling lifecycle.

Overview
Adds a new StaticAssetsController (plus init + restricted messenger) that periodically fetches “top/trending” tokens per enabled EVM chain (with caching), filters out ignored tokens, and calls TokensController:addTokens.

Wires this controller into background initialization (metamask-controller.js), exposes staticAssetsStartPolling/staticAssetsStopPollingByPollingToken background RPC methods, and starts polling from the UI via a new useStaticTokensPolling hook included in AssetPollingProvider.

Updates Sentry state masking and E2E snapshot fixtures for the new controller, adds unit tests for the controller/init/messenger/hook, and adjusts LavaMoat policies + dependencies to include @metamask/polling-controller as a direct dependency.

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

@github-actions
Copy link
Copy Markdown
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.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 22, 2026

Builds ready [0adf053]
📊 Page Load Benchmark Results

Current Commit: 0adf053 | Date: 1/22/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±65ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 728ms (±62ms) 🟢 | historical mean value: 722ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±15ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 65ms 1.01s 1.39s 1.25s 1.39s
domContentLoaded 728ms 62ms 696ms 1.03s 929ms 1.03s
firstPaint 76ms 15ms 56ms 208ms 84ms 208ms
firstContentfulPaint 76ms 15ms 56ms 208ms 84ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 6.8 KiB (0.13%)
  • ui: 177 Bytes (0%)
  • common: 295 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [3f87cc5]
UI Startup Metrics (1336 ± 104 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13361103158010414201480
load--1136931136310012131267
domContentLoaded--113092913589912061264
domInteractive--2916122212482
firstPaint--1526833568201292
backgroundConnect--23921927512244268
firstReactRender--18115072037
initialActions--106114
loadScripts--90670011261009851040
setupStore--1363051722
numNetworkReqs--221587191577
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--20631552591571820114203
load--1082961202016310811440
domContentLoaded--1064951190715210741418
domInteractive--3519150233592
firstPaint--190711442157227400
backgroundConnect--41328127783963441294
firstReactRender--22164352437
initialActions--109112
loadScripts--82672316081378331147
setupStore--1565971727
numNetworkReqs--1215226052142244
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--835686108478893956
load--69660583268767812
domContentLoaded--69160182367761807
domInteractive--251686172277
firstPaint--1016232046121176
backgroundConnect--40181482745110
firstReactRender--16103151828
initialActions--104113
loadScripts--68859981567755800
setupStore--1263251426
numNetworkReqs--221587181574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1231872199823213771736
load--69860710821126981013
domContentLoaded--68860110761126901003
domInteractive--36171953134109
firstPaint--148631037147155305
backgroundConnect--16312837356167332
firstReactRender--22183232329
initialActions--102111
loadScripts--6865991068110688993
setupStore--1142031317
numNetworkReqs--1285226259159257
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14521151200917815451865
load--1170989160012612621390
domContentLoaded--1169988160012612561390
domInteractive--75333214998152
firstPaint--------
backgroundConnect--69273195578194
firstReactRender--14104161317
initialActions--103122
loadScripts--1134975157511311891349
setupStore--1952673611109
numNetworkReqs--231289191977
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26301826437149227493841
load--12661019237128512462011
domContentLoaded--12661018237028512462011
domInteractive--129351323148120364
firstPaint--------
backgroundConnect--3191151607268424946
firstReactRender--21149292227
initialActions--203123
loadScripts--1203981232524111751898
setupStore--15712858210182703
numNetworkReqs--74382334596186
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16851333232217618122016
load--14361201202712915261640
domContentLoaded--14361201202712915261639
domInteractive--932821846132182
firstPaint--------
backgroundConnect--752823548106167
firstReactRender--15115251524
initialActions--102122
loadScripts--13901183189010814651561
setupStore--174192301264
numNetworkReqs--231284181979
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28732240408243030453901
load--15961298260527117462187
domContentLoaded--15961298260427117462187
domInteractive--12836636114118441
firstPaint--------
backgroundConnect--258109883172265796
firstReactRender--22166662431
initialActions--203123
loadScripts--15481269258625516802083
setupStore--1609773207191663
numNetworkReqs--70372014283172
19--------
📊 Page Load Benchmark Results

Current Commit: 3f87cc5 | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 716ms (±35ms) 🟢 | historical mean value: 721ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 76ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.31s 1.06s 1.31s
domContentLoaded 716ms 35ms 697ms 976ms 738ms 976ms
firstPaint 76ms 12ms 60ms 184ms 84ms 184ms
firstContentfulPaint 76ms 12ms 60ms 184ms 84ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.3 KiB (0.14%)
  • ui: 1.25 KiB (0.02%)
  • common: 349 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [f76bf4d]
UI Startup Metrics (1325 ± 107 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13251102161110713771538
load--1129891143810611831323
domContentLoaded--1123887142910611721318
domInteractive--261690172373
firstPaint--157651142121199301
backgroundConnect--23421628013238267
firstReactRender--17103951831
initialActions--105113
loadScripts--90368112021059581094
setupStore--1363251625
numNetworkReqs--221583171571
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--296016207702150141487245
load--1125962168513111611396
domContentLoaded--1106949168112711381385
domInteractive--3518130223594
firstPaint--196791143121240321
backgroundConnect--954278309896216033000
firstReactRender--24164762641
initialActions--105112
loadScripts--87169913811189021112
setupStore--1575591834
numNetworkReqs--1286233156158253
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--814660103278854991
load--67758986066738795
domContentLoaded--67258485466733790
domInteractive--251585172175
firstPaint--996030354107226
backgroundConnect--4018133234693
firstReactRender--15103551525
initialActions--106111
loadScripts--67058285265729787
setupStore--1043951119
numNetworkReqs--221585181574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1239877192323814371688
load--71462010631106991032
domContentLoaded--70361210561116871022
domInteractive--37201992836109
firstPaint--16067553109192505
backgroundConnect--15513260551157194
firstReactRender--23184342431
initialActions--104111
loadScripts--70061010481096851013
setupStore--1243141419
numNetworkReqs--1615333256178298
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14101108210217115061694
load--1131958177911911901342
domContentLoaded--1130958177911911901340
domInteractive--62331783487136
firstPaint--------
backgroundConnect--60251943966161
firstReactRender--14104971338
initialActions--103122
loadScripts--1100945167510411571244
setupStore--133124171034
numNetworkReqs--231285181873
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28541995734476029603623
load--13061055237127114232020
domContentLoaded--13061055236927114232019
domInteractive--155461292155179417
firstPaint--------
backgroundConnect--5486947096357111316
firstReactRender--22137172228
initialActions--203122
loadScripts--12371019229723912961648
setupStore--13211643161148543
numNetworkReqs--933723447101223
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16801355223520818232112
load--14281181187015115191721
domContentLoaded--14281177187015115181721
domInteractive--933023345132148
firstPaint--------
backgroundConnect--772537757125172
firstReactRender--15115961524
initialActions--1035312
loadScripts--13771159174612414571631
setupStore--1942453812121
numNetworkReqs--221290171875
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29992194922573731853882
load--15991264756464916722033
domContentLoaded--15991264756464916712032
domInteractive--16336578135183529
firstPaint--------
backgroundConnect--49511514693357771078
firstReactRender--21154852430
initialActions--207122
loadScripts--15581243709960816321991
setupStore--1578780206148661
numNetworkReqs--91382845494232
19--------
📊 Page Load Benchmark Results

Current Commit: f76bf4d | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.08s (±73ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 755ms (±70ms) 🟢 | historical mean value: 719ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±11ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.08s 73ms 1.03s 1.36s 1.29s 1.36s
domContentLoaded 755ms 70ms 712ms 1.03s 954ms 1.03s
firstPaint 80ms 11ms 60ms 168ms 92ms 168ms
firstContentfulPaint 80ms 11ms 60ms 168ms 92ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.3 KiB (0.14%)
  • ui: 1.25 KiB (0.02%)
  • common: 351 Bytes (0%)

salimtb
salimtb previously approved these changes Feb 2, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 3, 2026

Builds ready [bbd357c]
UI Startup Metrics (1386 ± 108 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13861167163310814621592
load--1192985143910312601389
domContentLoaded--1186976142910312511381
domInteractive--2716109182478
firstPaint--1557032866199293
backgroundConnect--23421629114240267
firstReactRender--17113841924
initialActions--106112
loadScripts--968762121410210331162
setupStore--1363451523
numNetworkReqs--211582171568
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--295716948563126835005533
load--12591071181012413121510
domContentLoaded--12341058180012012831455
domInteractive--37191893035106
firstPaint--226811806228252361
backgroundConnect--832295417987710952771
firstReactRender--26164363041
initialActions--104112
loadScripts--993824151311210371194
setupStore--18568112242
numNetworkReqs--1035222036116188
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--819670102189874981
load--68959495080748834
domContentLoaded--68359094079743828
domInteractive--241591162175
firstPaint--1055727150145208
backgroundConnect--37181342839121
firstReactRender--15102841725
initialActions--106113
loadScripts--68158893978738826
setupStore--1162741220
numNetworkReqs--221588181575
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1285876288131215041803
load--73162411711197191067
domContentLoaded--71961911621197051061
domInteractive--36191092236102
firstPaint--17071990158188307
backgroundConnect--16813154358167310
firstReactRender--24184552635
initialActions--105111
loadScripts--71661711531177031053
setupStore--1354751620
numNetworkReqs--1657735758182298
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--17281381233720918902159
load--14421196202116215421759
domContentLoaded--14411196202116215421758
domInteractive--823427546102178
firstPaint--------
backgroundConnect--843024054100222
firstReactRender--13102321416
initialActions--102122
loadScripts--13951174190913714721637
setupStore--14575121444
numNetworkReqs--231199201881
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--30062201765784430893945
load--16121226606774615882727
domContentLoaded--16121226606774615882727
domInteractive--179541333180244387
firstPaint--------
backgroundConnect--3921081202265532970
firstReactRender--18145951822
initialActions--107122
loadScripts--15701198602174415352682
setupStore--12512696170109618
numNetworkReqs--984423847101222
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16441295228518617492052
load--14141172190513814841686
domContentLoaded--14131167190513814831686
domInteractive--843018643130146
firstPaint--------
backgroundConnect--69262334590160
firstReactRender--14112731520
initialActions--102022
loadScripts--13751156187512514221667
setupStore--174252341142
numNetworkReqs--231288181878
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--328922599125101034045493
load--18521321733789618014281
domContentLoaded--18511321733689518014280
domInteractive--203471295213241673
firstPaint--------
backgroundConnect--48813114483337011216
firstReactRender--24166692555
initialActions--213123
loadScripts--17991303725789317614237
setupStore--15621799175189554
numNetworkReqs--96372945093197
19--------
📊 Page Load Benchmark Results

Current Commit: bbd357c | Date: 2/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±71ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 737ms (±68ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 71ms 1.01s 1.34s 1.30s 1.34s
domContentLoaded 737ms 68ms 701ms 988ms 974ms 988ms
firstPaint 77ms 10ms 60ms 164ms 84ms 164ms
firstContentfulPaint 77ms 10ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 9.36 KiB (0.17%)
  • ui: 1.01 KiB (0.01%)
  • common: 2.04 KiB (0.02%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 3, 2026

Builds ready [7196131]
UI Startup Metrics (1352 ± 83 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1352116016258314021486
load--116899614357912141299
domContentLoaded--116199214327912061294
domInteractive--261692162473
firstPaint--168661127121203313
backgroundConnect--23221528014236265
firstReactRender--17104752025
initialActions--109112
loadScripts--9447611204819891071
setupStore--1363251521
numNetworkReqs--211578161573
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--24881703588095625724951
load--12281052194216912761565
domContentLoaded--12091043193516712591553
domInteractive--44216887037106
firstPaint--227851650248252454
backgroundConnect--58929132656443792365
firstReactRender--25174462738
initialActions--103112
loadScripts--96081216281569981285
setupStore--1755381937
numNetworkReqs--1235725747148205
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--84668311411029061049
load--712601106496787904
domContentLoaded--707595105895782896
domInteractive--251593172277
firstPaint--1106227451156204
backgroundConnect--3618132224095
firstReactRender--15103951629
initialActions--104112
loadScripts--704593105695775889
setupStore--1167471123
numNetworkReqs--221587181574
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1236873212024813641742
load--69359012791236961005
domContentLoaded--6835831271123688998
domInteractive--35172023032100
firstPaint--1496373190196279
backgroundConnect--16714134239164270
firstReactRender--22183842330
initialActions--103111
loadScripts--6815811264122686991
setupStore--1144241215
numNetworkReqs--1415131360157273
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16831339225219718122104
load--13991175197316614911767
domContentLoaded--13981171196716614911766
domInteractive--73342133892143
firstPaint--------
backgroundConnect--76282234785189
firstReactRender--13103931317
initialActions--103122
loadScripts--13561160193914914511635
setupStore--204278381398
numNetworkReqs--231186191881
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28772251587549130263749
load--15071256248321615682083
domContentLoaded--15061256248321615632083
domInteractive--12739589101125345
firstPaint--------
backgroundConnect--3051081149247346890
firstReactRender--17142621922
initialActions--203122
loadScripts--14661234240020515081983
setupStore--1209762175110631
numNetworkReqs--80292464995202
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16981401241317018201979
load--14571234216113215431665
domContentLoaded--14571233216113315431665
domInteractive--893120742131156
firstPaint--------
backgroundConnect--73252184489164
firstReactRender--14112631520
initialActions--103122
loadScripts--14141205204811714741593
setupStore--184147271388
numNetworkReqs--241290191978
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--3252232810126126832434545
load--182713837832108716762866
domContentLoaded--182613837832108716762866
domInteractive--15041635111164407
firstPaint--------
backgroundConnect--37212512452864221039
firstReactRender--24176782736
initialActions--215123
loadScripts--176913207770108416292838
setupStore--14012803168170517
numNetworkReqs--78352444784219
19--------
📊 Page Load Benchmark Results

Current Commit: 7196131 | Date: 2/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±39ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 713ms (±36ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±13ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 39ms 1.00s 1.32s 1.06s 1.32s
domContentLoaded 713ms 36ms 694ms 984ms 742ms 984ms
firstPaint 75ms 13ms 56ms 184ms 84ms 184ms
firstContentfulPaint 75ms 13ms 56ms 184ms 84ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 6.98 KiB (0.13%)
  • ui: 1.24 KiB (0.02%)
  • common: 342 Bytes (0%)

Comment on lines +118 to +132
const caip2ChainId = toEvmCaipChainId(chainId);
const url = new URL(`${TOKEN_API_BASE_URL}/v3/tokens/trending`);
url.searchParams.set('chainIds', caip2ChainId);
// Set the minimum volume, liquidity and market cap to 1 to fetch all tokens.
url.searchParams.set('minVolume24hUsd', '1');
url.searchParams.set('minLiquidity', '1');
url.searchParams.set('minMarketCap', '1');

const response = await fetchWithCache({
url: url.toString(),
fetchOptions: { method: 'GET' },
cacheOptions: { cacheRefreshTime: cacheExpirationTime },
functionName: 'fetchTopAssets',
});
return response;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a good idea. We should be using one service per API (or set of APIs, if it makes sense to group them). No embedded fetch calls in our business logic classes. We have some guidance on this pattern here: https://github.com/MetaMask/core/blob/main/docs/code-guidelines/data-services.md

return;
}

const tokens = await this.#fetchTopAssets(chainId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - I thought the trending API can take multiple chains at once? We can revisit to reduce # of API requests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for the advice, i also aware that, but likely it requires some changes on the PR, since the PR is only enable in megaETH, will revisit when we need to support more networks

@stanleyyconsensys stanleyyconsensys requested a review from a team February 3, 2026 14:52
};

// eslint-disable-next-line @typescript-eslint/ban-types
export type StaticAssetsControllerState = {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Why use the controller base class if there is no state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is because the polling controller is extending the base controller
and we are extending the polling controller

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why here rather than in core? Will mobile require this functionality at some point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is to add a stateless controller on extension to poll some tokens from API and add to token controller, thus to show the token on user wallet

and the only use case will be megaETH, they dont have accounts API (due to no payment made to us)

 as it may be a temp solution, and no plan to move to mobile for now, so we only do it in extension

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.18.0 Issue or pull request that will be included in release 13.18.0 size-XL team-network-enablement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants