Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 7, 2025

Explanation

Support Relay quotes requiring multiple transactions, such as a token approval and deposit.

Use fallback gas limit if missing in transaction data.

References

Related to #6184

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Adds multi-transaction support for Relay quotes, including batched submission, fallback gas handling, and improved fee calculation.

  • Relay strategy:
    • Execute quotes with multiple transactions; submit via TransactionController:addTransactionBatch (first tx marked tokenMethodApprove).
    • Use fallback gas limit (RELAY_FALLBACK_GAS_LIMIT = 900000) when gas is missing; normalize params accordingly.
    • Calculate source network fees by summing gas across items; fallback per-item gas when absent.
    • Poll Relay status from the last step to completion; handle failure/refund.
  • Utils:
    • Add collectTransactionIds in src/utils/transaction.ts to track created tx IDs; used by Relay and Bridge flows.
  • Bridge strategy:
    • Use collectTransactionIds and wait for confirmations before bridge completion checks.
  • Types:
    • Make Relay step data.gas optional.
  • Tests/Mocks:
    • Add tests for multi-transaction, gas fallback, fee aggregation; extend messenger mock with addTransactionBatch.
  • Changelog:
    • Note added support for Relay quotes with multiple transactions.

Written by Cursor Bugbot for commit ed276a5. This will update automatically on new commits. Configure here.

@matthewwalsh0 matthewwalsh0 force-pushed the feat/relay-submit-batch branch from 2010595 to e127b7c Compare November 7, 2025 13:39
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review November 9, 2025 09:04
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners November 9, 2025 09:04
@matthewwalsh0 matthewwalsh0 enabled auto-merge (squash) November 10, 2025 10:41
@matthewwalsh0 matthewwalsh0 force-pushed the feat/relay-submit-batch branch from 7c30789 to ed276a5 Compare November 10, 2025 10:42
},
{ usd: new BigNumber(0), fiat: new BigNumber(0) },
);
const allParams = quote.steps[0].items.map((i) => i.data);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Gas Estimates: Partial View, Full Cost.

The gas calculation only considers the first step via quote.steps[0].items but relay-submit.ts submits all steps via quote.steps.flatMap((s) => s.items). This inconsistency causes incorrect gas cost estimates when quotes have multiple steps, as only the first step's transactions are included in the total gas limit calculation while all steps are actually executed.

Fix in Cursor Fix in Web

@matthewwalsh0 matthewwalsh0 merged commit 5ffc19a into main Nov 10, 2025
271 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/relay-submit-batch branch November 10, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants