Skip to content

fix: enhance speed up and cancel logic#40396

Closed
vinistevam wants to merge 42 commits intomainfrom
vs/speedup-cancel-logic
Closed

fix: enhance speed up and cancel logic#40396
vinistevam wants to merge 42 commits intomainfrom
vs/speedup-cancel-logic

Conversation

@vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Feb 25, 2026

Description

This PR modernizes the cancel/speed-up transaction UI to use the same GasFeeModal context and gas-details patterns as the main confirmation flow, and fixes the "useConfirmContext must be used within ConfirmContextProvider" error when opening the gas modal from cancel-speedup.

What was done

  • GasFeeModal context: Extended with optional transactionMeta and editGasMode. GasFeeModalWrapper wraps modal content in ConfirmContextProvider with currentConfirmationOverride={transactionMeta} when opened from cancel-speedup so gas modals can use useConfirmContext().
  • Cancel-speedup: Removed GasFeeContextProvider. Uses GasFeeModalContextProvider(transactionMeta, editGasMode), useCancelSpeedupGasState, and useCancelSpeedupInitialGas. Renders shared gas UI (e.g. GasFeesSection) and opens the gas modal via context.
  • Gas modals/hooks: AdvancedEIP1559Modal, AdvancedGasPriceModal, and useGasFeeEstimateLevelOptions use useConfirmContext() again; no useTransactionForGasModal in the modal flow.
  • Confirm context: ConfirmContextProvider supports optional currentConfirmationOverride; when set, route sync and navigate-on-dismiss are skipped so the gas modal can be used outside the confirm route.
  • Hooks: useCancelSpeedupGasState provides effective transaction and actions; useCancelSpeedupInitialGas runs the initial gas rule (medium vs tenPercentIncreased) when the cancel-speedup modal is open.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Fixed gas edit opening from cancel/speed-up transaction flow and aligned cancel-speedup gas UI with the main confirmation flow.

Related issues

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

Manual testing steps

  1. Start the extension and have a pending transaction.
  2. Open Activity, open the cancel or speed-up action for that transaction so the cancel-speedup modal is shown.
  3. Click the Edit (gas) icon/button.
  4. Confirm the gas modal opens with no error.
  5. Change gas option or open advanced gas, save/cancel, and confirm behavior is correct.
  6. Confirm the initial gas selection (medium vs +10%) still applies when the cancel-speedup modal first opens.

Screenshots/Recordings

cancel_new_ex.webm

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
Touches cancel/speed-up transaction replacement gas calculation and modal context wiring, which can impact transaction submission and gas editing behavior. Changes are well-covered with new unit/E2E tests but still affect a user-critical path.

Overview
Cancel/speed-up confirmations now use the same gas modal/context patterns as the main confirmation flow. CancelSpeedup is refactored to use GasFeeModalContextProvider (and a new ConfirmContextProvider override path) so opening the gas editor from the cancel/speed-up modal no longer throws useConfirmContext provider errors.

Replacement transaction gas is made safer. A new getGasValuesForReplacement utility is used by useTransactionFunctions to ensure cancel/speed-up submissions use at least previousGas × (CANCEL_RATE/SPEED_UP_RATE) for EIP-1559 fees, and the confirm button is disabled until previousGas is captured.

Supporting UI/hooks updated and tests expanded. GasTiming adds userFeeLevelOverride and labels for dapp-suggested/10% increase; NetworkStatistics/StatusSlider can fall back to useGasFeeEstimates when context estimates are missing; useFeeCalculations can run outside swap context via useDappSwapContextOptional. New unit tests cover the new hooks and gas replacement logic, and E2E speed-up/cancel tests are updated with a dedicated modal page object.

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

vinistevam and others added 19 commits February 5, 2026 14:33
…context

- Introduced `useCancelSpeedupGasState` to manage effective transaction state and actions for cancel/speedup.
- Added `useCancelSpeedupInitialGas` to handle initial gas estimation logic when the cancel/speedup modal is opened.
- Refactored gas fee modal context to support transaction meta and edit gas modes.
- Updated `GasFeesSection` to utilize new hooks for fee calculations.
- Improved modal components to handle gas fee editing more effectively.
- Added optional Dapp swap context for better integration in various flows.
- Enhanced tests for new hooks and components to ensure proper functionality.
@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Feb 25, 2026
@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.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (25 files, +1285 -225)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 cancel-speedup/
          • 📄 cancel-speedup.test.tsx +24 -27
          • 📄 cancel-speedup.tsx +115 -137
        • 📁 components/
          • 📁 confirm/
            • 📁 info/
              • 📁 hooks/
                • 📄 useFeeCalculations.test.ts +1 -1
                • 📄 useFeeCalculations.ts +5 -2
          • 📁 edit-gas-fee-popover/
            • 📁 network-statistics/
              • 📁 status-slider/
                • 📄 status-slider.js +10 -3
                • 📄 status-slider.test.js +14 -3
                • 📄 network-statistics.js +13 -2
                • 📄 network-statistics.test.js +63 -0
              • 📄 edit-gas-fee-popover.stories.tsx +32 -13
              • 📄 edit-gas-fee-popover.test.js +4 -0
          • 📁 gas-timing/
            • 📄 gas-timing.component.js +24 -4
            • 📄 gas-timing.component.test.js +73 -1
          • 📁 modals/
            • 📁 advanced-eip1559-modal/
              • 📄 advanced-eip1559-modal.tsx +14 -7
            • 📁 advanced-gas-price-modal/
              • 📄 advanced-gas-price-modal.tsx +10 -5
            • 📁 gas-fee-modal/
              • 📄 gas-fee-modal.tsx +0 -1
        • 📁 context/
          • 📁 confirm/
            • 📄 index.tsx +20 -4
          • 📁 dapp-swap/
            • 📄 index.tsx +8 -0
          • 📁 gas-fee-modal/
            • 📄 index.tsx +48 -5
        • 📁 hooks/
          • 📁 gas/
            • 📄 useGasFeeEstimateLevelOptions.test.ts +26 -4
            • 📄 useGasFeeEstimateLevelOptions.ts +29 -6
            • 📄 useCancelSpeedupGasState.test.ts +170 -0
            • 📄 useCancelSpeedupGasState.ts +153 -0
            • 📄 useCancelSpeedupInitialGas.test.ts +284 -0
            • 📄 useCancelSpeedupInitialGas.ts +116 -0
            • 📄 useTransactionFunction.test.js +29 -0

👨‍🔧 @MetaMask/core-extension-ux (1 files, +1 -13)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 transaction-list-item/
          • 📄 transaction-list-item.component.js +1 -13

🧪 @MetaMask/qa (1 files, +87 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 confirmations/
            • 📄 speed-up-and-cancel-modal.ts +87 -0

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [59d206a]
⚡ Performance Benchmarks (1366 ± 110 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29325287333
total29325287333
Confirm Txconfirm_tx60371560476055
total60371560476055
Bridge User Actionsbridge_load_page22336242282
bridge_load_asset_picker16833186208
bridge_search_token7022705705
total10921411041105
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13661148165711014461561
load115997114339912201342
domContentLoaded115296814279912161336
domInteractive2715101182571
firstPaint179681295189212318
backgroundConnect20118524412203229
firstReactRender19134661933
initialActions105113
loadScripts96777812499910281149
setupStore1363461625
numNetworkReqs312291202286
Chrome Browserify Startup Power User HomeuiStartup17101339221013717461944
load11361022169813011251492
domContentLoaded11231011168613011131482
domInteractive3518141233590
firstPaint1847147485238329
backgroundConnect28525734719294328
firstReactRender23156172538
initialActions104112
loadScripts91681714751289031276
setupStore1675681931
numNetworkReqs59381482556139
Chrome Webpack Startup Standard HomeuiStartup962705125311710111195
load8066321033103898970
domContentLoaded8006221022102891958
domInteractive3217158282587
firstPaint1256641364167232
backgroundConnect28186883143
firstReactRender20134872236
initialActions106113
loadScripts7966201011100888946
setupStore1374151422
numNetworkReqs312290192584
Chrome Webpack Startup Power User HomeuiStartup1212889172316013051491
load71563411361087051008
domContentLoaded7066281127107696999
domInteractive36191792937111
firstPaint1346748782151298
backgroundConnect17013133040172256
firstReactRender23183842428
initialActions102011
loadScripts7036251116105694990
setupStore1244761317
numNetworkReqs1013826551136161
Firefox Browserify Startup Standard HomeuiStartup16711357259719917012098
load14061144219916914351717
domContentLoaded14041140219916914351717
domInteractive843331149101148
firstPaint------
backgroundConnect62322182766110
firstReactRender14122311416
initialActions102012
loadScripts13761123215716214091690
setupStore187147231550
numNetworkReqs3119100192784
Firefox Browserify Startup Power User HomeuiStartup26551980364035627393466
load15181228233222115621978
domContentLoaded15171227233222115621972
domInteractive11835478102113402
firstPaint------
backgroundConnect234105977202200886
firstReactRender18156551925
initialActions203122
loadScripts14821211230821015171916
setupStore1548804201213669
numNetworkReqs60301503684143
Firefox Webpack Startup Standard HomeuiStartup17161411355828917312060
load14471194312426514541590
domContentLoaded14461194312326514531590
domInteractive110281699168131198
firstPaint------
backgroundConnect60262293268107
firstReactRender15122931624
initialActions103122
loadScripts14231172309626314351561
setupStore226205301464
numNetworkReqs301991162772
Firefox Webpack Startup Power User HomeuiStartup26021908406844627323464
load15381261244529416572175
domContentLoaded15381261244529416572174
domInteractive12531702139104524
firstPaint------
backgroundConnect2301001198197212669
firstReactRender20146152227
initialActions213123
loadScripts15001236242428116002091
setupStore17571103231218693
numNetworkReqs58181743782136
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2181219221
srpButtonToSrpForm9119192
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501516
doneButtonToHomeScreen99637513961511
openAccountMenuToAccountListLoaded69239770157024
total843246687818886
Onboarding New WalletcreateWalletToSocialScreen2181218219
srpButtonToPwForm1032105105
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3523739
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList575128620807
total89955874993
Asset DetailsassetClickToPriceChart59167575
total59167575
Solana Asset DetailsassetClickToPriceChart4614647
total4614647
Import Srp HomeloginToHomeScreen19579319992121
openAccountMenuAfterLogin4344450
homeAfterImportWithNewWallet25043925292542
total43964744374442
Send TransactionsopenSendPageFromHome2002020
selectTokenToSendFormLoaded2793838
reviewTransactionToConfirmationPage87823867918
total92520920958
SwapopenSwapPageFromHome12413135138
fetchAndDisplaySwapQuotes46173546214672
total47413547564792
🌐 Dapp Page Load Benchmarks

Current Commit: 59d206a | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±71ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 736ms (±68ms) 🟢 | historical mean value: 725ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 71ms 1.01s 1.32s 1.27s 1.32s
domContentLoaded 736ms 68ms 702ms 996ms 943ms 996ms
firstPaint 76ms 11ms 60ms 176ms 88ms 176ms
firstContentfulPaint 76ms 11ms 60ms 176ms 88ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.24 MiB (100%)
  • ui: 8.14 MiB (100%)
  • common: 10.91 MiB (100%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

Builds ready [95e802a]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account399263581133537581
total399263581133537581
Confirm Txconfirm_tx6066605360761060766076
total6066605360761060766076
Bridge User Actionsbridge_load_page23820128736274287
bridge_load_asset_picker16811320231189202
bridge_search_token7067047092708709
total110110951107511051107
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15711331190911716341774
load13021074157610413591496
domContentLoaded12931068155210313531486
domInteractive3418115212985
firstPaint1717745289240342
backgroundConnect23920328516247270
firstReactRender2313162162331
initialActions207125
loadScripts1072849133310211321260
setupStore1573871829
numNetworkReqs312293192283
Power User HomeuiStartup20121701241815120962289
load11841056176614711721572
domContentLoaded11661045161913111591565
domInteractive3819214343490
firstPaint196781613165236307
backgroundConnect30727439726317362
firstReactRender24164962634
initialActions107113
loadScripts94283813821279361315
setupStore1786081733
numNetworkReqs68341844554168
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2222202252223225
srpButtonToSrpForm96959929699
confirmSrpToPwForm22222312323
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen61158762915616629
openAccountMenuToAccountListLoaded292329132930729282930
total391939133926539213926
Onboarding New WalletcreateWalletToSocialScreen2212192221222222
srpButtonToPwForm1081051113109111
createPwToRecoveryScreen888088
skipBackupToMetricsScreen35343613536
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList58752265648590656
total9889591044339801044
Asset DetailsassetClickToPriceChart1072918654139186
total1072918654139186
Solana Asset DetailsassetClickToPriceChart73687847578
total73687847578
Import Srp HomeloginToHomeScreen19821832216412720432164
openAccountMenuAfterLogin60497097070
homeAfterImportWithNewWallet25892370294621126352946
total46314276483622248264836
Send TransactionsopenSendPageFromHome27173773437
selectTokenToSendFormLoaded21162742027
reviewTransactionToConfirmationPage1120845155432514801554
total1173882163434115431634
SwapopenSwapPageFromHome422763134263
fetchAndDisplaySwapQuotes268626842688226882688
total2728271127511427262751
🌐 Dapp Page Load Benchmarks

Current Commit: 95e802a | Date: 3/9/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±46ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 736ms (±41ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±15ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 46ms 1.01s 1.39s 1.09s 1.39s
domContentLoaded 736ms 41ms 707ms 1.04s 771ms 1.04s
firstPaint 82ms 15ms 64ms 216ms 92ms 216ms
firstContentfulPaint 82ms 15ms 64ms 216ms 92ms 216ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.21 MiB (100%)
  • common: 10.99 MiB (100%)

@vinistevam
Copy link
Contributor Author

@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

✅ lavamoat/browserify/beta/policy.json changes match main/policy.json policy changes
✅ lavamoat/browserify/experimental/policy.json changes match main/policy.json policy changes
✅ lavamoat/browserify/flask/policy.json changes match main/policy.json policy changes
✅ lavamoat/webpack/mv2/beta/policy.json changes match mv2/main/policy.json policy changes
✅ lavamoat/webpack/mv2/experimental/policy.json changes match mv2/main/policy.json policy changes
✅ lavamoat/webpack/mv2/flask/policy.json changes match mv2/main/policy.json policy changes
👀 lavamoat/webpack/mv3/beta/policy.json changes differ from mv3/main/policy.json policy changes
👀 lavamoat/webpack/mv3/experimental/policy.json changes differ from mv3/main/policy.json policy changes
👀 lavamoat/webpack/mv3/flask/policy.json changes differ from mv3/main/policy.json policy changes

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

Builds ready [a612768]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29626235035304350
total29626235035304350
Confirm Txconfirm_tx6087599461906761076190
total6087599461906761076190
Bridge User Actionsbridge_load_page22320124720247247
bridge_load_asset_picker22217828845265288
bridge_search_token75470885959780859
total11991100139412212921394
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14961243209712915691695
load12561044173111513231453
domContentLoaded12481039171911213171426
domInteractive3118118202778
firstPaint1577142478222294
backgroundConnect22820443725233259
firstReactRender20134262131
initialActions108215
loadScripts1037819148311111021216
setupStore1473061727
numNetworkReqs312295192281
Power User HomeuiStartup3189168612318231938358272
load12281045179015712641560
domContentLoaded12091030176115112431536
domInteractive3719341363494
firstPaint1877653185232353
backgroundConnect11602661019820386402955
firstReactRender26166082747
initialActions106112
loadScripts991842148214010251336
setupStore1767281928
numNetworkReqs903725248102205
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202202200220220
srpButtonToSrpForm9796101298101
confirmSrpToPwForm22222302223
pwFormToMetricsScreen16151711617
metricsToWalletReadyScreen16161701717
doneButtonToHomeScreen76359510781798221078
openAccountMenuToAccountListLoaded2939291729521629522952
total3946391240103939434010
Onboarding New WalletcreateWalletToSocialScreen2182172191219219
srpButtonToPwForm1071071070107107
createPwToRecoveryScreen888088
skipBackupToMetricsScreen34343613436
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList72648811302398611130
total1112870152724312411527
Asset DetailsassetClickToPriceChart12010514716128147
total12010514716128147
Solana Asset DetailsassetClickToPriceChart81788428484
total81788428484
Import Srp HomeloginToHomeScreen2010197720302320302030
openAccountMenuAfterLogin35314033640
homeAfterImportWithNewWallet26182315288922328632889
total47524530494817349204948
Send TransactionsopenSendPageFromHome25202932729
selectTokenToSendFormLoaded21212202222
reviewTransactionToConfirmationPage86384988915871889
total90989093316922933
SwapopenSwapPageFromHome422252115152
fetchAndDisplaySwapQuotes269726902711827012711
total274027322746527432746
🌐 Dapp Page Load Benchmarks

Current Commit: a612768 | Date: 3/9/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±41ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 748ms (±39ms) 🟢 | historical mean value: 733ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±14ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 41ms 1.04s 1.37s 1.10s 1.37s
domContentLoaded 748ms 39ms 725ms 1.03s 786ms 1.03s
firstPaint 83ms 14ms 64ms 212ms 92ms 212ms
firstContentfulPaint 83ms 14ms 64ms 212ms 92ms 212ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.21 MiB (100%)
  • common: 10.99 MiB (100%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 9, 2026

Builds ready [7eaeb1c]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28026529915297299
total28026529915297299
Confirm Txconfirm_tx604460396049460496049
total604460396049460496049
Bridge User Actionsbridge_load_page2452382525246252
bridge_load_asset_picker18513828757210287
bridge_search_token72169975924739759
total1146108312647412011264
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14681250188311615001689
load1220101414489312641406
domContentLoaded1213101014279312581399
domInteractive291799172672
firstPaint1507036671212285
backgroundConnect21819733618220253
firstReactRender2212189182234
initialActions208124
loadScripts101181112249110501197
setupStore1475771824
numNetworkReqs312290192283
Power User HomeuiStartup3164177011792208530499060
load12601073212716913061636
domContentLoaded12401051207216012831578
domInteractive42202123936164
firstPaint207841735180272340
backgroundConnect907267607512666452913
firstReactRender26164773039
initialActions105113
loadScripts1019843180815110381335
setupStore1766792032
numNetworkReqs92372394298191
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172212220221
srpButtonToSrpForm94949619596
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen60459062714602627
openAccountMenuToAccountListLoaded2917290729341029142934
total3891387439041339033904
Onboarding New WalletcreateWalletToSocialScreen2202192211221221
srpButtonToPwForm1091071111109111
createPwToRecoveryScreen989099
skipBackupToMetricsScreen37363713737
agreeButtonToOnboardingSuccess17171701717
doneButtonToAssetList60356262624620626
total101110081014210121014
Asset DetailsassetClickToPriceChart1189813314130133
total1189813314130133
Solana Asset DetailsassetClickToPriceChart81748648586
total81748648586
Import Srp HomeloginToHomeScreen2007189621178020532117
openAccountMenuAfterLogin66421032274103
homeAfterImportWithNewWallet2542252125752425752575
total46064233491322747344913
Send TransactionsopenSendPageFromHome21143062130
selectTokenToSendFormLoaded20182222022
reviewTransactionToConfirmationPage8478468491849849
total8888838965889896
SwapopenSwapPageFromHome422864134764
fetchAndDisplaySwapQuotes268726852689226872689
total272927262731227312731
🌐 Dapp Page Load Benchmarks

Current Commit: 7eaeb1c | Date: 3/9/2026

📄 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: 732ms (±36ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±13ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 38ms 1.02s 1.33s 1.06s 1.33s
domContentLoaded 732ms 36ms 711ms 1000ms 753ms 1000ms
firstPaint 80ms 13ms 60ms 188ms 88ms 188ms
firstContentfulPaint 80ms 13ms 60ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.21 MiB (100%)
  • common: 10.99 MiB (100%)

@vinistevam vinistevam marked this pull request as ready for review March 10, 2026 06:09
@vinistevam vinistevam requested review from a team as code owners March 10, 2026 06:09
Copy link

@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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

16,
).gte(new BigNumber(minMaxPriorityFeePerGas, 16))
? txParams.maxPriorityFeePerGas
: minMaxPriorityFeePerGas;
Copy link

Choose a reason for hiding this comment

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

BigNumber hex comparison always returns NaN, ignoring higher gas

High Severity

In getGasValuesForReplacement, toPrefixedHexString() returns 0x-prefixed strings (e.g. "0x12"), which are then passed to new BigNumber(value, 16). Per bignumber.js docs, the 0x prefix is only valid when no base is specified — with base 16, the x character is invalid, causing both operands to be NaN. Since NaN.gte(NaN) is always false, the txParams values are never selected even when they exceed the minimum replacement gas. This means user-chosen higher gas fees are silently downgraded to previousGas × rate.

Additional Locations (1)

Fix in Cursor Fix in Web

await waitFor(() => {
expect(screen.getByTestId('edit-gas-fees-row')).toHaveTextContent(
EXPECTED_ETH_FEE_1,
);
Copy link

Choose a reason for hiding this comment

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

Tests weakened to match any digit, hiding gas bugs

Medium Severity

The tests for gas fee display previously asserted exact expected ETH fee values (EXPECTED_ETH_FEE_1, EXPECTED_ETH_FEE_2) but now only check that the row contains any digit via expect(row.textContent).toMatch(/\d/u). This regex matches any string with at least one digit, making the assertions trivially true and unable to catch regressions in gas fee calculation logic (including the BigNumber bug in getGasValuesForReplacement).

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: MetaMask Extension - Cursor Rules

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [2f07699]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28026830013290300
total28026830013290300
Confirm Txconfirm_tx603260296036360336036
total603260296036360336036
Bridge User Actionsbridge_load_page23820628227252282
bridge_load_asset_picker23420325219245252
bridge_search_token7537407608757760
total1222119912411512251241
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14461198202713214891638
load1208993164011912551425
domContentLoaded1202989163211712501396
domInteractive2917101192681
firstPaint1407044581169309
backgroundConnect21519543125215241
firstReactRender20124662233
initialActions107114
loadScripts1003789142811310511195
setupStore1374561521
numNetworkReqs312293192482
Power User HomeuiStartup20131642230914721142263
load11751034185216311541618
domContentLoaded11591029179916111341605
domInteractive39191662837110
firstPaint195731145134248375
backgroundConnect30126047232309349
firstReactRender24166572535
initialActions109113
loadScripts94482615911519241356
setupStore1563551825
numNetworkReqs69351744554168
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182232220223
srpButtonToSrpForm96949829798
confirmSrpToPwForm22222202222
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161701617
doneButtonToHomeScreen68859877573749775
openAccountMenuToAccountListLoaded290929022914529142914
total3981390040616340184061
Onboarding New WalletcreateWalletToSocialScreen2202182232221223
srpButtonToPwForm1091061111110111
createPwToRecoveryScreen889089
skipBackupToMetricsScreen36353713637
agreeButtonToOnboardingSuccess17161811718
doneButtonToAssetList55848963557612635
total95087810255710021025
Asset DetailsassetClickToPriceChart14911118025165180
total14911118025165180
Solana Asset DetailsassetClickToPriceChart99901118101111
total99901118101111
Import Srp HomeloginToHomeScreen2033199620632920602063
openAccountMenuAfterLogin42354644546
homeAfterImportWithNewWallet24012173265517624472655
total44123569508251247545082
Send TransactionsopenSendPageFromHome24173562735
selectTokenToSendFormLoaded19172122121
reviewTransactionToConfirmationPage8498448544851854
total89288091111894911
SwapopenSwapPageFromHome36244683846
fetchAndDisplaySwapQuotes2704268527301727152730
total2745272327772327662777
🌐 Dapp Page Load Benchmarks

Current Commit: 2f07699 | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±41ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 738ms (±39ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 84ms (±11ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 41ms 1.04s 1.35s 1.11s 1.35s
domContentLoaded 738ms 39ms 712ms 994ms 770ms 994ms
firstPaint 84ms 11ms 68ms 172ms 100ms 172ms
firstContentfulPaint 84ms 11ms 68ms 172ms 100ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.2 MiB (100%)
  • common: 10.99 MiB (100%)

@vinistevam
Copy link
Contributor Author

close PR it will be handle here

@vinistevam vinistevam closed this Mar 10, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-XL team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants