Skip to content

fix(transaction-controller): pass isInternal when submitting extra transactions batch#8884

Merged
matthewwalsh0 merged 1 commit into
mainfrom
fix/transaction-controller-duplicate-batch-id
May 28, 2026
Merged

fix(transaction-controller): pass isInternal when submitting extra transactions batch#8884
matthewwalsh0 merged 1 commit into
mainfrom
fix/transaction-controller-duplicate-batch-id

Conversation

@matthewwalsh0
Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 commented May 21, 2026

Explanation

ExtraTransactionsPublishHook calls addTransactionBatch to submit an ERC-20 gas-fee-token payment alongside a Smart Transaction, but was not passing isInternal: true. The duplicate-batch-ID guard introduced in #8633 then threw DuplicateBundleId (error 5720) because the shared batchId looked like an untrusted external call.

Fix: pass isInternal: true at the ExtraTransactionsPublishHook call site.

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

Low Risk
Single call-site flag fix with tests; no auth or API surface changes beyond correcting internal batch submission.

Overview
Marks nested ERC-20 gas-fee-token batches submitted by ExtraTransactionsPublishHook as trusted internal work by passing isInternal: true into addTransactionBatch.

After the explicit internal-flag change in v66, that hook reused the parent batchId without the flag, so the duplicate-batch guard treated it like an external caller and threw DuplicateBundleId (5720). Tests and the changelog document the fix.

Reviewed by Cursor Bugbot for commit 2e22f8d. Bugbot is set up for automated code reviews on this repo. Configure here.

@matthewwalsh0 matthewwalsh0 force-pushed the fix/transaction-controller-duplicate-batch-id branch from f15c67e to 4678f2f Compare May 22, 2026 10:04
@matthewwalsh0
Copy link
Copy Markdown
Member Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.4.0-preview-4678f2f94
@metamask-previews/accounts-controller@38.1.1-preview-4678f2f94
@metamask-previews/address-book-controller@7.1.2-preview-4678f2f94
@metamask-previews/ai-controllers@0.6.3-preview-4678f2f94
@metamask-previews/analytics-controller@1.0.1-preview-4678f2f94
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-4678f2f94
@metamask-previews/announcement-controller@8.1.0-preview-4678f2f94
@metamask-previews/app-metadata-controller@2.0.1-preview-4678f2f94
@metamask-previews/approval-controller@9.0.1-preview-4678f2f94
@metamask-previews/assets-controller@8.0.1-preview-4678f2f94
@metamask-previews/assets-controllers@108.1.0-preview-4678f2f94
@metamask-previews/authenticated-user-storage@2.0.0-preview-4678f2f94
@metamask-previews/base-controller@9.1.0-preview-4678f2f94
@metamask-previews/base-data-service@0.1.3-preview-4678f2f94
@metamask-previews/bridge-controller@73.0.1-preview-4678f2f94
@metamask-previews/bridge-status-controller@71.2.0-preview-4678f2f94
@metamask-previews/build-utils@3.0.4-preview-4678f2f94
@metamask-previews/chain-agnostic-permission@1.6.1-preview-4678f2f94
@metamask-previews/chomp-api-service@3.1.0-preview-4678f2f94
@metamask-previews/claims-controller@0.5.1-preview-4678f2f94
@metamask-previews/client-controller@1.0.1-preview-4678f2f94
@metamask-previews/compliance-controller@2.0.1-preview-4678f2f94
@metamask-previews/composable-controller@12.0.1-preview-4678f2f94
@metamask-previews/config-registry-controller@0.3.1-preview-4678f2f94
@metamask-previews/connectivity-controller@0.2.0-preview-4678f2f94
@metamask-previews/controller-utils@12.1.0-preview-4678f2f94
@metamask-previews/core-backend@6.3.0-preview-4678f2f94
@metamask-previews/delegation-controller@3.0.0-preview-4678f2f94
@metamask-previews/earn-controller@12.2.0-preview-4678f2f94
@metamask-previews/eip-5792-middleware@3.0.4-preview-4678f2f94
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-4678f2f94
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-4678f2f94
@metamask-previews/ens-controller@19.1.3-preview-4678f2f94
@metamask-previews/eth-block-tracker@15.0.1-preview-4678f2f94
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-4678f2f94
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-4678f2f94
@metamask-previews/foundryup@1.0.1-preview-4678f2f94
@metamask-previews/gas-fee-controller@26.2.2-preview-4678f2f94
@metamask-previews/gator-permissions-controller@4.2.0-preview-4678f2f94
@metamask-previews/geolocation-controller@0.1.3-preview-4678f2f94
@metamask-previews/json-rpc-engine@10.5.0-preview-4678f2f94
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-4678f2f94
@metamask-previews/keyring-controller@25.5.0-preview-4678f2f94
@metamask-previews/logging-controller@8.0.2-preview-4678f2f94
@metamask-previews/message-manager@14.1.2-preview-4678f2f94
@metamask-previews/messenger@1.2.0-preview-4678f2f94
@metamask-previews/messenger-cli@0.2.0-preview-4678f2f94
@metamask-previews/money-account-balance-service@1.0.2-preview-4678f2f94
@metamask-previews/money-account-controller@0.3.0-preview-4678f2f94
@metamask-previews/money-account-upgrade-controller@2.0.2-preview-4678f2f94
@metamask-previews/multichain-account-service@10.0.0-preview-4678f2f94
@metamask-previews/multichain-api-middleware@3.1.2-preview-4678f2f94
@metamask-previews/multichain-network-controller@3.1.2-preview-4678f2f94
@metamask-previews/multichain-transactions-controller@7.1.0-preview-4678f2f94
@metamask-previews/name-controller@9.1.2-preview-4678f2f94
@metamask-previews/network-controller@32.0.0-preview-4678f2f94
@metamask-previews/network-enablement-controller@5.2.0-preview-4678f2f94
@metamask-previews/notification-services-controller@24.1.1-preview-4678f2f94
@metamask-previews/passkey-controller@2.0.1-preview-4678f2f94
@metamask-previews/permission-controller@13.1.1-preview-4678f2f94
@metamask-previews/permission-log-controller@5.1.0-preview-4678f2f94
@metamask-previews/perps-controller@6.2.0-preview-4678f2f94
@metamask-previews/phishing-controller@17.2.0-preview-4678f2f94
@metamask-previews/polling-controller@16.0.6-preview-4678f2f94
@metamask-previews/preferences-controller@23.1.0-preview-4678f2f94
@metamask-previews/profile-metrics-controller@3.1.4-preview-4678f2f94
@metamask-previews/profile-sync-controller@28.1.0-preview-4678f2f94
@metamask-previews/ramps-controller@14.0.0-preview-4678f2f94
@metamask-previews/rate-limit-controller@7.0.1-preview-4678f2f94
@metamask-previews/react-data-query@0.2.1-preview-4678f2f94
@metamask-previews/remote-feature-flag-controller@4.2.1-preview-4678f2f94
@metamask-previews/sample-controllers@5.0.1-preview-4678f2f94
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-4678f2f94
@metamask-previews/selected-network-controller@26.1.3-preview-4678f2f94
@metamask-previews/shield-controller@5.1.2-preview-4678f2f94
@metamask-previews/signature-controller@39.2.2-preview-4678f2f94
@metamask-previews/snap-account-service@0.2.0-preview-4678f2f94
@metamask-previews/social-controllers@2.2.1-preview-4678f2f94
@metamask-previews/storage-service@1.0.1-preview-4678f2f94
@metamask-previews/subscription-controller@6.1.3-preview-4678f2f94
@metamask-previews/transaction-controller@66.0.0-preview-4678f2f94
@metamask-previews/transaction-pay-controller@22.7.0-preview-4678f2f94
@metamask-previews/user-operation-controller@41.2.2-preview-4678f2f94
@metamask-previews/wallet@0.0.0-preview-4678f2f94

@matthewwalsh0 matthewwalsh0 changed the title fix(transaction-controller): allow nested batch transactions with duplicate batchId when requireApproval is false fix(transaction-controller): pass isInternal when submitting extra transactions batch May 27, 2026
@matthewwalsh0 matthewwalsh0 force-pushed the fix/transaction-controller-duplicate-batch-id branch from 4678f2f to 3136fcd Compare May 27, 2026 21:37
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review May 27, 2026 23:27
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners May 27, 2026 23:27
@matthewwalsh0 matthewwalsh0 force-pushed the fix/transaction-controller-duplicate-batch-id branch from 3136fcd to 2e22f8d Compare May 28, 2026 08:43
@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit dfa9873 May 28, 2026
370 checks passed
@matthewwalsh0 matthewwalsh0 deleted the fix/transaction-controller-duplicate-batch-id branch May 28, 2026 09:25
@jeremytsng jeremytsng mentioned this pull request May 28, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants