Skip to content

feat: enhance speed up and cancel logic#40734

Open
vinistevam wants to merge 10 commits intomainfrom
vs/enhance-speed-up-cancel-logic
Open

feat: enhance speed up and cancel logic#40734
vinistevam wants to merge 10 commits intomainfrom
vs/enhance-speed-up-cancel-logic

Conversation

@vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Mar 10, 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 transaction replacement gas calculation and confirmation/gas modal context wiring, which can affect whether cancel/speed-up transactions submit and display fees correctly. Changes are well-covered with new unit and e2e tests but span multiple confirmation components and hooks.

Overview
Refactors the cancel/speed-up transaction modal to use the shared GasFeeModalContext/ConfirmContext flow (including a currentConfirmationOverride) so gas editing can be opened from this modal without useConfirmContext provider errors, and aligns fee/timing display with the main confirmation UI.

Strengthens replacement-transaction behavior by persisting previousGas on modal open and introducing getGasValuesForReplacement() to enforce minimum maxFeePerGas/maxPriorityFeePerGas based on previousGas × (CANCEL_RATE|SPEED_UP_RATE), preventing underpriced cancel/speed-up submissions.

Updates gas UI components to be more context-optional (e.g., useDappSwapContextOptional, NetworkStatistics fallback estimates, GasTiming labeling/override), adds new hooks/tests and e2e coverage for the modal, and expands MV3 LavaMoat policies for additional transaction/gas-related packages.

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

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Mar 10, 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 Mar 10, 2026

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (21 files, +776 -251)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 cancel-speedup/
          • 📄 cancel-speedup.test.tsx +93 -52
          • 📄 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 +28 -5
            • 📄 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

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

📜 @MetaMask/policy-reviewers (4 files, +308 -4)
  • 📁 lavamoat/
    • 📁 webpack/
      • 📁 mv3/
        • 📁 beta/
          • 📄 policy.json +77 -1
        • 📁 experimental/
          • 📄 policy.json +77 -1
        • 📁 flask/
          • 📄 policy.json +77 -1
        • 📁 main/
          • 📄 policy.json +77 -1

Tip

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


🧪 @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 Mar 10, 2026

Builds ready [d67145b]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account31927836438350364
total31927836438350364
Confirm Txconfirm_tx6161614761691061696169
total6161614761691061696169
Bridge User Actionsbridge_load_page26221429230283292
bridge_load_asset_picker22116727837237278
bridge_search_token73671675113750751
total1227121012461512461246
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14291194199411714881615
load1195999166610112491350
domContentLoaded1188995165410112441341
domInteractive2917122192571
firstPaint159701193130211278
backgroundConnect21319426213215243
firstReactRender19124652129
initialActions105124
loadScripts992804144610010441146
setupStore1363651521
numNetworkReqs312295202284
Power User HomeuiStartup20341679262517021182344
load11891048189017311701701
domContentLoaded11731035178616411541658
domInteractive39201862938108
firstPaint196761802187228363
backgroundConnect30626348833317365
firstReactRender25176282739
initialActions108113
loadScripts95482715401589361430
setupStore1785471931
numNetworkReqs78362845284172
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172222220222
srpButtonToSrpForm96949929699
confirmSrpToPwForm22222312323
pwFormToMetricsScreen16161701617
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen66459873661714736
openAccountMenuToAccountListLoaded293929322947629472947
total4012392241247540554124
Onboarding New WalletcreateWalletToSocialScreen2202182222221222
srpButtonToPwForm1071051081108108
createPwToRecoveryScreen888088
skipBackupToMetricsScreen35343613636
agreeButtonToOnboardingSuccess16151601616
doneButtonToAssetList71348310492259111049
total1100870143322312951433
Asset DetailsassetClickToPriceChart13210516722138167
total13210516722138167
Solana Asset DetailsassetClickToPriceChart78708358383
total78708358383
Import Srp HomeloginToHomeScreen21762002247618823202476
openAccountMenuAfterLogin633890197290
homeAfterImportWithNewWallet2401229025128024392512
total46414435492319948364923
Send TransactionsopenSendPageFromHome20133372433
selectTokenToSendFormLoaded19182011920
reviewTransactionToConfirmationPage86684590223884902
total90588393319919933
SwapopenSwapPageFromHome531979217279
fetchAndDisplaySwapQuotes268226802684226822684
total2746273627591027542759
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±44ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±41ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±11ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 44ms 1.02s 1.37s 1.09s 1.37s
domContentLoaded 739ms 41ms 714ms 1.04s 768ms 1.04s
firstPaint 81ms 11ms 64ms 176ms 88ms 176ms
firstContentfulPaint 81ms 11ms 64ms 176ms 88ms 176ms
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%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [f8b973b]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28626530415294304
total28626530415294304
Confirm Txconfirm_tx6031600460692560526069
total6031600460692560526069
Bridge User Actionsbridge_load_page22119525926246259
bridge_load_asset_picker20817625428225254
bridge_search_token74170078635770786
total1170108212417012351241
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14211232191711214531624
load1183101016019512171362
domContentLoaded117699315659312121340
domInteractive281886162577
firstPaint164691372177197296
backgroundConnect21119326212212241
firstReactRender18133032023
initialActions107124
loadScripts98180213569010131141
setupStore1374761521
numNetworkReqs312289192282
Power User HomeuiStartup3102171813168207538674995
load12941104184017113521678
domContentLoaded12731091182716413291630
domInteractive37191592635114
firstPaint244781840231302384
backgroundConnect105027210823165212012943
firstReactRender26176682740
initialActions105114
loadScripts1047880160415710941368
setupStore1573751826
numNetworkReqs873621544104178
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192162232219223
srpButtonToSrpForm93929419394
confirmSrpToPwForm22212312223
pwFormToMetricsScreen15151601516
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen62858971448644714
openAccountMenuToAccountListLoaded2907289429361729022936
total3881385339252938893925
Onboarding New WalletcreateWalletToSocialScreen2202182221221222
srpButtonToPwForm1091071111110111
createPwToRecoveryScreen888088
skipBackupToMetricsScreen35333713637
agreeButtonToOnboardingSuccess16151701617
doneButtonToAssetList55547367675603676
total9458641064759941064
Asset DetailsassetClickToPriceChart12810916119135161
total12810916119135161
Solana Asset DetailsassetClickToPriceChart81758858388
total81758858388
Import Srp HomeloginToHomeScreen2035196120975520962097
openAccountMenuAfterLogin68657347073
homeAfterImportWithNewWallet2484236026118625422611
total45834485475510346464755
Send TransactionsopenSendPageFromHome342157133957
selectTokenToSendFormLoaded19172121921
reviewTransactionToConfirmationPage8468458471847847
total8938899046892904
SwapopenSwapPageFromHome36274364343
fetchAndDisplaySwapQuotes2699268227181427112718
total273527252744827432744
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±43ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 749ms (±40ms) 🟢 | historical mean value: 735ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±11ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 43ms 1.03s 1.36s 1.11s 1.36s
domContentLoaded 749ms 40ms 721ms 1.03s 778ms 1.03s
firstPaint 83ms 11ms 68ms 176ms 100ms 176ms
firstContentfulPaint 83ms 11ms 68ms 176ms 100ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.22 MiB (100%)
  • common: 10.99 MiB (100%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [3d4bdab]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2782732823279282
total2782732823279282
Confirm Txconfirm_tx6066603760841960816084
total6066603760841960816084
Bridge User Actionsbridge_load_page2122092163216216
bridge_load_asset_picker19317920310203203
bridge_search_token7167107204717720
total111311081122511131122
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14541207188511515131648
load12161008166510612731382
domContentLoaded12061000157010012661362
domInteractive3016120202579
firstPaint1557049081210282
backgroundConnect22019740028223262
firstReactRender2111159152234
initialActions108124
loadScripts100780613599910651161
setupStore1373251521
numNetworkReqs312287192582
Power User HomeuiStartup2413169211223137722704470
load11981037172116212081598
domContentLoaded11811028170215311961551
domInteractive3820159223883
firstPaint1717545783230315
backgroundConnect52126158599193341596
firstReactRender2617154152740
initialActions108113
loadScripts96581514721449841329
setupStore1664871730
numNetworkReqs77362404979185
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172212221221
srpButtonToSrpForm98969919899
confirmSrpToPwForm22222312323
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen17161711717
doneButtonToHomeScreen65359972248679722
openAccountMenuToAccountListLoaded293129192936729352936
total3950390640295039584029
Onboarding New WalletcreateWalletToSocialScreen2192172191219219
srpButtonToPwForm1091031144111114
createPwToRecoveryScreen888088
skipBackupToMetricsScreen36353813638
agreeButtonToOnboardingSuccess16151711617
doneButtonToAssetList64161866318653663
total1027100010511910371051
Asset DetailsassetClickToPriceChart13311216318137163
total13311216318137163
Solana Asset DetailsassetClickToPriceChart947912216104122
total947912216104122
Import Srp HomeloginToHomeScreen1902186319734419021973
openAccountMenuAfterLogin523770146770
homeAfterImportWithNewWallet26132395298521526992985
total46734368493021748714930
Send TransactionsopenSendPageFromHome23183262732
selectTokenToSendFormLoaded19181901919
reviewTransactionToConfirmationPage994848111511910811115
total1036885116511911191165
SwapopenSwapPageFromHome24202722527
fetchAndDisplaySwapQuotes268726812693426892693
total270927042714427122714
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±42ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±38ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±11ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 42ms 1.02s 1.33s 1.09s 1.33s
domContentLoaded 733ms 38ms 709ms 1.00s 778ms 1.00s
firstPaint 82ms 11ms 68ms 176ms 92ms 176ms
firstContentfulPaint 82ms 11ms 68ms 176ms 92ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.22 MiB (100%)
  • common: 10.99 MiB (100%)

@vinistevam vinistevam marked this pull request as ready for review March 10, 2026 12:32
@vinistevam vinistevam requested review from a team as code owners March 10, 2026 12:32
@cryptotavares
Copy link
Contributor

Review — posted on behalf of @cryptotavares

I reviewed this PR as part of tracking Q1 confirmation work. Architecture in issue-7051 was written by the implementor and has no recorded team sign-off or discussion comments. The spec is detailed, but there is no evidence of collaborative pre-approval before 4 reviewer teams were engaged. The confirmations team review is especially critical here.

Beyond the process concern, the diff contains two bugs that I believe will block users from submitting cancel/speedup on production:


BUG 1 — HIGH: EIP-1559 cancel/speedup confirm button permanently disabled

File: ui/pages/confirmations/hooks/useCancelSpeedupInitialGas.ts (approx. line 70)

const hasEIP1559Gas =
  txParams?.maxFeePerGas &&
  txParams?.maxPriorityFeePerGas &&
  txParams?.gasLimit;   // ← wrong field

txParams.gasLimit is typically undefined on real transactions — the field is txParams.gas. Because hasEIP1559Gas evaluates falsy, updatePreviousGasParams is never dispatched, effectiveTransaction.previousGas is never populated, and the Confirm button (disabled={!effectiveTransaction.previousGas}) stays permanently disabled for EIP-1559 transactions.

The fix is already demonstrated elsewhere in the same PR (useCancelSpeedupGasState.ts uses txParams?.gasLimit ?? txParams?.gas correctly). The guard should be:

txParams?.gasLimit ?? txParams?.gas

BUG 2 — HIGH: Legacy (non-EIP-1559) cancel/speedup always blocked

Same hasEIP1559Gas path: for gasPrice-only transactions (BSC, any non-EIP-1559 network), maxFeePerGas and maxPriorityFeePerGas are absent, so the condition is always falsy, previousGas is never set, and the Confirm button is permanently disabled. Users on non-EIP-1559 chains cannot cancel or speed up transactions at all after this PR.

A separate path is needed to set previousGas for legacy transactions using gasPrice.


BUG 3 — MEDIUM: Tests assert known-wrong fee values

File: ui/pages/confirmations/cancel-speedup/cancel-speedup.test.tsx (approx. lines 423–424)

The test file contains inline comments acknowledging that the expected fee constants are incorrect (the author notes the intended values should be higher). Merging these tests locks in a broken fee display as the regression baseline. Either fix the underlying fee calculation and update the constants, or do not assert specific fee strings until the logic is correct.


Minor: Dead state

File: ui/pages/confirmations/hooks/useCancelSpeedupGasState.ts (approx. line 2023)

retryTxMeta state is written but never read — effectiveTransaction is derived entirely from Redux. Cosmetic, but could mislead maintainers.


Bugs 1 and 2 together mean the cancel/speedup flow would be broken for all users on both EIP-1559 and legacy networks. Would recommend blocking merge until these are resolved.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [c72ecd4]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2742662846277284
total2742662846277284
Confirm Txconfirm_tx6043603460581060516058
total6043603460581060516058
Bridge User Actionsbridge_load_page23520429634248296
bridge_load_asset_picker23422124410244244
bridge_search_token74273075512752755
total1226116312884812741288
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14301231181210814591624
load1207101214809412481387
domContentLoaded1200100614759312431376
domInteractive271687182476
firstPaint180711270172223367
backgroundConnect21519627512216240
firstReactRender18123551929
initialActions105113
loadScripts100180612689210441176
setupStore1364261523
numNetworkReqs312297202285
Power User HomeuiStartup39121900127292548434511240
load12921110174814513381661
domContentLoaded12731081172713613261614
domInteractive38201702737103
firstPaint215911638167279371
backgroundConnect14452869841197214586122
firstReactRender26164962936
initialActions105113
loadScripts1046858149912910861375
setupStore1465071622
numNetworkReqs1005022841107202
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182232222223
srpButtonToSrpForm95929829598
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151601516
metricsToWalletReadyScreen17161701717
doneButtonToHomeScreen62060564515616645
openAccountMenuToAccountListLoaded291129052917529122917
total3914389339421939173942
Onboarding New WalletcreateWalletToSocialScreen2182172181218218
srpButtonToPwForm1111101131112113
createPwToRecoveryScreen999099
skipBackupToMetricsScreen38364013840
agreeButtonToOnboardingSuccess17171701717
doneButtonToAssetList52849858333518583
total93989597938976979
Asset DetailsassetClickToPriceChart1245618344160183
total1245618344160183
Solana Asset DetailsassetClickToPriceChart77758027780
total77758027780
Import Srp HomeloginToHomeScreen20491874239520021542395
openAccountMenuAfterLogin45415354753
homeAfterImportWithNewWallet26252364306027226433060
total44254335458711545874587
Send TransactionsopenSendPageFromHome24173163031
selectTokenToSendFormLoaded301848113748
reviewTransactionToConfirmationPage1184845174633412971746
total1244883181234813971812
SwapopenSwapPageFromHome301657163957
fetchAndDisplaySwapQuotes268526852686026862686
total2716270127421527202742
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±55ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 759ms (±53ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±12ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 55ms 1.04s 1.37s 1.12s 1.37s
domContentLoaded 759ms 53ms 723ms 1.05s 794ms 1.05s
firstPaint 83ms 12ms 64ms 192ms 92ms 192ms
firstContentfulPaint 83ms 12ms 64ms 192ms 92ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.23 MiB (100%)
  • common: 10.99 MiB (100%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 11, 2026

Builds ready [bd1817d]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account27726531019267310
total27726531019267310
Confirm Txconfirm_tx606360526071860706071
total606360526071860706071
Bridge User Actionsbridge_load_page24219730039269300
bridge_load_asset_picker19311725349239253
bridge_search_token71469675825702758
total11871061144314412491443
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup13771152168810214121572
load114193414099311741331
domContentLoaded113392913989011651303
domInteractive2816102192580
firstPaint169641206127199332
backgroundConnect20017824713205221
firstReactRender19136171932
initialActions106114
loadScripts9517541201899881121
setupStore1374261525
numNetworkReqs362796202789
Power User HomeuiStartup53492185161433412579815686
load12951141200814113341546
domContentLoaded12751130198013213161517
domInteractive3521232323266
firstPaint1858639381259328
backgroundConnect217431313453288223359768
firstReactRender27175263040
initialActions105113
loadScripts1051915167012110881290
setupStore1667281832
numNetworkReqs1324827044141235
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172201218220
srpButtonToSrpForm95939929699
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16151711617
metricsToWalletReadyScreen16151601616
doneButtonToHomeScreen64459869944674699
openAccountMenuToAccountListLoaded29342769310311929483103
total3895384939343239143934
Onboarding New WalletcreateWalletToSocialScreen2202192221221222
srpButtonToPwForm1111091132112113
createPwToRecoveryScreen999099
skipBackupToMetricsScreen39384114041
agreeButtonToOnboardingSuccess18171801818
doneButtonToAssetList58150667366634673
total98090910686410341068
Asset DetailsassetClickToPriceChart13510018630141186
total13510018630141186
Solana Asset DetailsassetClickToPriceChart81699498294
total81699498294
Import Srp HomeloginToHomeScreen2191212122866422112286
openAccountMenuAfterLogin644880127680
homeAfterImportWithNewWallet2350226524808823802480
total4607447147068746504706
Send TransactionsopenSendPageFromHome29243543335
selectTokenToSendFormLoaded25213042930
reviewTransactionToConfirmationPage1404129915087414161508
total1465134515708114891570
SwapopenSwapPageFromHome28213973439
fetchAndDisplaySwapQuotes268826822696526902696
total271227032719627162719
🌐 Dapp Page Load Benchmarks

Current Commit: bd1817d | Date: 3/11/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±75ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 743ms (±72ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±14ms) 🟢 | historical mean value: 84ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 75ms 1.01s 1.35s 1.27s 1.35s
domContentLoaded 743ms 72ms 706ms 1.03s 950ms 1.03s
firstPaint 80ms 14ms 64ms 200ms 92ms 200ms
firstContentfulPaint 80ms 14ms 64ms 200ms 92ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.27 MiB (100%)
  • common: 11 MiB (100%)

@pedronfigueiredo pedronfigueiredo self-requested a review March 11, 2026 15:43
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.

Fix All in Cursor

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

const speedUpCancelModal = new SpeedUpAndCancelModal(driver);
await speedUpCancelModal.waitForModal();
await speedUpCancelModal.checkSpeedUpTitleVisible();
await speedUpCancelModal.checkSpeedRowShowsSiteSuggested();
Copy link

Choose a reason for hiding this comment

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

E2E test asserts transient "Site suggested" before gas update

Medium Severity

checkSpeedRowShowsSiteSuggested() asserts "Site suggested" in the speed row, but useCancelSpeedupInitialGas applies the initial gas rule on modal open, which changes userFeeLevel from dappSuggested to medium or tenPercentIncreased. The assertion only passes because it catches the transient first-render state before the store update propagates. This makes the E2E tests flaky — if the Redux update completes before the waitForSelector check, the text will already be "Medium" or "⬆ 10% increase" and the test will timeout.

Additional Locations (1)
Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 16, 2026

Builds ready [6fe2d50]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29527433424310334
total29527433424310334
Confirm Txconfirm_tx602560156034760296034
total602560156034760296034
Bridge User Actionsbridge_load_page2362252468242246
bridge_load_asset_picker27325328412283284
bridge_search_token7647557705768770
total1262119713003612881300
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15041286171410215651681
load1242103614239613091406
domContentLoaded1236103214189512991400
domInteractive311893192884
firstPaint1547238772215250
backgroundConnect22020126513225250
firstReactRender21135262232
initialActions105125
loadScripts103283712079210941191
setupStore1375371522
numNetworkReqs393183154077
Power User HomeuiStartup5458207717746275264458774
load12771077182812713211519
domContentLoaded12571068169311812921483
domInteractive40203284232115
firstPaint230751707201266398
backgroundConnect207530314287229632964850
firstReactRender24176662532
initialActions104113
loadScripts1040861145111210771252
setupStore1465571629
numNetworkReqs1406533341144229
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182182190219219
srpButtonToSrpForm95939619596
confirmSrpToPwForm23222402324
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161701717
doneButtonToHomeScreen64959470543674705
openAccountMenuToAccountListLoaded28042505310624829633106
total3942389239853839853985
Onboarding New WalletcreateWalletToSocialScreen2192192190219219
srpButtonToPwForm1101081111110111
createPwToRecoveryScreen889089
skipBackupToMetricsScreen38374013940
agreeButtonToOnboardingSuccess16161701617
doneButtonToAssetList634487988194698988
total1021875136218910941362
Asset DetailsassetClickToPriceChart804614137103141
total804614137103141
Solana Asset DetailsassetClickToPriceChart14411317924156179
total14411317924156179
Import Srp HomeloginToHomeScreen2313224423756123722375
openAccountMenuAfterLogin67441012489101
homeAfterImportWithNewWallet1754534285798623982857
total42853060533181647135331
Send TransactionsopenSendPageFromHome442759145559
selectTokenToSendFormLoaded29213353233
reviewTransactionToConfirmationPage1109857133119412951331
total1184945141219513731412
SwapopenSwapPageFromHome1114417751147177
fetchAndDisplaySwapQuotes268726862688126882688
total2799274128654928332865
🌐 Dapp Page Load Benchmarks

Current Commit: 6fe2d50 | Date: 3/16/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±42ms) 🟡 | historical mean value: 1.06s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 747ms (±39ms) 🟢 | historical mean value: 747ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±13ms) 🟢 | historical mean value: 85ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 42ms 1.02s 1.36s 1.11s 1.36s
domContentLoaded 747ms 39ms 714ms 1.03s 784ms 1.03s
firstPaint 82ms 13ms 60ms 196ms 92ms 196ms
firstContentfulPaint 82ms 13ms 60ms 196ms 92ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 58 Bytes (0%)
  • ui: -46.23 KiB (-0.54%)
  • common: 20 Bytes (0%)

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

Labels

size-XL team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants