Skip to content

fix: batch sell tx bridge status bump#31098

Merged
infiniteflower merged 2 commits into
mainfrom
fix/batch-sell-tx-bridge-status-bump
Jun 5, 2026
Merged

fix: batch sell tx bridge status bump#31098
infiniteflower merged 2 commits into
mainfrom
fix/batch-sell-tx-bridge-status-bump

Conversation

@infiniteflower

@infiniteflower infiniteflower commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes Batch Sell (and other gasless EIP-7702) transaction submission when Smart Transactions (STX) and send bundle are both enabled.

Problem: Quotes with gasIncluded7702: true must be published via the EIP-7702 delegation relay (Delegation7702PublishHook). When STX and send bundle were enabled, publishHook skipped the 7702 path and submitted via STX instead, causing transaction failures.

Changes:

  1. @metamask/bridge-status-controller ^72.0.0^72.0.2 — picks up the controller fix for the batch-sell submission edge case when gasIncluded7702=true and STX is enabled (see package changelog for parameter changes).
  2. TransactionController publishHook — when transactionMeta.isGasFeeIncluded is true (set by bridge-status-controller for gasless-7702 quotes), attempt Delegation7702PublishHook before STX even if STX and send bundle are supported. Aligns with extension client behavior (isSwapGasIncluded7702).

Motivation: The quote/backend contract requires 7702 processing; routing through STX was incorrect for this case.

Changelog

CHANGELOG entry: Fixed Batch Sell transactions failing to submit when gas-included EIP-7702 quotes were used with Smart Transactions enabled

Related issues

Refs: MetaMask/core#8979

Manual testing steps

Feature: Batch Sell gas-included 7702 submission with Smart Transactions

  Scenario: Batch Sell submits successfully when gas is included via 7702 and STX is enabled
    Given I have an EVM account that supports EIP-7702
    And Smart Transactions are enabled on a chain that supports send bundle
    And Batch Sell is available with multiple eligible source tokens
    And quotes return with gas included via 7702 (network fee shown as included / gasIncluded7702)

    When I complete Batch Sell review and submit Sell All
    Then transactions submit without failure
    And I am not blocked by incorrect STX-only submission for gasless-7702 quotes

  Scenario: Normal STX gas-included swap still uses Smart Transactions when isGasFeeIncluded is not set
    Given Smart Transactions and send bundle are enabled
    And I initiate a swap with STX gas-included (not gasIncluded7702 / no isGasFeeIncluded on tx meta)

    When I confirm and submit the transaction
    Then submission still goes through the Smart Transactions path as before

Commands run locally:

yarn jest app/core/Engine/controllers/transaction-controller/transaction-controller-init.test.ts -t "7702 delegation hook"

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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 transaction submission routing for a specific meta flag; wrong routing could affect Batch Sell and gasless-7702 swaps, but scope is narrow and covered by a new unit test.

Overview
Fixes Batch Sell and other gas-included EIP-7702 flows failing when Smart Transactions (STX) and send bundle are both on.

publishHook now treats transactionMeta.isGasFeeIncluded (gasless-7702 quotes from bridge status) like extension’s isSwapGasIncluded7702: it tries Delegation7702PublishHook before STX even when STX and bundle would otherwise win. A unit test asserts the 7702 hook runs and STX is skipped when isGasFeeIncluded is true.

@metamask/bridge-status-controller is bumped ^72.0.0 → ^72.0.2 so tx meta and submission align with the gas-included-7702 contract; yarn.lock reflects related transitive package updates.

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

@github-actions

github-actions Bot commented Jun 4, 2026

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.

@infiniteflower infiniteflower changed the title Fix/batch sell tx bridge status bump fix: batch sell tx bridge status bump Jun 4, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added team-swaps-and-bridge Swaps and Bridge team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 4, 2026
@infiniteflower infiniteflower marked this pull request as ready for review June 4, 2026 18:51
@infiniteflower infiniteflower requested a review from a team as a code owner June 4, 2026 18:51
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller. Running all tests.

View GitHub Actions results

@github-actions github-actions Bot added size-S risk:high AI analysis: high risk labels Jun 4, 2026
@infiniteflower infiniteflower enabled auto-merge June 5, 2026 14:06
@mm-token-exchange-service mm-token-exchange-service Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 5, 2026
@infiniteflower infiniteflower added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit 0ea45fe Jun 5, 2026
398 of 440 checks passed
@infiniteflower infiniteflower deleted the fix/batch-sell-tx-bridge-status-bump branch June 5, 2026 14:58
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 5, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.82.0 Issue or pull request that will be included in release 7.82.0 label Jun 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.82.0 Issue or pull request that will be included in release 7.82.0 risk:high AI analysis: high risk size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants