-
-
Notifications
You must be signed in to change notification settings - Fork 275
fix: Use original tx gas #7933
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
base: main
Are you sure you want to change the base?
fix: Use original tx gas #7933
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,8 +327,20 @@ | |
|
|
||
| const transactions = allParams.map((singleParams, index) => { | ||
| const gasLimit = gasLimits[index]; | ||
| const gas = | ||
| gasLimit === undefined || gasLimit7702 ? undefined : toHex(gasLimit); | ||
|
|
||
| // For post-quote flows, the original transaction (index 0) may be | ||
| // transformed by a beforeSign hook (e.g. wrapped in a Safe execTransaction). | ||
| // Use the live txParams.gas so beforeSign's gas update is reflected. | ||
| const isOriginalTx = isPostQuote && index === 0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mismatched conditions cause incorrect gas removal for relay stepMedium Severity The Additional Locations (1) |
||
| const originalTxGas = transaction?.txParams?.gas | ||
| ? (transaction.txParams.gas as Hex) | ||
| : undefined; | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const gas = isOriginalTx | ||
| ? originalTxGas | ||
| : gasLimit === undefined || gasLimit7702 | ||
| ? undefined | ||
| : toHex(gasLimit); | ||
|
|
||
| return { | ||
| params: { | ||
|
|
||


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.
EIP-7702 expansion unscoped to post-quote flows
Medium Severity
The gas limit expansion in
calculateSourceNetworkGasLimitBatchis not scoped to post-quote flows. For non-post-quote calls with 2+ relay params (e.g., approve + deposit) and an EIP-7702 single combined gas limit,params[0]is the first relay step — not the original transaction — soparamGasLimits[0]is the wrong value. The expansion changesgasLimitsfrom[combinedLimit]to[relay1Gas, combinedLimit], which causes thegasLimit7702check inrelay-submit.tsto evaluate toundefined, inadvertently disabling 7702 batch mode for non-post-quote flows.Additional Locations (1)
packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts#L322-L326