Skip to content

feat(STX-356): add logic for gasless bridge with EIP-7702#40354

Merged
rarquevaux merged 2 commits intomainfrom
feat/gasless-bridge-eip-7702
Feb 25, 2026
Merged

feat(STX-356): add logic for gasless bridge with EIP-7702#40354
rarquevaux merged 2 commits intomainfrom
feat/gasless-bridge-eip-7702

Conversation

@rarquevaux
Copy link
Contributor

@rarquevaux rarquevaux commented Feb 24, 2026

This PR adds the logic to enable gasless bridge with EIP-7702. The networks where this will be enabled are controlled via a smart transaction team feature flag defined in the remote config API.

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry: add gasless bridge with EIP-7702

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

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
Changes feature-gating logic for when gasless relay support checks run during bridging, which can affect transaction routing/UX across chains; mitigated by added unit test coverage and being controlled by remote feature flags.

Overview
Adds a new Smart Transactions selector, getGaslessBridgeWith7702EnabledForChain, exposing a remote-config-driven feature flag to control where gasless bridge with EIP-7702 is enabled.

Updates useGasIncluded7702 so gasless 7702 support checks can run for non-swap bridge flows only when this new flag is enabled (while still skipping when send-bundle+STX is active), and switches STX detection to use the bridge selector getIsStxEnabled. Tests are expanded to cover the new gating behavior, non-EVM chain IDs, and decimal-to-hex chainId conversion for relay support checks.

Bumps @metamask/smart-transactions-controller to ^22.6.0 (lockfile updated).

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

@rarquevaux rarquevaux requested a review from a team as a code owner February 24, 2026 00:42
@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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Feb 24, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (2 files, +104 -17)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 hooks/
          • 📄 useGasIncluded7702.test.ts +85 -9
          • 📄 useGasIncluded7702.ts +19 -8

@socket-security
Copy link

socket-security bot commented Feb 24, 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.5.0 ⏵ 22.6.097 +1100100 +198 +150

View full report

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

Builds ready [84ffd3b]
⚡ Performance Benchmarks (1382 ± 92 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2875288293
total2875288293
Confirm Txconfirm_tx61163761306167
total61163761306167
Bridge User Actionsbridge_load_page23835253298
bridge_load_asset_picker21316216235
bridge_search_token72316728753
total11965612611267
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup1382117916479214231561
load116698113878711941334
domContentLoaded115997613828611891325
domInteractive2716132202371
firstPaint166691180158210305
backgroundConnect20218725612205220
firstReactRender19123852126
initialActions108114
loadScripts97378811918610031139
setupStore1363951520
numNetworkReqs312292192282
Chrome Browserify Startup Power User HomeuiStartup17341332407431017842082
load11391004176414511481527
domContentLoaded1121997173914011301453
domInteractive3319182243378
firstPaint190731116119246318
backgroundConnect3002471575136293364
firstReactRender23165482540
initialActions106112
loadScripts92180615031369321253
setupStore1564771830
numNetworkReqs63381552568125
Chrome Webpack Startup Standard HomeuiStartup84869911941009031057
load72861298592786906
domContentLoaded72260597991782883
domInteractive2715101202381
firstPaint1165740770135241
backgroundConnect281867103247
firstReactRender17123651931
initialActions103112
loadScripts72060397790778881
setupStore1153341219
numNetworkReqs3122103212588
Chrome Webpack Startup Power User HomeuiStartup1198934186614912781504
load717635112298709971
domContentLoaded707631110997695962
domInteractive35191372532113
firstPaint1336153073159259
backgroundConnect17413135250206285
firstReactRender22163132428
initialActions103111
loadScripts704629108394693953
setupStore1354061418
numNetworkReqs64331713269155
Firefox Browserify Startup Standard HomeuiStartup16821456253722117122090
load14181201227319514531761
domContentLoaded14161201227219514521761
domInteractive9233932102113162
firstPaint------
backgroundConnect61321952561119
firstReactRender14114231415
initialActions103112
loadScripts13901175223919114271707
setupStore227182311753
numNetworkReqs311995202792
Firefox Browserify Startup Power User HomeuiStartup27342158406141928733566
load15671288224523716762136
domContentLoaded15671287224523716752136
domInteractive11736538100116365
firstPaint------
backgroundConnect27199946224251867
firstReactRender201475111957
initialActions216122
loadScripts15241263219122715962085
setupStore1486782191164533
numNetworkReqs63301873588127
Firefox Webpack Startup Standard HomeuiStartup16831363360831416912046
load14291207328628514451658
domContentLoaded14291207328628514441658
domInteractive833120148130163
firstPaint------
backgroundConnect61203324863170
firstReactRender16122941625
initialActions106122
loadScripts14031193325528014221553
setupStore207179281369
numNetworkReqs311994182781
Firefox Webpack Startup Power User HomeuiStartup27351979417645129483753
load15941235251929917382256
domContentLoaded15941235251829917332255
domInteractive13631789160112547
firstPaint------
backgroundConnect274118979218275877
firstReactRender231577102431
initialActions217123
loadScripts15491214249627016862089
setupStore1707817215236667
numNetworkReqs63301903884132
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2181219221
srpButtonToSrpForm9319394
confirmSrpToPwForm2102122
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1611616
doneButtonToHomeScreen738102752888
openAccountMenuToAccountListLoaded784713778718030
total89533989878998
Onboarding New WalletcreateWalletToSocialScreen2181218219
srpButtonToPwForm1021102104
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3413436
agreeButtonToOnboardingSuccess1501515
doneButtonToAssetList56184647680
total9388510241058
Asset DetailsassetClickToPriceChart3913940
total3913940
Solana Asset DetailsassetClickToPriceChart4614648
total4614648
Import Srp HomeloginToHomeScreen198219220702321
openAccountMenuAfterLogin4654755
homeAfterImportWithNewWallet243117625602654
total431510543604444
Send TransactionsopenSendPageFromHome2693538
selectTokenToSendFormLoaded2022222
reviewTransactionToConfirmationPage86617869892
total90920926931
SwapopenSwapPageFromHome13620152165
fetchAndDisplaySwapQuotes46295946114728
total47617947344893
🌐 Dapp Page Load Benchmarks

Current Commit: 84ffd3b | Date: 2/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±64ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±61ms) 🟢 | historical mean value: 733ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±13ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 64ms 1.01s 1.33s 1.27s 1.33s
domContentLoaded 733ms 61ms 700ms 1.01s 937ms 1.01s
firstPaint 77ms 13ms 60ms 196ms 84ms 196ms
firstContentfulPaint 77ms 13ms 60ms 196ms 84ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 189 Bytes (0%)
  • common: 311 Bytes (0%)

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 1 potential issue.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

Builds ready [d1966de]
⚡ Performance Benchmarks (1410 ± 103 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28314283305
total28314283305
Confirm Txconfirm_tx60612060766085
total60612060766085
Bridge User Actionsbridge_load_page20821225239
bridge_load_asset_picker22814232247
bridge_search_token73010735744
total1157211591159
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14101178169110314671600
load120198814799912651372
domContentLoaded119498114739712511357
domInteractive2917134222487
firstPaint181691220192214369
backgroundConnect21419225615217249
firstReactRender20134662233
initialActions108113
loadScripts99779112799610601166
setupStore1363051523
numNetworkReqs312292202287
Chrome Browserify Startup Power User HomeuiStartup220813179798141019594539
load1096972178214511361357
domContentLoaded1080963166413611151345
domInteractive3117123193181
firstPaint224651546241240443
backgroundConnect56625642917673292428
firstReactRender21154952331
initialActions107112
loadScripts88177414471309171156
setupStore1353751421
numNetworkReqs69391482575127
Chrome Webpack Startup Standard HomeuiStartup89171113391069641069
load7696251065104846935
domContentLoaded7636211053103840928
domInteractive3015128242594
firstPaint12865975107164224
backgroundConnect28186583243
firstReactRender19127992132
initialActions106112
loadScripts7606191045102837926
setupStore1365161423
numNetworkReqs312294202584
Chrome Webpack Startup Power User HomeuiStartup1228945208019412911584
load73164213181157331043
domContentLoaded72263413041157211037
domInteractive38181643136128
firstPaint1456841885173329
backgroundConnect17013433545167291
firstReactRender22173032428
initialActions103111
loadScripts71963212891127191027
setupStore1354061418
numNetworkReqs1184226347139212
Firefox Browserify Startup Standard HomeuiStartup16261383276720216391958
load13691148239716814001559
domContentLoaded13681144239716914001559
domInteractive813332147100146
firstPaint------
backgroundConnect58291392159114
firstReactRender13113931315
initialActions102012
loadScripts13411125229716113731534
setupStore197148261584
numNetworkReqs312095192585
Firefox Browserify Startup Power User HomeuiStartup27312098867373727303679
load15821288657056616142301
domContentLoaded15821288657056616142301
domInteractive14042595110152376
firstPaint------
backgroundConnect3091161285271310951
firstReactRender191467101845
initialActions102122
loadScripts15411265652856115722264
setupStore17171129250135725
numNetworkReqs72341753190126
Firefox Webpack Startup Standard HomeuiStartup16471327310924516711936
load13851127278921714171530
domContentLoaded13851127278921714171529
domInteractive902924049130155
firstPaint------
backgroundConnect61251883664168
firstReactRender16134341624
initialActions103122
loadScripts13601113276821513901474
setupStore206160281457
numNetworkReqs311997192781
Firefox Webpack Startup Power User HomeuiStartup26281909419140128133458
load14881272216720616301928
domContentLoaded14871266216720616291928
domInteractive14137887139141456
firstPaint------
backgroundConnect30610815282902981023
firstReactRender20166762327
initialActions206123
loadScripts14581239213020416001910
setupStore18810856225269677
numNetworkReqs70241823689147
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2170217217
srpButtonToSrpForm9019092
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1511616
doneButtonToHomeScreen111116612581261
openAccountMenuToAccountListLoaded669231067927230
total79937980028108
Onboarding New WalletcreateWalletToSocialScreen2171218219
srpButtonToPwForm1042105107
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3513535
agreeButtonToOnboardingSuccess1511616
doneButtonToAssetList7142578131170
total109625811911553
Asset DetailsassetClickToPriceChart52197177
total52197177
Solana Asset DetailsassetClickToPriceChart4614747
total4614747
Import Srp HomeloginToHomeScreen209517922722334
openAccountMenuAfterLogin4754855
homeAfterImportWithNewWallet240118925432604
total45943246394639
Send TransactionsopenSendPageFromHome30143953
selectTokenToSendFormLoaded2012122
reviewTransactionToConfirmationPage86912883884
total91410921924
SwapopenSwapPageFromHome11512117131
fetchAndDisplaySwapQuotes46072546184641
total47281247384738
🌐 Dapp Page Load Benchmarks

Current Commit: d1966de | Date: 2/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±131ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 749ms (±129ms) 🟢 | historical mean value: 724ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±98ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 131ms 1.02s 2.19s 1.28s 2.19s
domContentLoaded 749ms 129ms 703ms 1.85s 960ms 1.85s
firstPaint 87ms 98ms 64ms 1.06s 92ms 1.06s
firstContentfulPaint 87ms 98ms 64ms 1.06s 92ms 1.06s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 145 Bytes (0%)
  • common: 279 Bytes (0%)

@rarquevaux rarquevaux enabled auto-merge February 24, 2026 19:15
micaelae
micaelae previously approved these changes Feb 24, 2026
ghgoodreau
ghgoodreau previously approved these changes Feb 25, 2026
@rarquevaux rarquevaux dismissed stale reviews from ghgoodreau and micaelae via b53ff5d February 25, 2026 17:36
@rarquevaux rarquevaux force-pushed the feat/gasless-bridge-eip-7702 branch from d1966de to b53ff5d Compare February 25, 2026 17:36
nthpool
nthpool previously approved these changes Feb 25, 2026
@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [a5b87c4]
⚡ Performance Benchmarks (1374 ± 93 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account3024306306
total3024306306
Confirm Txconfirm_tx6044860496056
total6044860496056
Bridge User Actionsbridge_load_page20225230233
bridge_load_asset_picker22746262298
bridge_search_token74037754802
total11686212111230
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup1374116016059314291547
load117698313898912161348
domContentLoaded116897813828612131319
domInteractive2616127202377
firstPaint1446443176197243
backgroundConnect20018324013202232
firstReactRender17122831822
initialActions105113
loadScripts98579411978610351140
setupStore1263651422
numNetworkReqs312294202286
Chrome Browserify Startup Power User HomeuiStartup3117160510534200640418788
load12801066193816313081667
domContentLoaded12621058192915612871638
domInteractive42203474534105
firstPaint239851549213279431
backgroundConnect12822728727184519396298
firstReactRender26165972841
initialActions103112
loadScripts1042855169815110651428
setupStore1784481836
numNetworkReqs824214222100123
Chrome Webpack Startup Standard HomeuiStartup90570713351129601129
load7656201075111833962
domContentLoaded7586161067109828954
domInteractive2817122222382
firstPaint12961910103143246
backgroundConnect29197093345
firstReactRender20114072433
initialActions108112
loadScripts7556141056108826951
setupStore1354261426
numNetworkReqs312295202586
Chrome Webpack Startup Power User HomeuiStartup1336968245428613861997
load7826661452113786997
domContentLoaded7716581441114778983
domInteractive43211643043124
firstPaint1817658192238320
backgroundConnect204145837103186386
firstReactRender25184352632
initialActions102011
loadScripts7686561434112776970
setupStore1254351519
numNetworkReqs1014525136119162
Firefox Browserify Startup Standard HomeuiStartup16891431279424517082124
load14181208236219314551752
domContentLoaded14171205235619314551748
domInteractive84353806493202
firstPaint------
backgroundConnect63272523765134
firstReactRender14124031416
initialActions102012
loadScripts13891183233418714281717
setupStore187158221553
numNetworkReqs321998212790
Firefox Browserify Startup Power User HomeuiStartup27882094767357729453303
load15611280602647815831823
domContentLoaded15611279602647815831823
domInteractive15548593118158398
firstPaint------
backgroundConnect3521161191227442815
firstReactRender20146391931
initialActions106122
loadScripts15241255599247615551797
setupStore15516795191156611
numNetworkReqs833418836102171
Firefox Webpack Startup Standard HomeuiStartup17191413324532117262104
load14451217291529514541628
domContentLoaded14441217291529514541622
domInteractive102291447144131174
firstPaint------
backgroundConnect65252403672129
firstReactRender16122831626
initialActions106122
loadScripts14181191288728814281593
setupStore2471983516109
numNetworkReqs312093172775
Firefox Webpack Startup Power User HomeuiStartup28032011924195228873321
load16431285777183616081996
domContentLoaded16421285777183616071996
domInteractive17252868170166568
firstPaint------
backgroundConnect328118945209404816
firstReactRender22156582330
initialActions206123
loadScripts16031261751281815841963
setupStore16313741193221626
numNetworkReqs83302173896166
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212222223
srpButtonToSrpForm9619797
confirmSrpToPwForm2302324
pwFormToMetricsScreen1601616
metricsToWalletReadyScreen1801818
doneButtonToHomeScreen8832399761298
openAccountMenuToAccountListLoaded780715978358056
total89548490489051
Onboarding New WalletcreateWalletToSocialScreen2192221222
srpButtonToPwForm1042105107
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3513536
agreeButtonToOnboardingSuccess1501516
doneButtonToAssetList61120629629
total9962310171017
Asset DetailsassetClickToPriceChart4114142
total4114142
Solana Asset DetailsassetClickToPriceChart6016162
total6016162
Import Srp HomeloginToHomeScreen19511119611961
openAccountMenuAfterLogin4314545
homeAfterImportWithNewWallet240312425142548
total444016545114688
Send TransactionsopenSendPageFromHome1801919
selectTokenToSendFormLoaded2012021
reviewTransactionToConfirmationPage8587862867
total90716913932
SwapopenSwapPageFromHome1221123123
fetchAndDisplaySwapQuotes46022546124636
total47204447574759
🌐 Dapp Page Load Benchmarks

Current Commit: a5b87c4 | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±76ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 761ms (±73ms) 🟢 | historical mean value: 730ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±13ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 76ms 1.02s 1.37s 1.31s 1.37s
domContentLoaded 761ms 73ms 714ms 1.05s 982ms 1.05s
firstPaint 82ms 13ms 64ms 200ms 92ms 200ms
firstContentfulPaint 82ms 13ms 64ms 200ms 92ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 145 Bytes (0%)
  • common: 279 Bytes (0%)

@rarquevaux rarquevaux added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit 7068538 Feb 25, 2026
338 of 340 checks passed
@rarquevaux rarquevaux deleted the feat/gasless-bridge-eip-7702 branch February 25, 2026 20:09
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2026
@metamaskbot metamaskbot added the release-13.21.0 Issue or pull request that will be included in release 13.21.0 label Feb 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants