Skip to content

feat: gas sponsorship improve alerts and remove gas alert#42300

Merged
maxime-oe merged 5 commits into
mainfrom
feat/gas-sponsorship-remove-gas-alerts
May 14, 2026
Merged

feat: gas sponsorship improve alerts and remove gas alert#42300
maxime-oe merged 5 commits into
mainfrom
feat/gas-sponsorship-remove-gas-alerts

Conversation

@maxime-oe

@maxime-oe maxime-oe commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Description

This PR contains two fixes related to Gas Sponsorship alerts:

  • Removes a gas-estimate-related alert for when a transaction will fail in a gasless transaction. Avoids the "double alert" and drops the modal prompting user to change their "gas limit" which doesn't make sense in gasless flows.
  • Changes the copy and severity of the specific 10 MON reserve alert - when a tx would bring the balance of the user below the 10 MON minimum imposed by the Monad network - making sure the user is aware when this condition happens and cannot proceed with the tx - which will always fail in those conditions.

Changelog

CHANGELOG entry: remove gas alerts from confirmation modal in gasless flows
CHANGELOG entry: update copy of 10 MON minimal reserve confirmation alert

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/NEB-951?atlOrigin=eyJpIjoiMDBmNDlhY2E5ZDZiNGQ0NGIwYzNkZGEwMWQ4Y2QxZjYiLCJwIjoiaiJ9

Manual testing steps

Test 1, send MON beyond 10 MON reserve:

On Monad (gas sponsored, but 10 MON reserve limit), try to send:

  • Max MON.
  • Max MON - 1.
  • Max MON - 10.
  • Max MON -9.999

Observe that the 10 MON error message is always displayed first, as opposed as before, and that user cannot proceed with the transaction.

Test 2, removal of network fee warnings:

  1. On SEI network, open a transaction confirmation for a transaction that will fail - for example call "pause" on USDC (will fail since you are not admin of the token) -> https://seiscan.io/token/0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392#writeProxyContract
  2. Observe presence or absence of irrelevant warnings: "Transaction likely to fail" should show up, but not the "Network fee" alert since it is irrelevant in gasless.

Screenshots/Recordings

Before

Failing tx on SEI:
image

Send MON beyond 10 MON reserve:
image

After

Failing tx on SEI:
image

Send MON beyond 10 MON reserve:
image

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
Changes confirmation alert gating and severity for gasless/sponsored transactions; incorrect conditions could hide or block critical user warnings during transaction confirmation.

Overview
Avoids showing the gasEstimateFailed network-fee alert when the gasless support check is pending or when gasless is supported, preventing irrelevant “update gas limit” prompts in gasless/sponsored flows.

Reworks the Monad gas sponsorship reserve warning into a blocking Severity.Danger alert (gasSponsorshipAlert) with a Buy native token action and updated, reserve-focused copy/reason, and updates related i18n strings (adds alertMinimumReserve, removes alertReasonGasSponsorshipUnavailable, and tweaks reserve wording).

Reviewed by Cursor Bugbot for commit afbc28c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-networks PRs from the Networks team label Apr 30, 2026
@metamaskbotv2

metamaskbotv2 Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (4 files, +123 -28)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 alerts/
            • 📁 transactions/
              • 📄 useGasEstimateFailedAlerts.test.ts +77 -12
              • 📄 useGasEstimateFailedAlerts.tsx +12 -2
              • 📄 useGasSponsorshipWarningAlerts.test.ts +16 -8
              • 📄 useGasSponsorshipWarningAlerts.ts +18 -6

@maxime-oe maxime-oe marked this pull request as ready for review April 30, 2026 15:51
@maxime-oe maxime-oe requested a review from a team as a code owner April 30, 2026 15:51
Comment thread ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts Outdated
@maxime-oe maxime-oe force-pushed the feat/gas-sponsorship-remove-gas-alerts branch from 41fa35b to aa3ad19 Compare April 30, 2026 16:05
Comment thread ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts Outdated
@maxime-oe maxime-oe force-pushed the feat/gas-sponsorship-remove-gas-alerts branch from aa3ad19 to 952d8e1 Compare April 30, 2026 16:13
@github-actions github-actions Bot added size-M and removed size-S labels Apr 30, 2026
@maxime-oe maxime-oe force-pushed the feat/gas-sponsorship-remove-gas-alerts branch from 952d8e1 to c234e5a Compare April 30, 2026 16:31
@maxime-oe maxime-oe force-pushed the feat/gas-sponsorship-remove-gas-alerts branch from c234e5a to 62ed846 Compare April 30, 2026 16:39
Comment thread ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts Outdated
@maxime-oe maxime-oe force-pushed the feat/gas-sponsorship-remove-gas-alerts branch from 62ed846 to 61a49e4 Compare April 30, 2026 16:50
@metamaskbotv2

metamaskbotv2 Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor
Builds ready [61a49e4]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 25178041010 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 517 Bytes (0.01%)
  • ui: 10.35 KiB (0.12%)
  • common: 1.18 KiB (0.01%)

@metamaskbotv2

metamaskbotv2 Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor
Builds ready [d903558]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25447788869 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 6.06 MiB (100%)
  • ui: 8.5 MiB (100%)
  • common: 13.23 MiB (100%)

Julink-eth
Julink-eth previously approved these changes May 6, 2026
Comment thread app/_locales/en/messages.json Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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.

Reviewed by Cursor Bugbot for commit e331749. Configure here.

Comment thread package.json Outdated
@sonarqubecloud

Copy link
Copy Markdown

@metamaskbotv2

metamaskbotv2 Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor
Builds ready [afbc28c]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 10 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25786852971 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -66%
  • loadNewAccount/total: -66%
  • bridgeUserActions/bridge_load_page: -38%
  • bridgeUserActions/bridge_load_asset_picker: -60%
  • bridgeUserActions/bridge_search_token: -29%
  • bridgeUserActions/total: -35%
  • loadNewAccount/load_new_account: -73%
  • loadNewAccount/total: -73%
  • bridgeUserActions/bridge_load_page: +28%
  • bridgeUserActions/bridge_load_asset_picker: -11%
  • bridgeUserActions/bridge_search_token: -32%
  • bridgeUserActions/total: -10%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -17%
  • startupStandardHome/load: -12%
  • startupStandardHome/domContentLoaded: -12%
  • startupStandardHome/firstPaint: -16%
  • startupStandardHome/backgroundConnect: -36%
  • startupStandardHome/firstReactRender: -19%
  • startupStandardHome/loadScripts: -11%
  • startupStandardHome/numNetworkReqs: -50%
  • startupPowerUserHome/uiStartup: -29%
  • startupPowerUserHome/firstPaint: -22%
  • startupPowerUserHome/numNetworkReqs: -66%
  • startupStandardHome/uiStartup: -14%
  • startupStandardHome/domInteractive: -35%
  • startupStandardHome/backgroundConnect: -12%
  • startupStandardHome/initialActions: -40%
  • startupStandardHome/setupStore: -58%
  • startupStandardHome/numNetworkReqs: -45%
  • startupPowerUserHome/uiStartup: -45%
  • startupPowerUserHome/load: -19%
  • startupPowerUserHome/domContentLoaded: -19%
  • startupPowerUserHome/domInteractive: -78%
  • startupPowerUserHome/backgroundConnect: -71%
  • startupPowerUserHome/firstReactRender: -14%
  • startupPowerUserHome/loadScripts: -18%
  • startupPowerUserHome/setupStore: -89%
  • startupPowerUserHome/numNetworkReqs: -74%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 504ms
  • 🟡 startupPowerUserHome/LCP: p75 2.8s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
assetDetails
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
swap
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -85%
  • onboardingImportWallet/pwFormToMetricsScreen: +561%
  • onboardingImportWallet/metricsToWalletReadyScreen: -26%
  • onboardingImportWallet/doneButtonToHomeScreen: -81%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +23%
  • onboardingImportWallet/total: -45%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/createPwToRecoveryScreen: +1121%
  • onboardingNewWallet/skipBackupToMetricsScreen: -66%
  • onboardingNewWallet/doneButtonToAssetList: -43%
  • onboardingNewWallet/total: -35%
  • assetDetails/assetClickToPriceChart: -33%
  • assetDetails/total: -33%
  • solanaAssetDetails/assetClickToPriceChart: -84%
  • solanaAssetDetails/total: -84%
  • importSrpHome/loginToHomeScreen: -19%
  • importSrpHome/openAccountMenuAfterLogin: -80%
  • importSrpHome/homeAfterImportWithNewWallet: -70%
  • importSrpHome/total: -63%
  • swap/openSwapPageFromHome: -97%
  • swap/fetchAndDisplaySwapQuotes: +36%
  • swap/total: +12%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.9s
  • 🟡 importSrpHome/FCP: p75 2.0s
  • 🟡 sendTransactions/FCP: p75 1.9s
  • 🟡 swap/FCP: p75 1.9s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: +26%
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 236 Bytes (0%)
  • common: -28 Bytes (0%)

@maxime-oe maxime-oe added this pull request to the merge queue May 14, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 14, 2026
@maxime-oe maxime-oe added this pull request to the merge queue May 14, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 14, 2026
@maxime-oe maxime-oe added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit e2178f2 May 14, 2026
204 checks passed
@maxime-oe maxime-oe deleted the feat/gas-sponsorship-remove-gas-alerts branch May 14, 2026 18:50
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbot metamaskbot added the release-13.32.0 Issue or pull request that will be included in release 13.32.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.32.0 Issue or pull request that will be included in release 13.32.0 size-M team-networks PRs from the Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants