fix(AssetsController): remove ws metadata population - #9790
fix(AssetsController): remove ws metadata population#9790Prithpal-Sooriya wants to merge 9 commits into
Conversation
this population is poisoning (invalid metadata) and skips our detection pathways
…tadata-population
|
@metamaskbot publish-preview |
…ng `assetsInfo` publication during balance updates; metadata is now sourced from the Token API. Bump dependencies for `transaction-controller`, `core-backend`, and `config-registry-controller`.
1e3d521 to
fa03cc8
Compare
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…tadata-population
…ng by stopping `assetsInfo` publication during balance updates. Metadata is now sourced from the Token API to enhance token detection and prevent spam filtering. Bump dependencies for `@metamask/keyring-controller` and `@metamask/network-enablement-controller`.
…sk/core into fix/remove-ws-metadata-population
|
@cursor /babysit |
|
Babysit complete — CI is green again. What failedThe Validate changelog job failed because The All jobs pass job failed as a downstream effect of that changelog failure. What I fixedMerged both entries into one ### Fixed
- Preserve pooled-staking balances across Accounts API chain-slice updates ...
- Stop publishing `assetsInfo` from websocket balance updates ...Verification
Pushed commit: PR #9790 is mergeable with no open review comments. Preview builds were already published for |
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>


Explanation
WS updates contain metadata. The intention was we can use this metadata to save on API calls.
However this metadata population is poisoning our system:
This PR removes metadata addition from WS, so all added tokens will go through our TokenAPI as source of truth and detection heuristics.
References
Mobile Integration: MetaMask/metamask-mobile#34366
Ticket: https://consensyssoftware.atlassian.net/browse/ASSETS-3844
Checklist
Note
Medium Risk
Touches real-time balance ingestion and how metadata reaches state; behavior change is intentional for security but may briefly delay metadata until Token API enrichment runs.
Overview
Account activity websocket updates now emit balances only —
AccountActivityDataSourceno longer mergesassetsInfofrom the WS payload or calls an injectedgetAssetTypefromAssetsController.That closes a metadata poisoning path: the payload’s
unit(on-chain symbol/name) could mark scam airdrops as “known” instate.assetsInfoand skipTokenDataSourceoccurrence/spam checks. Decimals from the WS payload are still used only to convert raw amounts to human-readable balances.Token names, symbols, and detection metadata are left for
TokenDataSource/ Token API in the same pipeline pass. Tests were updated accordingly (including assertingassetsInfostays undefined when the payload carries attacker-controlledunitvalues).Reviewed by Cursor Bugbot for commit f931f96. Bugbot is set up for automated code reviews on this repo. Configure here.