Skip to content

Conversation

@Julink-eth
Copy link
Contributor

@Julink-eth Julink-eth commented Jan 15, 2026

Description

Context
Gas sponsorship on certain networks (like Monad) has reserve balance requirements. When a transaction simulation fails due to reserve balance violations, users currently don't receive clear feedback about why sponsorship isn't available.

Problem
Users on networks with gas sponsorship reserve requirements (e.g., Monad requires 10 MON minimum) don't see any warning when their transaction can't be sponsored due to insufficient reserve balance.

Solution
Added a new useGasSponsorshipWarningAlerts hook that:
Checks simulationData.callTraceErrors for known sponsorship failure patterns
Uses a configurable rules system (GAS_SPONSORSHIP_WARNING_RULES) to match chain-specific error patterns
Displays a Severity.Warning alert on the EstimatedFee row when sponsorship fails due to reserve balance violations
Currently configured for Monad (10 MON minimum reserve requirement)

Related Core PR : MetaMask/core#7641

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Added a warning message when gas sponsorship is unavailable due to reserve balance requirements.

Related issues

Fixes:

Manual testing steps

  1. Connect to Monad
  2. Ensure account has less than 10 MON balance
  3. Initiate a contract interaction transaction
  4. Observe the warning alert on the confirmation screen stating "Gas sponsorship isn't available for this transaction. You'll need to keep at least 10 MON in your account."

Screenshots/Recordings

Before

After

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

Adds a new warning surfaced in transaction confirmations when sponsorship is unavailable based on simulation call trace errors.

  • New hook useGasSponsorshipWarningAlerts checks simulationData.callTraceErrors and networkConfigurationsByChainId to show a Severity.Warning on EstimatedFee (currently for MONAD with 10 nativeCurrency minimum)
  • Integrated into useConfirmationAlerts so it appears with other transaction alerts
  • Added i18n key gasSponsorshipReserveBalanceWarning in en and en_GB
  • Unit tests for useGasSponsorshipWarningAlerts validate no-op cases and the Monad reserve balance warning

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

@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 Jan 15, 2026

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (3 files, +249 -0)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 alerts/
            • 📁 transactions/
              • 📄 useGasSponsorshipWarningAlerts.test.ts +132 -0
              • 📄 useGasSponsorshipWarningAlerts.ts +113 -0
            • 📄 useConfirmationAlerts.ts +4 -0

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 15, 2026

Builds ready [513723d]
UI Startup Metrics (1269 ± 111 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12691033162011113411412
load--1059855134610111191238
domContentLoaded--1053851133710111151232
domInteractive--251590172175
firstPaint--170631135177190312
backgroundConnect--2121922499217228
firstReactRender--1594251624
getState--3719131144162
initialActions--109112
loadScripts--84765411381008991025
setupStore--1172231317
numNetworkReqs--171178171171
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18811628249219720042327
load--1036898149613210501409
domContentLoaded--1023893149213210381385
domInteractive--35191382733115
firstPaint--221711453257231368
backgroundConnect--262202607104237559
firstReactRender--22176262328
getState--18012971460195230
initialActions--104111
loadScripts--80968712821308221158
setupStore--19114971938
numNetworkReqs--58381452461121
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--801649117782833961
load--64257794769651789
domContentLoaded--63657294068647779
domInteractive--2616107202278
firstPaint--1066037359139226
backgroundConnect--306110274395
firstReactRender--16113641725
getState--3314146204256
initialActions--105111
loadScripts--63356993266645770
setupStore--1354681433
numNetworkReqs--181177171170
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1369994207623715951829
load--689604128194709876
domContentLoaded--679598127494693865
domInteractive--35171592732107
firstPaint--1426344271190275
backgroundConnect--121765720489551
firstReactRender--23164042531
getState--15312724920160193
initialActions--104111
loadScripts--675595126592690863
setupStore--17104471835
numNetworkReqs--59372163157136
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14181107200721115391846
load--1120945170214112021369
domContentLoaded--1119945170214112021369
domInteractive--67332524188143
firstPaint--------
backgroundConnect--70195778182262
firstReactRender--13103231318
getState--146160191226
initialActions--113122
loadScripts--1075931162010711431265
setupStore--15595161255
numNetworkReqs--19977181374
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25621769553369625634375
load--1214990253224311971656
domContentLoaded--1214990253224311971656
domInteractive--1173546390119368
firstPaint--------
backgroundConnect--126241070176113319
firstReactRender--23157782431
getState--26953785213419726
initialActions--208123
loadScripts--1179969242722711641618
setupStore--1477804197121671
numNetworkReqs--58291683980160
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16051335215215317191859
load--13261148161710214021503
domContentLoaded--13251148161710214021503
domInteractive--912923342126143
firstPaint--------
backgroundConnect--57222124064147
firstReactRender--16116181827
getState--229253351783
initialActions--104122
loadScripts--1293112815899213421457
setupStore--2151542917127
numNetworkReqs--19982191576
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29312228620078129664735
load--16621202322253917592929
domContentLoaded--16611202322253917592929
domInteractive--12131676125106486
firstPaint--------
backgroundConnect--1853213612901391158
firstReactRender--2717115143049
getState--314721022249465848
initialActions--214123
loadScripts--15491181311141517182794
setupStore--1258764162129551
numNetworkReqs--60301654085161
19--------
📊 Page Load Benchmark Results

Current Commit: 513723d | Date: 1/15/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±39ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 713ms (±36ms) 🟢 | historical mean value: 723ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±14ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 39ms 999ms 1.31s 1.05s 1.31s
domContentLoaded 713ms 36ms 691ms 979ms 736ms 979ms
firstPaint 77ms 14ms 60ms 192ms 88ms 192ms
firstContentfulPaint 77ms 14ms 60ms 192ms 88ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.32 KiB (0.03%)
  • common: 265 Bytes (0%)

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

Projects

Status: Needs dev review

Development

Successfully merging this pull request may close these issues.

3 participants