refactor(transaction-controller): remove deprecated constructor options and unused hooks#8983
Open
matthewwalsh0 wants to merge 8 commits into
Open
refactor(transaction-controller): remove deprecated constructor options and unused hooks#8983matthewwalsh0 wants to merge 8 commits into
matthewwalsh0 wants to merge 8 commits into
Conversation
- Remove disableHistory and disableSendFlowHistory options - Replace getCurrentAccountEIP1559Compatibility with constant true - Replace getCurrentNetworkEIP1559Compatibility with NetworkController:getEIP1559Compatibility messenger call - Remove getExternalPendingTransactions (STX now routes through TransactionController) - Replace getGasFeeEstimates with GasFeeController:fetchGasFeeEstimates messenger call - Remove getNetworkClientRegistry option; inline messenger call in MultichainTrackingHelper - Replace getNetworkState with NetworkController:getState messenger call - Replace sign option with KeyringController:signTransaction messenger call; add txDataToTransaction helper - Remove transactionHistoryLimit option (now a feature flag) - Remove securityProviderRequest option and SecurityProviderRequest type export - Remove afterSimulate hook option and AfterSimulateHook type (unused in both clients) - Remove isResubmitEnabled option and all resubmit logic from PendingTransactionTracker
- Remove afterSign hook (unused in both clients) - Remove getAdditionalSignArguments hook (unused in both clients, also never called internally) - Remove afterSimulate hook (unused in both clients) - Move isTimeoutEnabled from hooks to root constructor options - Change serializeTransaction to accept TypedTxData directly via TransactionFactory.fromTxData - Remove txDataToTransaction helper; #updateTransactionMetaRSV now accepts TypedTxData
…ne ESLint suppressions
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a836b7b. Configure here.
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
pedronfigueiredo
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Several
TransactionControllerconstructor options have accumulated over time that are either unused by either client, superseded by messenger calls, or feature-flagged away. This PR removes them and wires up the equivalent messenger actions directly, shrinking the public API surface and eliminating dead code.Removed constructor options (replaced with messenger calls or constants):
disableHistory,disableSendFlowHistory— no-ops kept only for backward compatgetCurrentAccountEIP1559Compatibility— replaced with constanttruegetCurrentNetworkEIP1559Compatibility— replaced withNetworkController:getEIP1559CompatibilitygetExternalPendingTransactions— STX now routes throughTransactionControllerdirectlygetGasFeeEstimates— replaced withGasFeeController:fetchGasFeeEstimatesgetNetworkClientRegistry— inlined as a messenger call inMultichainTrackingHelpergetNetworkState— replaced withNetworkController:getStatesecurityProviderRequest— unused in both clientssign— replaced withKeyringController:signTransactiontransactionHistoryLimit— superseded by the remote feature flag of the same namependingTransactions.isResubmitEnabled— resubmit support is unused in both clients; all resubmit logic removed fromPendingTransactionTrackerRemoved hooks (verified unused in both extension and mobile):
hooks.afterSignhooks.afterSimulatehooks.getAdditionalSignArgumentsMoved:
hooks.isTimeoutEnabled→ root constructor option (it was never a hook concern).Signing simplification:
#updateTransactionMetaRSVandserializeTransactionnow acceptTypedTxDatadirectly (the return type ofKeyringController:signTransaction), eliminating the intermediateTypedTransactionconversion step.The corresponding messenger action types (
GasFeeController:fetchGasFeeEstimates,KeyringController:signTransaction,NetworkController:getEIP1559Compatibility,NetworkController:getNetworkClientRegistry,NetworkController:getState) are added toAllowedActions.TransactionMeta.securityProviderResponseis intentionally kept — it exists on historical transaction records.References
Checklist
Note
High Risk
Breaking API changes affect signing, gas estimation, EIP-1559 detection, and pending-tx behavior; clients must migrate messenger wiring and lose automatic resubmit.
Overview
BREAKING refactor that shrinks
TransactionController’s public surface and routes cross-controller work through the messenger.Deprecated constructor options (
sign,getGasFeeEstimates,getNetworkState, EIP-1559 getters,securityProviderRequest, history flags,pendingTransactions, etc.) are removed. Clients must registerGasFeeController:fetchGasFeeEstimates,KeyringController:signTransaction, andNetworkControlleractions (getState,getNetworkClientRegistry,getEIP1559Compatibility) on the controller messenger. Signing and serialization now useTypedTxDatafrom the keyring instead of an injectedsigncallback andTypedTransaction.Unused hooks
afterSign,afterSimulate, andgetAdditionalSignArgumentsare dropped, along withsecurityProviderRequeston add and related exported types.isTimeoutEnabledmoves fromhooksto a top-level constructor option.PendingTransactionTrackerno longer auto-resubmits stuck transactions (retry/resubmit path andpublishTransactionwiring removed); pending polling focuses on confirmation, drop, and timeout behavior.Reviewed by Cursor Bugbot for commit a836b7b. Bugbot is set up for automated code reviews on this repo. Configure here.