Skip to content

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

Merged
dan437 merged 12 commits intomainfrom
fresh-gas-estimation
Feb 16, 2026
Merged

fix: Estimate relay transactions separately and combine with original transaction gas at quote time#7933
dan437 merged 12 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
Touches gas estimation and fee calculation logic for Relay post-quote flows, including EIP-7702 batching; incorrect combining could misprice fees or submit with mismatched gas limits, but changes are scoped and well-covered by unit tests.

Overview
Post-quote Relay quoting now estimates gas for relay transactions only, then separately combines the original transaction gas into fees.sourceNetwork totals and returned metamask.gasLimits so quote-time costs match what relay-submit will actually batch.

This introduces combinePostQuoteGas to prepend original gas for non-7702 flows, add it into the single combined gas limit for EIP-7702 batches, prefer nestedTransactions[].gas over txParams.gas, and skip combining when the original tx has no to or no gas. Tests were updated/expanded to cover these post-quote behaviors and the fallback-gas path, and the package changelog notes the fix.

Written by Cursor Bugbot for commit a63f1c1. 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
@dan437 dan437 force-pushed the fresh-gas-estimation branch from da405bd to e1cbc8b Compare February 13, 2026 17:46
@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
matthewwalsh0
matthewwalsh0 previously approved these changes Feb 16, 2026
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>
…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>
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 2 potential issues.

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 enabled auto-merge February 16, 2026 10:41
@dan437 dan437 added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit 8d78c39 Feb 16, 2026
302 checks passed
@dan437 dan437 deleted the fresh-gas-estimation branch February 16, 2026 10:46
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.

2 participants