feat(transaction-pay): add ordered strategy fallback orchestration#7868
Open
pedronfigueiredo wants to merge 3 commits intomainfrom
Open
feat(transaction-pay): add ordered strategy fallback orchestration#7868pedronfigueiredo wants to merge 3 commits intomainfrom
pedronfigueiredo wants to merge 3 commits 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
1b1ae1f to
d7d7490
Compare
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
approved these changes
Feb 20, 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 retrieval and publish-path strategy selection; failures in ordering/validation or
supportslogic could lead to missing quotes or executing an unintended strategy.Overview
Adds ordered pay-strategy orchestration for quote retrieval:
TransactionPayControllercan now accept agetStrategiescallback (or remote feature flagstrategyOrder) andupdateQuotes/refreshQuotesiterate strategies in order, skipping unsupported ones (supports) and falling back when quote/batch-tx retrieval fails or returns empty.Strategy selection is hardened by validating strategy names (
isTransactionPayStrategy), addinggetStrategiesByNameto resolve/skip unknown strategies, and changing the publish hook to execute the strategy encoded in the stored quote (quotes[0].strategy) rather than re-selecting at publish time. Docs/changelog and tests are updated accordingly.Written by Cursor Bugbot for commit b6a43e3. This will update automatically on new commits. Configure here.