Skip to content

feat: asset-controller tempo adjustments before migration#8638

Open
maxime-oe wants to merge 1 commit intomainfrom
feat/tempo-asset-controller-upgrade
Open

feat: asset-controller tempo adjustments before migration#8638
maxime-oe wants to merge 1 commit intomainfrom
feat/tempo-asset-controller-upgrade

Conversation

@maxime-oe
Copy link
Copy Markdown
Contributor

@maxime-oe maxime-oe commented Apr 29, 2026

Explanation

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

Medium Risk
Changes balance-fetch inputs and price-support mappings for specific chains; risk is limited in scope but could affect Tempo balance/price display and any code assuming a native entry is always fetched.

Overview
Adjusts Tempo chain handling so native assets are no longer treated as fetchable/priced tokens.

RpcDataSource now conditionally omits the native getEthBalance request for chains in CHAIN_IDS_WITH_NO_NATIVE_TOKEN (via new shouldSkipNativeForCaipChainId helper), and AssetsController uses the same helper when deciding whether to hide native tokens. In assets-controllers, Tempo entries in SPOT_PRICES_SUPPORT_INFO are updated to indicate no native asset and the pseudo-native address mappings are removed.

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

@maxime-oe maxime-oe force-pushed the feat/tempo-asset-controller-upgrade branch 2 times, most recently from a8b2d27 to 3c5a04a Compare April 29, 2026 15:31
@maxime-oe maxime-oe marked this pull request as ready for review April 29, 2026 15:36
@maxime-oe maxime-oe requested review from a team as code owners April 29, 2026 15:36
@maxime-oe maxime-oe force-pushed the feat/tempo-asset-controller-upgrade branch from 3c5a04a to 5d3fb3f Compare April 29, 2026 15:39
@maxime-oe maxime-oe force-pushed the feat/tempo-asset-controller-upgrade branch from 5d3fb3f to d8ff44d Compare April 29, 2026 16:09
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 d8ff44d. Configure here.

if (!shouldSkipNativeForCaipChainId(chainId)) {
// Build a single AssetFetchEntry[] for native + custom ERC-20s
assetsToFetch.push({ assetId: nativeAssetId, address: ZERO_ADDRESS });
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Error path reintroduces native token for skipped chains

Medium Severity

The happy path now correctly skips adding the native asset to assetsToFetch for Tempo chains via shouldSkipNativeForCaipChainId, but the catch block unconditionally writes nativeAssetId back into assetsBalance (with amount '0') and assetsInfo (with type: 'native'). When fetchBalancesForAssets fails on a Tempo chain (e.g., network error fetching custom ERC-20s), native token data is reintroduced into state despite being intentionally excluded. While #shouldHideNativeToken filters at display time, this leaks inconsistent data into controller state.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d8ff44d. Configure here.

@maxime-oe
Copy link
Copy Markdown
Contributor Author

@metamaskbot preview

@maxime-oe
Copy link
Copy Markdown
Contributor 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.1.0-preview-d8ff44d
@metamask-previews/accounts-controller@37.2.0-preview-d8ff44d
@metamask-previews/address-book-controller@7.1.1-preview-d8ff44d
@metamask-previews/ai-controllers@0.6.3-preview-d8ff44d
@metamask-previews/analytics-controller@1.0.1-preview-d8ff44d
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-d8ff44d
@metamask-previews/announcement-controller@8.1.0-preview-d8ff44d
@metamask-previews/app-metadata-controller@2.0.1-preview-d8ff44d
@metamask-previews/approval-controller@9.0.1-preview-d8ff44d
@metamask-previews/assets-controller@6.2.1-preview-d8ff44d
@metamask-previews/assets-controllers@105.0.0-preview-d8ff44d
@metamask-previews/authenticated-user-storage@1.0.0-preview-d8ff44d
@metamask-previews/base-controller@9.1.0-preview-d8ff44d
@metamask-previews/base-data-service@0.1.1-preview-d8ff44d
@metamask-previews/bridge-controller@71.0.0-preview-d8ff44d
@metamask-previews/bridge-status-controller@71.1.0-preview-d8ff44d
@metamask-previews/build-utils@3.0.4-preview-d8ff44d
@metamask-previews/chain-agnostic-permission@1.5.0-preview-d8ff44d
@metamask-previews/chomp-api-service@2.0.0-preview-d8ff44d
@metamask-previews/claims-controller@0.5.0-preview-d8ff44d
@metamask-previews/client-controller@1.0.1-preview-d8ff44d
@metamask-previews/compliance-controller@2.0.0-preview-d8ff44d
@metamask-previews/composable-controller@12.0.1-preview-d8ff44d
@metamask-previews/config-registry-controller@0.3.0-preview-d8ff44d
@metamask-previews/connectivity-controller@0.2.0-preview-d8ff44d
@metamask-previews/controller-utils@11.20.0-preview-d8ff44d
@metamask-previews/core-backend@6.2.1-preview-d8ff44d
@metamask-previews/delegation-controller@3.0.0-preview-d8ff44d
@metamask-previews/earn-controller@12.0.0-preview-d8ff44d
@metamask-previews/eip-5792-middleware@3.0.3-preview-d8ff44d
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-d8ff44d
@metamask-previews/eip1193-permission-middleware@1.0.3-preview-d8ff44d
@metamask-previews/ens-controller@19.1.1-preview-d8ff44d
@metamask-previews/eth-block-tracker@15.0.1-preview-d8ff44d
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-d8ff44d
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-d8ff44d
@metamask-previews/foundryup@1.0.1-preview-d8ff44d
@metamask-previews/gas-fee-controller@26.1.1-preview-d8ff44d
@metamask-previews/gator-permissions-controller@4.0.0-preview-d8ff44d
@metamask-previews/geolocation-controller@0.1.2-preview-d8ff44d
@metamask-previews/json-rpc-engine@10.2.4-preview-d8ff44d
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-d8ff44d
@metamask-previews/keyring-controller@25.3.0-preview-d8ff44d
@metamask-previews/logging-controller@8.0.1-preview-d8ff44d
@metamask-previews/message-manager@14.1.1-preview-d8ff44d
@metamask-previews/messenger@1.2.0-preview-d8ff44d
@metamask-previews/messenger-cli@0.2.0-preview-d8ff44d
@metamask-previews/money-account-balance-service@0.2.0-preview-d8ff44d
@metamask-previews/money-account-controller@0.1.0-preview-d8ff44d
@metamask-previews/money-account-upgrade-controller@1.2.0-preview-d8ff44d
@metamask-previews/multichain-account-service@8.0.1-preview-d8ff44d
@metamask-previews/multichain-api-middleware@2.0.0-preview-d8ff44d
@metamask-previews/multichain-network-controller@3.0.6-preview-d8ff44d
@metamask-previews/multichain-transactions-controller@7.0.4-preview-d8ff44d
@metamask-previews/name-controller@9.1.1-preview-d8ff44d
@metamask-previews/network-controller@30.1.0-preview-d8ff44d
@metamask-previews/network-enablement-controller@5.0.2-preview-d8ff44d
@metamask-previews/notification-services-controller@23.1.0-preview-d8ff44d
@metamask-previews/passkey-controller@1.0.0-preview-d8ff44d
@metamask-previews/permission-controller@12.3.0-preview-d8ff44d
@metamask-previews/permission-log-controller@5.1.0-preview-d8ff44d
@metamask-previews/perps-controller@4.0.0-preview-d8ff44d
@metamask-previews/phishing-controller@17.1.1-preview-d8ff44d
@metamask-previews/polling-controller@16.0.4-preview-d8ff44d
@metamask-previews/preferences-controller@23.1.0-preview-d8ff44d
@metamask-previews/profile-metrics-controller@3.1.3-preview-d8ff44d
@metamask-previews/profile-sync-controller@28.0.2-preview-d8ff44d
@metamask-previews/ramps-controller@13.2.0-preview-d8ff44d
@metamask-previews/rate-limit-controller@7.0.1-preview-d8ff44d
@metamask-previews/react-data-query@0.2.0-preview-d8ff44d
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-d8ff44d
@metamask-previews/sample-controllers@4.0.4-preview-d8ff44d
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-d8ff44d
@metamask-previews/selected-network-controller@26.1.0-preview-d8ff44d
@metamask-previews/shield-controller@5.1.1-preview-d8ff44d
@metamask-previews/signature-controller@39.2.0-preview-d8ff44d
@metamask-previews/snap-account-service@0.0.0-preview-d8ff44d
@metamask-previews/social-controllers@2.2.0-preview-d8ff44d
@metamask-previews/storage-service@1.0.1-preview-d8ff44d
@metamask-previews/subscription-controller@6.1.2-preview-d8ff44d
@metamask-previews/transaction-controller@65.0.0-preview-d8ff44d
@metamask-previews/transaction-pay-controller@20.0.1-preview-d8ff44d
@metamask-previews/user-operation-controller@41.2.0-preview-d8ff44d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant