refactor(transaction-controller): remove incoming transaction support and defer initialization#9012
Draft
matthewwalsh0 wants to merge 8 commits into
Draft
refactor(transaction-controller): remove incoming transaction support and defer initialization#9012matthewwalsh0 wants to merge 8 commits into
matthewwalsh0 wants to merge 8 commits into
Conversation
f9649f0 to
02fb997
Compare
…kingHelper init via polling
…om TokenBalancesController
…om assets-controller
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. |
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
This PR removes incoming transaction support from
TransactionControllerand decouples its construction fromNetworkControlleravailability.Deferred initialization
Previously,
MultichainTrackingHelpercalledNetworkController:getNetworkClientRegistrysynchronously in its constructor. The helper now polls at construction time untilNetworkControlleris available on the messenger, soTransactionControllercan be registered in any order without requiring a separateinitialize()call from the consumer.Remove incoming transaction support
Incoming transaction polling (via
IncomingTransactionHelperandAccountsApiRemoteTransactionSource) is removed entirely. Clients retrieve incoming transactions directly through the accounts API. TheRemoteFeatureFlagController:getStateand backend service event dependencies that existed solely to drive this subsystem are removed alongside it.AccountActivityServiceStatusChangedEvent,AccountsControllerSelectedAccountChangeEvent, andBackendWebSocketServiceConnectionStateChangedEventare dropped fromAllowedEvents;AccountActivityServiceTransactionUpdatedEventis retained asTransactionPollerstill uses it to accelerate pending transaction checks.All fields on
TransactionMetarelated to incoming transactions are preserved for backwards compatibility with persisted state.Transaction history trim resilience
getFeatureFlagsnow returnsundefinedinstead of throwing whenRemoteFeatureFlagControlleris not yet registered. As a consequence,#trimTransactionsForStateskips trimming when the history limit flag is unavailable rather than crashing.References
Checklist