-
-
Notifications
You must be signed in to change notification settings - Fork 275
feat(transaction-pay): add ordered strategy fallback orchestration #7868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pedronfigueiredo
wants to merge
1
commit into
main
Choose a base branch
from
cor-6992-extract-fallback-mechanism
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
49eb1e8 to
c450bc6
Compare
c450bc6 to
782bc16
Compare
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 the core quote-selection and publish-time execution flow, so subtle ordering/compatibility or fallback edge cases could alter which strategy executes and affect transaction funding behavior.
Overview
Adds ordered strategy orchestration to
transaction-pay-controllerby introducingTransactionPayController:getStrategies(and agetStrategiesconstructor callback) while keepinggetStrategyworking as “first strategy or Relay”.Quote retrieval now iterates the ordered strategies with optional
supports(...)checks and falls back on errors or empty quotes; the publish hook similarly executes the quote’s encoded primary strategy first and, on failure, rebuilds quote requests and retries the next compatible strategies before rethrowing the original error. Documentation and tests are updated to cover the new fallback behavior and the newsupportscapability onPayStrategy.Written by Cursor Bugbot for commit 782bc16. This will update automatically on new commits. Configure here.