Skip to content

Add transaction pay quote usability fallback#8581

Open
pedronfigueiredo wants to merge 1 commit intomainfrom
pnf/pay-quote-usability-fallback
Open

Add transaction pay quote usability fallback#8581
pedronfigueiredo wants to merge 1 commit intomainfrom
pnf/pay-quote-usability-fallback

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented Apr 24, 2026

Description

This follow-up keeps the Transaction Pay fallback principle intact after provider quotes are constructed. A strategy can now return technically supported quotes but still be skipped if those quotes are unusable for the current account context, such as when they require origin native gas that the account cannot pay.

The quote loop now checks strategy support, fetches quotes, checks provider quote support, then runs a normalized quote usability check before selecting the strategy. If the first strategy is unusable, the controller logs the reason and continues to the next configured strategy. This lets Across remain first when the account can complete the route, while allowing Relay to win when it can provide a gasless path for the same situation.

Changes

  • Added checkQuoteUsability to evaluate quote requirements against native source-chain balance.
  • Continued strategy fallback when a quote requires origin native gas that the account cannot cover.
  • Preserved the existing post-quote provider support check for authorization-list limitations.
  • Added regression coverage for Across-to-Relay fallback and for Across still winning when the account can pay origin gas.
  • Added direct quote-usability coverage for authorization-list, native-source, non-object original quote, invalid amount, and missing amount branches.

Note

Medium Risk
Changes strategy selection logic in the quoting loop, which can alter which provider is chosen for a transaction and may impact payment routing in edge cases around native gas requirements.

Overview
Adds checkQuoteUsability to validate returned quotes against account constraints (authorization-list requirements and whether sufficient native source-chain balance exists to cover required origin gas and/or native source token amounts).

Updates the quote-strategy loop in quotes.ts to run this usability check after provider quote support checks; if unusable it logs the reason and continues to the next configured strategy (e.g., allowing Across→Relay fallback when the account can’t pay origin gas). Tests are expanded with new unit coverage for the usability rules and for the new fallback behavior, and the changelog documents the fix.

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

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/pay-quote-usability-fallback branch from 9992242 to 971e575 Compare April 24, 2026 18:56
@pedronfigueiredo pedronfigueiredo self-assigned this Apr 24, 2026
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/pay-quote-usability-fallback branch from 971e575 to 8265af9 Compare April 24, 2026 19:05
Base automatically changed from pnf/bidirectional-fallback to main April 27, 2026 08:36
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/pay-quote-usability-fallback branch from 8265af9 to b16c7fc Compare April 27, 2026 09:53
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review April 27, 2026 10:36
@pedronfigueiredo pedronfigueiredo requested review from a team as code owners April 27, 2026 10:36
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