Skip to content

feat: Support bidirectional pay strategy fallback#8577

Open
pedronfigueiredo wants to merge 1 commit intomainfrom
pnf/bidirectional-fallback
Open

feat: Support bidirectional pay strategy fallback#8577
pedronfigueiredo wants to merge 1 commit intomainfrom
pnf/bidirectional-fallback

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented Apr 24, 2026

Summary

This PR enables controller-level fallback from Across to later configured pay strategies, including Relay, when Across can quote but cannot execute the planned transaction mode.

Across already has quote-time limitations, such as same-chain swaps. The issue here is an execution limitation that is only known after quote construction and gas planning: first-time EIP-7702 upgrades that require an authorization list. If Across is ordered first, the controller should not store an unusable Across quote when a later provider can still quote and execute the request.

Changes

  • Keeps supports as the pre-quote strategy capability check and allows it to be async.
  • Adds checkQuoteSupport for provider limitations discovered after quote construction and gas planning.
  • Carries requiresAuthorizationList from TransactionController:estimateGasBatch through transaction-pay gas quote metadata.
  • Updates Across to reject explicit txParams.authorizationList before quotes and reject metamask.requiresAuthorizationList after gas planning, while still allowing is7702 quotes for already-upgraded accounts.
  • Adds focused tests for fallback after post-quote support rejection and for the distinction between is7702 and requiresAuthorizationList.

Note

Medium Risk
Changes quote/strategy selection flow (including new post-quote validation) and extends estimateGasBatch output, which can alter which pay provider is chosen and how EIP-7702 batches are executed.

Overview
Adds a new post-quote capability check for pay strategies (checkQuoteSupport) and updates quote selection to skip unsupported strategies and fall back to later strategies when either pre-quote support or post-quote checks fail.

Extends TransactionController:estimateGasBatch to optionally return requiresAuthorizationList when EIP-7702 batch estimation implies a first-time account upgrade, and propagates this flag through pay quote gas planning into Across quote metadata.

Updates AcrossStrategy to reject requests that already include txParams.authorizationList, and to reject quotes whose planned execution would require an authorization list (while still allowing other is7702 quotes); includes new/updated tests and changelog entries reflecting the fallback behavior.

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

@pedronfigueiredo pedronfigueiredo changed the title [codex] Support bidirectional pay strategy fallback feat: Support bidirectional pay strategy fallback Apr 24, 2026
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/bidirectional-fallback branch from 0385e59 to a6b006a Compare April 24, 2026 13:43
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review April 24, 2026 13:44
@pedronfigueiredo pedronfigueiredo requested review from a team as code owners April 24, 2026 13:44
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/bidirectional-fallback branch from a6b006a to d52a6ae Compare April 24, 2026 13:47
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/bidirectional-fallback branch from d52a6ae to 09f054c Compare April 24, 2026 13:52
@pedronfigueiredo pedronfigueiredo requested a review from jpuri April 24, 2026 14:56
@pedronfigueiredo pedronfigueiredo self-assigned this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant