Skip to content

fix: cp-8.0.0 require EIP-7702 for sponsored gas transactions#32253

Merged
matthewwalsh0 merged 1 commit into
mainfrom
fix/direct-musd-vault-7702-mobile
Jun 24, 2026
Merged

fix: cp-8.0.0 require EIP-7702 for sponsored gas transactions#32253
matthewwalsh0 merged 1 commit into
mainfrom
fix/direct-musd-vault-7702-mobile

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Description

Sponsored and gas-included transaction publishing depends on the EIP-7702 delegation relay path. Previously, when atomic EIP-7702 support was unavailable for the selected chain, the delegation publish hook returned an empty result, which allowed the publish pipeline to continue to later publication paths.

This PR makes that path fail closed for sponsored and gas-included transactions by throwing a clear error when the chain does not support EIP-7702 atomic batching. Non-sponsored transactions keep the existing empty-result behavior when EIP-7702 is unavailable.

Changelog

CHANGELOG entry: Fixed sponsored and gas-included transactions falling back when EIP-7702 support is unavailable

Related issues

Refs: MetaMask/core#9240

Manual testing steps

N/A - covered by unit tests for the transaction publish hook.

Screenshots/Recordings

N/A

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 publish behavior for gas-sponsored and gas-included flows on chains without EIP-7702, blocking unsafe fallbacks instead of silently continuing.

Overview
Sponsored and gas-included publishes must use the EIP-7702 delegation relay. When atomic batch support is missing for the chain, Delegation7702PublishHook used to return an empty result so later publish hooks could run.

This change throws for isGasFeeSponsored or isGasFeeIncluded when the chain is not EIP-7702-capable, with a clear error (prefixed as Gas Station 7702:). Regular transactions still get the empty result and can fall through.

Gas flags are normalized earlier (Boolean on isGasFeeIncluded / isGasFeeSponsored) and includeTransfer now keys off the same isSponsored flag. Unit tests cover sponsored and gas-included cases when atomic batch is unsupported.

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

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jun 23, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added the team-confirmations Push issues to confirmations team label Jun 23, 2026
@mm-token-exchange-service

mm-token-exchange-service Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@matthewwalsh0 matthewwalsh0 changed the title fix: require EIP-7702 for sponsored gas transactions fix: cp-8.0.0 require EIP-7702 for sponsored gas transactions Jun 23, 2026
@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.

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review June 23, 2026 20:37
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner June 23, 2026 20:37
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 23, 2026
@matthewwalsh0 matthewwalsh0 removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jun 23, 2026
@matthewwalsh0 matthewwalsh0 force-pushed the fix/direct-musd-vault-7702-mobile branch from cc49072 to 4e5dfa7 Compare June 24, 2026 09:20
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies delegation-7702-publish.ts and its test file. The changes:

  1. Move isGaslessBridge and isSponsored variable declarations earlier in the function (before the chain support check).
  2. Add a new error throw when the chain doesn't support EIP-7702 but the transaction is sponsored (isGasFeeSponsored) or gas-included (isGasFeeIncluded).
  3. Refactor includeTransfer to use the already-computed isSponsored variable instead of re-reading transactionMeta.isGasFeeSponsored.

These changes affect the EIP-7702 advanced account abstraction transaction flow — specifically sponsored/gasless bridge transactions. SmokeConfirmations covers EIP-7702 account abstraction features including batch transactions and gas fee token payments, making it the directly relevant tag. No other areas (swaps, staking, accounts, browser, snaps, etc.) are affected. No performance-sensitive code paths are changed.

Performance Test Selection:
The changes are limited to EIP-7702 delegation publish hook logic — specifically error handling for unsupported chains with sponsored/gas-included transactions. No rendering, loading, or performance-sensitive code paths are modified. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 48adf87 Jun 24, 2026
157 of 159 checks passed
@matthewwalsh0 matthewwalsh0 deleted the fix/direct-musd-vault-7702-mobile branch June 24, 2026 10:16
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-8.1.0 Issue or pull request that will be included in release 8.1.0 label Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.1.0 Issue or pull request that will be included in release 8.1.0 risk:medium AI analysis: medium risk size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants