feat: Support bidirectional pay strategy fallback#8577
Open
pedronfigueiredo wants to merge 1 commit intomainfrom
Open
feat: Support bidirectional pay strategy fallback#8577pedronfigueiredo wants to merge 1 commit intomainfrom
pedronfigueiredo wants to merge 1 commit intomainfrom
Conversation
0385e59 to
a6b006a
Compare
a6b006a to
d52a6ae
Compare
d52a6ae to
09f054c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
supportsas the pre-quote strategy capability check and allows it to be async.checkQuoteSupportfor provider limitations discovered after quote construction and gas planning.requiresAuthorizationListfromTransactionController:estimateGasBatchthrough transaction-pay gas quote metadata.txParams.authorizationListbefore quotes and rejectmetamask.requiresAuthorizationListafter gas planning, while still allowingis7702quotes for already-upgraded accounts.is7702andrequiresAuthorizationList.Note
Medium Risk
Changes quote/strategy selection flow (including new post-quote validation) and extends
estimateGasBatchoutput, 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:estimateGasBatchto optionally returnrequiresAuthorizationListwhen EIP-7702 batch estimation implies a first-time account upgrade, and propagates this flag through pay quote gas planning into Across quote metadata.Updates
AcrossStrategyto reject requests that already includetxParams.authorizationList, and to reject quotes whose planned execution would require an authorization list (while still allowing otheris7702quotes); 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.