Skip to content

feat: authenticate sentinel and tx-api calls#40667

Merged
klejeune merged 15 commits intomainfrom
feat/authenticate-smart-transactions
Mar 19, 2026
Merged

feat: authenticate sentinel and tx-api calls#40667
klejeune merged 15 commits intomainfrom
feat/authenticate-smart-transactions

Conversation

@klejeune
Copy link
Copy Markdown
Contributor

@klejeune klejeune commented Mar 6, 2026

Description

Authenticate calls to Sentinel and Transaction API, with a focus on calls submitting transactions.
Authenticating simulations require a transaction controller update, it is out of the scope of this PR.

A linked PR for mobile is at MetaMask/metamask-mobile#27410

Open in GitHub Codespaces

Changelog

CHANGELOG entry: authenticate transaction submission to sentinel and transaction API

Related issues

Fixes:

Manual testing steps

For each of these:

  • Perform an action involving Sentinel or Transaction API
  • In the network logs, check the call includes a "Authorization" header with a bearer token
  1. Click on "Swap" in the main screen:
  1. Perform a smart transaction send (on Ethereum mainnet or BSC for example)
  1. Perform a gasless swap with EIP-7702 (on Polygon or Base)

Screenshots/Recordings

Before

After

Screenshot 2026-03-06 at 15 34 27

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
Adds AuthenticationController-derived bearer tokens to outbound Sentinel and relay (Transaction API) requests, touching request construction and controller initialization paths. Risk is moderate due to potential header/authorization regressions affecting transaction submission and polling flows.

Overview
Adds optional bearer-token authentication for Sentinel and transaction relay requests. The extension now wires an AuthenticationController:getBearerToken getter into Smart Transactions init and a global Sentinel auth setter, and uses it to attach Authorization: Bearer ... when available.

Sentinel network-flag fetches and relay transaction submit/poll now call getSentinelApiHeadersAsync() and pass headers through; jsonRpcRequest was extended to accept optional extra headers. Tests were updated/added to cover token present/absent/throwing cases and to assert headers are included, and @metamask/smart-transactions-controller was bumped to ^22.7.0.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Mar 6, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 6, 2026

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (4 files, +124 -9)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 transaction/
          • 📄 sentinel-api.test.ts +49 -0
          • 📄 sentinel-api.ts +49 -1
          • 📄 transaction-relay.test.ts +9 -1
          • 📄 transaction-relay.ts +17 -7

💸 @MetaMask/transactions (2 files, +119 -0)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 smart-transactions/
          • 📄 smart-transactions-controller-init.test.ts +95 -0
          • 📄 smart-transactions-controller-init.ts +24 -0

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 6, 2026

Builds ready [35ef7aa]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2672612787265278
total2672612787265278
Confirm Txconfirm_tx6048602760862460496086
total6048602760862460496086
Bridge User Actionsbridge_load_page2642512728269272
bridge_load_asset_picker15213917413160174
bridge_search_token6986957002700700
total109910891109811041109
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14211179191012014651610
load1193998149710312351377
domContentLoaded1186994147710112311367
domInteractive281791162574
firstPaint168701245134216326
backgroundConnect21119137025210238
firstReactRender19134452028
initialActions105124
loadScripts99280712639910351174
setupStore1363651521
numNetworkReqs312286192582
Power User HomeuiStartup3061167212585210438596841
load12331053173515112651590
domContentLoaded12161042169915012481585
domInteractive3720136233697
firstPaint199781699172260310
backgroundConnect10962609681178813093704
firstReactRender24174452631
initialActions106113
loadScripts1003847145514110301332
setupStore167111111929
numNetworkReqs944622943109192
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2222182252223225
srpButtonToSrpForm99971022100102
confirmSrpToPwForm24232612426
pwFormToMetricsScreen17171701717
metricsToWalletReadyScreen18171801818
doneButtonToHomeScreen69561785193754851
openAccountMenuToAccountListLoaded291829122927629202927
total4003392141578940484157
Onboarding New WalletcreateWalletToSocialScreen2202192221222222
srpButtonToPwForm1071041112108111
createPwToRecoveryScreen888088
skipBackupToMetricsScreen34333513535
agreeButtonToOnboardingSuccess16161701617
doneButtonToAssetList723475947172872947
total1111861133017112581330
Asset DetailsassetClickToPriceChart1191101276122127
total1191101276122127
Solana Asset DetailsassetClickToPriceChart78778017980
total78778017980
Import Srp HomeloginToHomeScreen1930187619954519451995
openAccountMenuAfterLogin513063136063
homeAfterImportWithNewWallet24292248260515126052605
total44644187466021046354660
Send TransactionsopenSendPageFromHome20192212022
selectTokenToSendFormLoaded21192422124
reviewTransactionToConfirmationPage86385189015869890
total91389294220930942
SwapopenSwapPageFromHome69451182781118
fetchAndDisplaySwapQuotes269226892695226942695
total2761273328133027752813
🌐 Dapp Page Load Benchmarks

Current Commit: 35ef7aa | Date: 3/6/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±36ms) 🟢 | historical mean value: 734ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±13ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.33s 1.05s 1.33s
domContentLoaded 725ms 36ms 705ms 1.00s 741ms 1.00s
firstPaint 80ms 13ms 64ms 196ms 88ms 196ms
firstContentfulPaint 80ms 13ms 64ms 196ms 88ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -98.06 KiB (-1.83%)
  • ui: 17.21 KiB (0.21%)
  • common: 92.04 KiB (0.82%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 6, 2026

Builds ready [d92e017]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2722672753274275
total2722672753274275
Confirm Txconfirm_tx6081603561293460856129
total6081603561293460856129
Bridge User Actionsbridge_load_page25520930532268305
bridge_load_asset_picker21416029656266296
bridge_search_token74170577729761777
total12101101133210013151332
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14301221168610714781653
load1204100814479912451393
domContentLoaded1197100114409912381386
domInteractive2917132212579
firstPaint1556936069216263
backgroundConnect22119727815227248
firstReactRender20124462031
initialActions205124
loadScripts99381012489610241178
setupStore1474361724
numNetworkReqs312292192282
Power User HomeuiStartup19801654246314320552219
load11581013175315911451604
domContentLoaded11381004174214511341506
domInteractive3719235353390
firstPaint243681765272249456
backgroundConnect31426846538321403
firstReactRender24156782642
initialActions104113
loadScripts91479514931379011235
setupStore16798101627
numNetworkReqs68341774555167
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202202200220220
srpButtonToSrpForm102931107107110
confirmSrpToPwForm22222202222
pwFormToMetricsScreen16151811618
metricsToWalletReadyScreen16161701617
doneButtonToHomeScreen69660676668756766
openAccountMenuToAccountListLoaded27852492291016028972910
total39583775407011740554070
Onboarding New WalletcreateWalletToSocialScreen2202182211221221
srpButtonToPwForm1091071132110113
createPwToRecoveryScreen989099
skipBackupToMetricsScreen35353613636
agreeButtonToOnboardingSuccess17161811718
doneButtonToAssetList57752861030604610
total96993199725992997
Asset DetailsassetClickToPriceChart12110314717126147
total12110314717126147
Solana Asset DetailsassetClickToPriceChart1055514535144145
total1055514535144145
Import Srp HomeloginToHomeScreen1950186220246019822024
openAccountMenuAfterLogin43384534545
homeAfterImportWithNewWallet24062191257716025432577
total43994257452210844844522
Send TransactionsopenSendPageFromHome23192732627
selectTokenToSendFormLoaded20182212022
reviewTransactionToConfirmationPage8498428596850859
total8928859027891902
SwapopenSwapPageFromHome42335694656
fetchAndDisplaySwapQuotes268526832687126862687
total273027192741827342741
🌐 Dapp Page Load Benchmarks

Current Commit: d92e017 | Date: 3/6/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±42ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±39ms) 🟢 | historical mean value: 741ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±12ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 42ms 1.03s 1.37s 1.08s 1.37s
domContentLoaded 729ms 39ms 702ms 1.02s 753ms 1.02s
firstPaint 82ms 12ms 68ms 188ms 92ms 188ms
firstContentfulPaint 82ms 12ms 68ms 188ms 92ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -97.49 KiB (-1.82%)
  • ui: 30.24 KiB (0.36%)
  • common: 94.16 KiB (0.84%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 6, 2026

Builds ready [678cee1]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28726732523301325
total28726732523301325
Confirm Txconfirm_tx6072606160891060766089
total6072606160891060766089
Bridge User Actionsbridge_load_page21919623314233233
bridge_load_asset_picker21314127346250273
bridge_search_token73770277330761773
total1168107612546912291254
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14491225201112415211641
load12131003163110512581385
domContentLoaded1206999161610412531374
domInteractive291792172670
firstPaint1537340573206270
backgroundConnect21619730617219253
firstReactRender21136272234
initialActions1011123
loadScripts1006809138910110501174
setupStore1473961623
numNetworkReqs312290192284
Power User HomeuiStartup20301615638357919952379
load1118983212217511081508
domContentLoaded1101973210916910921493
domInteractive3418127223391
firstPaint198691541160240317
backgroundConnect3582473020373303377
firstReactRender24155892545
initialActions105112
loadScripts90078218821648941274
setupStore1462741524
numNetworkReqs74362214877173
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182162191219219
srpButtonToSrpForm94939519495
confirmSrpToPwForm22222202222
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16151711717
doneButtonToHomeScreen63658972750653727
openAccountMenuToAccountListLoaded2952292829952629492995
total3991389341237840224123
Onboarding New WalletcreateWalletToSocialScreen2222202242223224
srpButtonToPwForm1151071288120128
createPwToRecoveryScreen999099
skipBackupToMetricsScreen35343713637
agreeButtonToOnboardingSuccess17161701717
doneButtonToAssetList62358667235642672
total102598110824110441082
Asset DetailsassetClickToPriceChart15314016913161169
total15314016913161169
Solana Asset DetailsassetClickToPriceChart72697427474
total72697427474
Import Srp HomeloginToHomeScreen21631978241016122292410
openAccountMenuAfterLogin63381112878111
homeAfterImportWithNewWallet26822480283013327662830
total48344501511125150395111
Send TransactionsopenSendPageFromHome26113893438
selectTokenToSendFormLoaded341853155153
reviewTransactionToConfirmationPage86684891528852915
total91988197738927977
SwapopenSwapPageFromHome544277146377
fetchAndDisplaySwapQuotes269926922710727062710
total274627362755927542755
🌐 Dapp Page Load Benchmarks

Current Commit: 678cee1 | Date: 3/6/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±41ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 746ms (±39ms) 🟢 | historical mean value: 741ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±17ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 41ms 1.03s 1.38s 1.09s 1.38s
domContentLoaded 746ms 39ms 721ms 1.04s 773ms 1.04s
firstPaint 83ms 17ms 64ms 240ms 92ms 240ms
firstContentfulPaint 83ms 17ms 64ms 240ms 92ms 240ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -97.49 KiB (-1.82%)
  • ui: 30.24 KiB (0.36%)
  • common: 94.16 KiB (0.84%)

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 10, 2026

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​smart-transactions-controller@​22.6.0 ⏵ 22.7.096100100 +19850

View full report

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [a1fafb6]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28326330415295304
total28326330415295304
Confirm Txconfirm_tx6062601960963360916096
total6062601960963360916096
Bridge User Actionsbridge_load_page26919438269305382
bridge_load_asset_picker17615220922195209
bridge_search_token71570673110716731
total1172107912898812651289
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14621233179711615111690
load121799714339812761398
domContentLoaded121099214289612691384
domInteractive3018106192786
firstPaint155761170125196295
backgroundConnect22020039326221247
firstReactRender20144552027
initialActions106114
loadScripts100979512229710681184
setupStore157185181626
numNetworkReqs312289192284
Power User HomeuiStartup2820179612490196825324911
load12461057184316012771631
domContentLoaded12241050176415312521595
domInteractive3921158273699
firstPaint227771786225266371
backgroundConnect915272968117733893196
firstReactRender24175262637
initialActions1010113
loadScripts1007840149814210391354
setupStore1775581933
numNetworkReqs92392374599179
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172201219220
srpButtonToSrpForm93909429494
confirmSrpToPwForm21212202222
pwFormToMetricsScreen17152231822
metricsToWalletReadyScreen15151601516
doneButtonToHomeScreen58857960410588604
openAccountMenuToAccountListLoaded30092912318011231053180
total39773852421213640474212
Onboarding New WalletcreateWalletToSocialScreen2192172212220221
srpButtonToPwForm1061031082106108
createPwToRecoveryScreen888088
skipBackupToMetricsScreen35333823738
agreeButtonToOnboardingSuccess17151711717
doneButtonToAssetList50147853822506538
total89185892723902927
Asset DetailsassetClickToPriceChart1147713521135135
total1147713521135135
Solana Asset DetailsassetClickToPriceChart85858508585
total85858508585
Import Srp HomeloginToHomeScreen20281853237719821142377
openAccountMenuAfterLogin604478147578
homeAfterImportWithNewWallet2368229224154724002415
total43644189456714144094567
Send TransactionsopenSendPageFromHome351554154954
selectTokenToSendFormLoaded20192002020
reviewTransactionToConfirmationPage8518448607858860
total90689192916922929
SwapopenSwapPageFromHome45325385253
fetchAndDisplaySwapQuotes269626862708827042708
total2742271827591527572759
🌐 Dapp Page Load Benchmarks

Current Commit: a1fafb6 | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±81ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 744ms (±87ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 92ms (±127ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 81ms 1.01s 1.44s 1.27s 1.44s
domContentLoaded 744ms 87ms 707ms 1.28s 944ms 1.28s
firstPaint 92ms 127ms 68ms 1.35s 88ms 1.35s
firstContentfulPaint 92ms 127ms 68ms 1.35s 88ms 1.35s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -97.74 KiB (-1.82%)
  • ui: 110.59 KiB (1.32%)
  • common: 95.37 KiB (0.85%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [5d6a092]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2702662764273276
total2702662764273276
Confirm Txconfirm_tx6042599960823460776082
total6042599960823460776082
Bridge User Actionsbridge_load_page22719029639241296
bridge_load_asset_picker20618523821223238
bridge_search_token71370573110709731
total1157108812506011971250
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14881204177611515571670
load1233991144110313041414
domContentLoaded1226985143010112971392
domInteractive3118117222698
firstPaint1557139373209287
backgroundConnect22119826715233245
firstReactRender20114352128
initialActions108124
loadScripts102279212259910851189
setupStore1473861726
numNetworkReqs362794192784
Power User HomeuiStartup36971887143362593441511062
load12831070196917013241661
domContentLoaded12651061186516313071651
domInteractive38192493833119
firstPaint217781148140281352
backgroundConnect139827312021230717247177
firstReactRender25175972835
initialActions108113
loadScripts1038855162414810691339
setupStore1566381726
numNetworkReqs1774934348200263
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212172243223224
srpButtonToSrpForm9895101299101
confirmSrpToPwForm22212622326
pwFormToMetricsScreen16151811718
metricsToWalletReadyScreen16161701717
doneButtonToHomeScreen63059765623646656
openAccountMenuToAccountListLoaded2932289929883429272988
total3994391340796740324079
Onboarding New WalletcreateWalletToSocialScreen2192192190219219
srpButtonToPwForm1131121141113114
createPwToRecoveryScreen889099
skipBackupToMetricsScreen39383903939
agreeButtonToOnboardingSuccess17171701717
doneButtonToAssetList52547061048539610
total9218631003489341003
Asset DetailsassetClickToPriceChart1381311445141144
total1381311445141144
Solana Asset DetailsassetClickToPriceChart86791031082103
total86791031082103
Import Srp HomeloginToHomeScreen20361830228515821272285
openAccountMenuAfterLogin644889146989
homeAfterImportWithNewWallet2287223423484723182348
total43694126470321844134703
Send TransactionsopenSendPageFromHome302054133554
selectTokenToSendFormLoaded19181911919
reviewTransactionToConfirmationPage8468448481847848
total89688492114901921
SwapopenSwapPageFromHome42384634346
fetchAndDisplaySwapQuotes268826832691326912691
total2726270927371027332737
🌐 Dapp Page Load Benchmarks

Current Commit: 5d6a092 | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±75ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 750ms (±72ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±13ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 75ms 1.02s 1.35s 1.30s 1.35s
domContentLoaded 750ms 72ms 716ms 1.04s 971ms 1.04s
firstPaint 81ms 13ms 64ms 192ms 88ms 192ms
firstContentfulPaint 81ms 13ms 64ms 192ms 88ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -97.63 KiB (-1.82%)
  • ui: 184.26 KiB (2.21%)
  • common: 100.22 KiB (0.9%)

@klejeune klejeune marked this pull request as ready for review March 11, 2026 15:09
@klejeune klejeune requested review from a team as code owners March 11, 2026 15:09
rarquevaux
rarquevaux previously approved these changes Mar 12, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 12, 2026

Builds ready [1ff8f9d]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28927531616287316
total28927531616287316
Confirm Txconfirm_tx604560416053560536053
total604560416053560536053
Bridge User Actionsbridge_load_page26224227612269276
bridge_load_asset_picker25723727915257279
bridge_search_token75874477410762774
total1265123612902112831290
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14121203169510114361614
load116899614008211981324
domContentLoaded116298913928111931317
domInteractive281793192485
firstPaint149701111114200244
backgroundConnect2071952448210219
firstReactRender20124152131
initialActions1011224
loadScripts96980111988010011124
setupStore1363651521
numNetworkReqs362789173379
Power User HomeuiStartup64232350173093091674114590
load13331177173912213851575
domContentLoaded13131169173011513591536
domInteractive3520145223595
firstPaint2118450391277343
backgroundConnect2736329144893104365811304
firstReactRender2820182162836
initialActions104113
loadScripts1085949148810911131307
setupStore16784101826
numNetworkReqs1759731245195266
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202192221221222
srpButtonToSrpForm98951043101104
confirmSrpToPwForm22222302223
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen68960380482768804
openAccountMenuToAccountListLoaded2922290129562029332956
total3987391040777240704077
Onboarding New WalletcreateWalletToSocialScreen2192192200220220
srpButtonToPwForm11910913811125138
createPwToRecoveryScreen888088
skipBackupToMetricsScreen38363913839
agreeButtonToOnboardingSuccess17161911819
doneButtonToAssetList583478768107632768
total98789711629810221162
Asset DetailsassetClickToPriceChart664184198384
total664184198384
Solana Asset DetailsassetClickToPriceChart1076615432131154
total1076615432131154
Import Srp HomeloginToHomeScreen2285219823806123162380
openAccountMenuAfterLogin44434714547
homeAfterImportWithNewWallet2242220622772622512277
total4579444746758346034675
Send TransactionsopenSendPageFromHome452871196671
selectTokenToSendFormLoaded402053134953
reviewTransactionToConfirmationPage1195908146923513971469
total1280973154723314601547
SwapopenSwapPageFromHome952415348142153
fetchAndDisplaySwapQuotes2701269127171027082717
total2797274128624528362862
🌐 Dapp Page Load Benchmarks

Current Commit: 1ff8f9d | Date: 3/12/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.10s (±78ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 781ms (±76ms) 🟢 | historical mean value: 734ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 86ms (±11ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.10s 78ms 1.04s 1.41s 1.34s 1.41s
domContentLoaded 781ms 76ms 730ms 1.09s 1.01s 1.09s
firstPaint 86ms 11ms 68ms 176ms 96ms 176ms
firstContentfulPaint 86ms 11ms 68ms 176ms 96ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 801 Bytes (0.01%)
  • ui: 5 Bytes (0%)
  • common: 386 Bytes (0%)

matthewwalsh0
matthewwalsh0 previously approved these changes Mar 12, 2026
* Optional bearer token getter, set by the extension at init to authenticate
* Sentinel and Transaction API calls via core-backend (AuthenticationController).
*/
let getBearerTokenForSentinel: (() => Promise<string | undefined>) | undefined;
Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 Mar 12, 2026

Choose a reason for hiding this comment

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

Dangling state isn't ideal, but I appreciate it simplifies the calls to these utils.

Is there a global messenger reference we could use to retrieve it from the AuthenticationController dynamically?

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.

From what I understand no, there is no messenger available to retrieve it here, as sentinel-api or its direct callers (transaction-relay.ts, subscription-service.ts, etc.) are plain utility modules, they aren’t part of the controller init system and don’t get a restricted messenger as an init parameter. There could be a possibility to thread a messenger from all the indirect callers, but at the cost of complicating the PR and actually beginning to migrate sentinel-api to its own controller. It seems like a lot for such a small change.

try {
const token = await getBearerTokenForSentinel();
if (token) {
headers.Authorization = token.startsWith('Bearer ')
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 do we have to validate the result here, could this return other token formats?

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.

No, sorry for that, I cleaned it up

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [1e1afdf]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29427231014308310
total29427231014308310
Confirm Txconfirm_tx6026598860813560386081
total6026598860813560386081
Bridge User Actionsbridge_load_page25723528720261287
bridge_load_asset_picker2352252468237246
bridge_search_token74572176417757764
total1237121912621512411262
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14681211199511815071713
load12131001164610112541382
domContentLoaded120699616409912451374
domInteractive3016107202580
firstPaint1577037872215264
backgroundConnect21519933118216245
firstReactRender20134952131
initialActions106124
loadScripts100780214299710451166
setupStore1464871726
numNetworkReqs393186154075
Power User HomeuiStartup5536222118016297965159550
load13211131175113813711626
domContentLoaded13001121170513013401592
domInteractive41193063836117
firstPaint223871622164294334
backgroundConnect233031814269266130976502
firstReactRender25165662835
initialActions105113
loadScripts1078912146412211151353
setupStore17667101836
numNetworkReqs1488929841160251
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192192200219220
srpButtonToSrpForm94929519495
confirmSrpToPwForm22212312323
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen61959963716632637
openAccountMenuToAccountListLoaded2934289729622829622962
total3916390239381639383938
Onboarding New WalletcreateWalletToSocialScreen2192192200219220
srpButtonToPwForm1091071101109110
createPwToRecoveryScreen889099
skipBackupToMetricsScreen39393903939
agreeButtonToOnboardingSuccess17171701717
doneButtonToAssetList50147653019500530
total88386789212892892
Asset DetailsassetClickToPriceChart53525625656
total53525625656
Solana Asset DetailsassetClickToPriceChart1083520361128203
total1083520361128203
Import Srp HomeloginToHomeScreen23862215258614124412586
openAccountMenuAfterLogin61547166171
homeAfterImportWithNewWallet1342436276797922772767
total393628155905122148305905
Send TransactionsopenSendPageFromHome24232722727
selectTokenToSendFormLoaded472382215882
reviewTransactionToConfirmationPage1140650138627313311386
total1218710147629214671476
SwapopenSwapPageFromHome14111316520161165
fetchAndDisplaySwapQuotes2699268527161227042716
total2854281729103728812910
🌐 Dapp Page Load Benchmarks

Current Commit: 1e1afdf | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±77ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 753ms (±86ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 94ms (±129ms) 🟢 | historical mean value: 85ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 77ms 1.02s 1.42s 1.30s 1.42s
domContentLoaded 753ms 86ms 709ms 1.31s 967ms 1.31s
firstPaint 94ms 129ms 64ms 1.38s 96ms 1.38s
firstContentfulPaint 94ms 129ms 64ms 1.38s 96ms 1.38s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 393 Bytes (0.01%)
  • ui: 15.89 KiB (0.19%)
  • common: 19.3 KiB (0.17%)

@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [4ffe39e]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2792682899288289
total2792682899288289
Confirm Txconfirm_tx6038600060782860406078
total6038600060782860406078
Bridge User Actionsbridge_load_page28323234545326345
bridge_load_asset_picker23417129347283293
bridge_search_token74973276413762764
total1266123612922012801292
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15611297199511916191755
load13041062166611013671477
domContentLoaded12971055162710813601472
domInteractive3017114232697
firstPaint181691303148235375
backgroundConnect22720927212232252
firstReactRender19134152131
initialActions2012224
loadScripts1085841142010711481267
setupStore1574361728
numNetworkReqs393184163879
Power User HomeuiStartup61692346175982848664514234
load13231151178012813601598
domContentLoaded13041145176312213411547
domInteractive37182313330118
firstPaint217851297144278410
backgroundConnect2662366145652915353811149
firstReactRender25166172734
initialActions104113
loadScripts1076936150311211171299
setupStore1674282129
numNetworkReqs1919633452217289
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212202221221222
srpButtonToSrpForm95949719697
confirmSrpToPwForm22222302223
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16151601616
doneButtonToHomeScreen62559465723630657
openAccountMenuToAccountListLoaded2921290429481729222948
total3923387039663839503966
Onboarding New WalletcreateWalletToSocialScreen2192192190219219
srpButtonToPwForm1131101162115116
createPwToRecoveryScreen999099
skipBackupToMetricsScreen41404214142
agreeButtonToOnboardingSuccess17171801718
doneButtonToAssetList49848552014501520
total91088496834901968
Asset DetailsassetClickToPriceChart77747927979
total77747927979
Solana Asset DetailsassetClickToPriceChart1243118053168180
total1243118053168180
Import Srp HomeloginToHomeScreen2414236824603824602460
openAccountMenuAfterLogin573881166181
homeAfterImportWithNewWallet60552166361663663
total3075304731152931153115
Send TransactionsopenSendPageFromHome562687247387
selectTokenToSendFormLoaded33294043240
reviewTransactionToConfirmationPage89384692233922922
total99793510304410301030
SwapopenSwapPageFromHome1098513521126135
fetchAndDisplaySwapQuotes268226762696826802696
total2786277128051428052805
🌐 Dapp Page Load Benchmarks

Current Commit: 4ffe39e | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±43ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±64ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±43ms) 🟢 | historical mean value: 84ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 43ms 1.01s 1.36s 1.07s 1.36s
domContentLoaded 727ms 64ms 702ms 1.31s 752ms 1.31s
firstPaint 82ms 43ms 60ms 504ms 88ms 504ms
firstContentfulPaint 82ms 43ms 60ms 504ms 88ms 504ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 393 Bytes (0.01%)
  • ui: 15.89 KiB (0.19%)
  • common: 19.3 KiB (0.17%)

@klejeune klejeune added this pull request to the merge queue Mar 18, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 18, 2026
@klejeune klejeune added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 8ec6877 Mar 19, 2026
206 checks passed
@klejeune klejeune deleted the feat/authenticate-smart-transactions branch March 19, 2026 09:58
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2026
@metamaskbot metamaskbot added the release-13.24.0 Issue or pull request that will be included in release 13.24.0 label Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.24.0 Issue or pull request that will be included in release 13.24.0 size-M team-transactions Transactions team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants