fix: cp-8.0.0 require EIP-7702 for sponsored gas transactions#32253
Conversation
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
|
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. |
cc49072 to
4e5dfa7
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
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: |
|



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)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
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,
Delegation7702PublishHookused to return an empty result so later publish hooks could run.This change throws for
isGasFeeSponsoredorisGasFeeIncludedwhen the chain is not EIP-7702-capable, with a clear error (prefixed asGas Station 7702:). Regular transactions still get the empty result and can fall through.Gas flags are normalized earlier (
BooleanonisGasFeeIncluded/isGasFeeSponsored) andincludeTransfernow keys off the sameisSponsoredflag. 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.