Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Set `isExternalSign` for sponsored transactions to skip nonce assignment ([#7659](https://github.com/MetaMask/core/pull/7659))
- Ensure provided `batchId` is used in `addTransactionBatch` when going through the publish batch hook route ([#7705](https://github.com/MetaMask/core/pull/7705))

## [62.9.2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,8 @@ export class TransactionController extends BaseController<
const existingTransactionMeta = this.#getTransactionWithActionId(actionId);

// If a request to add a transaction with the same actionId is submitted again, a new transaction will not be created for it.
// EIP-7702 batch transactions (with nestedTransactions) are signed externally via delegation
const isEIP7702Batch = Boolean(nestedTransactions?.length);
let addedTransactionMeta: TransactionMeta = existingTransactionMeta
? cloneDeep(existingTransactionMeta)
: {
Expand All @@ -1363,6 +1365,7 @@ export class TransactionController extends BaseController<
deviceConfirmedOn,
disableGasBuffer,
id: random(),
isExternalSign: isEIP7702Batch,
Copy link

Choose a reason for hiding this comment

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

EIP-7702 batch isExternalSign override by gas fee token check

Medium Severity

The new isExternalSign = isEIP7702Batch can be overridden by checkGasFeeTokenBeforePublish when a transaction has both nestedTransactions and a gasFeeToken, and the user has sufficient native balance. The checkGasFeeTokenBeforePublish function unconditionally sets isExternalSign = false in this case, which would cause the original nonce conflicts for EIP-7702 batch transactions that the PR aims to fix.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, this is the same issue as before.

EIP-7702 batch transactions can still be signed locally by the EOA itself and more typically are.

The only exceptions to that are when the gas station EIP-7702 flow is used as it's signed by our relay.

If we're missing a scenario when a transaction is signed externally, then we need to update isExternalSign externally (as we do for gas station EIP-7702 currently) or trigger it more specifically internally, assuming we have that context internally without unnecessary coupling.

isGasFeeTokenIgnoredIfBalance: Boolean(gasFeeToken),
isGasFeeIncluded,
isGasFeeSponsored,
Expand Down Expand Up @@ -1457,6 +1460,8 @@ export class TransactionController extends BaseController<

this.#addMetadata(addedTransactionMeta);

// Record delegationAddress for metrics, but do not use it to determine isExternalSign.
// Only EIP-7702 batch transactions (with nestedTransactions) should have isExternalSign = true.
delegationAddressPromise
.then((delegationAddress) => {
this.#updateTransactionInternal(
Expand Down