Conversation
| // the TransactionController re-estimates it at submit time with fresh | ||
| // on-chain state. The quote-time estimate in gasLimits[0] is still used | ||
| // for fee display via relay-quotes, but must not be locked in here. | ||
| const isOriginalTx = isPostQuote && index === 0; |
There was a problem hiding this comment.
Mismatched conditions cause incorrect gas removal for relay step
Medium Severity
The isOriginalTx flag checks isPostQuote && index === 0, but the original transaction is only prepended to allParams when isPostQuote && transaction.txParams.to is truthy. If isPostQuote is true but transaction.txParams.to is falsy, the original tx isn't prepended, yet isOriginalTx would still be true for index 0 — incorrectly setting gas to undefined on the first relay step instead.
Additional Locations (1)
1227b66 to
b895a33
Compare
b895a33 to
b17637e
Compare
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>
da405bd to
e1cbc8b
Compare
| expandedGasLimits: finalGasLimits, | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
EIP-7702 expansion unscoped to post-quote flows
Medium Severity
The gas limit expansion in calculateSourceNetworkGasLimitBatch is 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 — so paramGasLimits[0] is the wrong value. The expansion changes gasLimits from [combinedLimit] to [relay1Gas, combinedLimit], which causes the gasLimit7702 check in relay-submit.ts to evaluate to undefined, inadvertently disabling 7702 batch mode for non-post-quote flows.


Explanation
References
Checklist
Note
Medium Risk
Touches gas-limit selection and batch submission behavior in Relay post-quote flows; incorrect gas propagation could cause failed or suboptimal transactions, but changes are scoped and covered by tests.
Overview
Fixes post-quote Relay batch submission to use the live
transaction.txParams.gasfor the original (prepended) transaction, ensuring anybeforeSign-hook gas updates are respected instead of relying on quotedgasLimits.Adjusts Relay batch gas estimation to handle EIP-7702 returning a single combined gas limit by expanding it into per-transaction limits (prepending the original tx gas), and updates/extends tests and the package changelog accordingly.
Written by Cursor Bugbot for commit e1cbc8b. This will update automatically on new commits. Configure here.