feat(transaction-pay): add ordered strategy fallback orchestration#7868
Merged
pedronfigueiredo merged 1 commit intomainfrom Feb 23, 2026
Merged
feat(transaction-pay): add ordered strategy fallback orchestration#7868pedronfigueiredo merged 1 commit intomainfrom
pedronfigueiredo merged 1 commit intomainfrom
Conversation
23573ac to
55549a1
Compare
55549a1 to
e2818b3
Compare
packages/transaction-pay-controller/src/helpers/TransactionPayPublishHook.ts
Outdated
Show resolved
Hide resolved
e2818b3 to
5158351
Compare
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
c450bc6 to
782bc16
Compare
matthewwalsh0
requested changes
Feb 11, 2026
packages/transaction-pay-controller/src/helpers/TransactionPayPublishHook.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
9b2de51 to
44ee983
Compare
44ee983 to
eeca0ed
Compare
9cd0f37 to
a6c9af9
Compare
matthewwalsh0
requested changes
Feb 13, 2026
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
a6c9af9 to
df9f104
Compare
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
35e9f3f to
08bac6a
Compare
08bac6a to
26c090a
Compare
matthewwalsh0
requested changes
Feb 16, 2026
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
d7d7490 to
b6a43e3
Compare
| }); | ||
| continue; | ||
| } | ||
| } |
There was a problem hiding this comment.
Source amounts strategy mismatch with fallback strategy selection
Medium Severity
The updateSourceAmounts call in #updateTransactionData uses getStrategy (returning the first strategy) to decide whether same-token quotes are required via isQuoteAlwaysRequired. But the new fallback loop in getQuotes may select a different strategy. For a Hyperliquid USDC deposit where the payment token matches the required token, if Bridge is first in the order, isQuoteAlwaysRequired returns false, the source amount is skipped, and no quote requests are built — so even when Relay (which does need that quote) is tried as fallback, requests is already empty and getQuotes returns early with no quotes.
Additional Locations (1)
matthewwalsh0
previously approved these changes
Feb 20, 2026
b6a43e3 to
7908026
Compare
packages/transaction-pay-controller/src/helpers/TransactionPayPublishHook.ts
Show resolved
Hide resolved
matthewwalsh0
approved these changes
Feb 23, 2026
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.


Explanation
As per preemptive validation on #7806
TransactionPayController:getStrategieswhile preserving existinggetStrategybehavior.supports(...)) during strategy selection.References
Addresses https://github.com/MetaMask/MetaMask-planning/issues/6992
Checklist
Note
Medium Risk
Changes core quote-selection and submission routing for pay transactions; incorrect strategy ordering, supports checks, or fallback behavior could alter fees/quotes returned or cause pay flows to fail in edge cases.
Overview
MetaMask Pay now supports ordered strategy orchestration with fallback.
TransactionPayControlleraccepts an optionalgetStrategiescallback (while preservinggetStrategy) and falls back to a remotely-configuredstrategyOrderfeature flag (defaulting to Relay), filtering invalid values.Quote updates/refresh now try strategies in priority order via
getStrategiesByName, optionally skip incompatible strategies via a newPayStrategy.supports(...)hook, and fall through when a strategy errors, returns no quotes, or fails batch-transaction generation. Publish-time submission now selects the strategy fromquotes[0].strategy(instead of re-resolving from controller) to ensure the submit path matches the quote origin.Written by Cursor Bugbot for commit 7908026. This will update automatically on new commits. Configure here.