Skip to content

fix: Estimate relay transactions separately and combine with original transaction gas at quote time#7933

Open
dan437 wants to merge 10 commits intomainfrom
fresh-gas-estimation
Open

fix: Estimate relay transactions separately and combine with original transaction gas at quote time#7933
dan437 wants to merge 10 commits intomainfrom
fresh-gas-estimation

Conversation

@dan437
Copy link
Contributor

@dan437 dan437 commented Feb 13, 2026

Explanation

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes fee/gas computation for post-quote Relay flows, which can impact quoted costs and batching behavior; scope is localized but touches transaction-cost accuracy across multiple edge cases.

Overview
Post-quote Relay quoting now estimates gas for Relay deposit transactions only, then adds the caller-provided original transaction gas into the returned totals at quote time (including updated metamask.gasLimits, sourceNetwork estimate/max, and gas-fee-token amount calculations).

The combination logic prefers nestedTransactions[].gas over txParams.gas, handles EIP-7702’s single combined batch limit by adding original gas into that single value, and removes the previous toRelayParams path that mixed the original tx into gas estimation. Tests and the changelog are updated to cover these post-quote scenarios and edge cases (missing gas, fallback estimates, EIP-7702).

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

@dan437 dan437 requested a review from a team as a code owner February 13, 2026 13:55
@dan437 dan437 force-pushed the fresh-gas-estimation branch from 1227b66 to b895a33 Compare February 13, 2026 14:27
@dan437 dan437 changed the title fix: Get fresh gas estimation fix: Use original tx gas Feb 13, 2026
@dan437 dan437 force-pushed the fresh-gas-estimation branch from b895a33 to b17637e Compare February 13, 2026 14:28
@dan437 dan437 requested a review from a team as a code owner February 13, 2026 14:31
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
…essary code

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
…h submission, update changelog

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 force-pushed the fresh-gas-estimation branch from da405bd to e1cbc8b Compare February 13, 2026 17:46
…rom relay-submit.ts

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Copy link

@cursor cursor bot left a 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 1 potential issue.

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 changed the title fix: Use original tx gas fix: Estimate relay transactions separately and combine with original transaction gas at quote time Feb 15, 2026
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