[pull] main from MetaMask:main#780
Merged
Merged
Conversation
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> This PR prevents native balance fetches on Tempo chains for the native asset for: - Allowing transition from multi-assets-controller to unified - long smoke-tested but will need proper QA with fresh+used states. - Future-proof the case if `getBalance` started to return an error from Tempo's RPC - currently returns `4242424242424242424242424242424242424242424242424242424242424242424242424242` but Tempo might change it to an error message in the future. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the RPC balance fetch pipeline to omit native-asset fetching (including fallback paths) for chains flagged as having no native token, which could affect displayed balances/metadata on those networks if misclassified. > > **Overview** > Prevents `RpcDataSource` from querying/returning native balances on Tempo chains by gating native asset inclusion (and the error-path default native `0` entry) behind a new `shouldSkipNativeForCaipChainId` helper. > > Updates `AssetsController` native-token hiding logic to use the same helper, adds targeted RPC data source tests to ensure native entries and `getBalance` fallbacks are skipped when configured, and adjusts token price support mappings so Tempo chains are treated as having *no native asset*. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit af970ec. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation Add a `getLegacySnapKeyring` to replace all use of `getSnapKeyring` in each clients. ## References N/A ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new messenger-exposed method that can create a legacy Snap keyring via `KeyringController:withController`, which touches keyring management and could impact account/keyring state if misused. Scope is otherwise contained to the snap-account-service package with dedicated tests. > > **Overview** > Adds a new `SnapAccountService:getLegacySnapKeyring` messenger action that atomically returns the existing legacy Snap keyring (`KeyringTypes.snap`) or creates it via `KeyringController:withController`/`addNewKeyring`, with logging when creation occurs. > > Updates action type unions and tests to cover existing-keyring, create-if-missing, and error propagation behavior, and adds `@metamask/eth-snap-keyring` (plus `@metamask/keyring-utils` for typing) dependencies alongside changelog entries. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 74136a7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation Add `handleKeyringSnapMessage`, so consumers can re-route those messages automatically through the service. For now we use the legacy Snap keyring, but once Snap keyring v2 are migrated, we would re-route those message to the proper v2 keyring. ## References N/A ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new messenger-exposed entry point that forwards arbitrary Snap messages into the legacy Snap keyring; misrouting or unexpected message shapes could affect Snap account/keyring operations. > > **Overview** > **Adds `SnapAccountService.handleKeyringSnapMessage`** and exposes it as a new messenger action (`SnapAccountService:handleKeyringSnapMessage`) so consumers can route keyring Snap messages through the service instead of directly using the legacy Snap keyring. > > Updates generated action type unions and adds targeted tests verifying forwarding behavior, error propagation, and messenger wiring; also documents the new API in the package changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 92068a5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…8763) ## Explanation We used to have have this logic on the clients directly, but now it's the responsibility of this service to forward the selected accounts to the Snap keyring (and in the future, to each Snap keyring v2 instances). ## References N/A ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because it adds event-driven behavior that forwards selected accounts into the Snap keyring on group changes/unlock, which could affect account selection state and error handling in keyring interactions. > > **Overview** > Moves selected-account forwarding into `@metamask/snap-account-service`: it now subscribes to `AccountTreeController:selectedAccountGroupChange` and `KeyringController:unlock`, looks up the selected `AccountGroupObject`, and calls `snapKeyring.setSelectedAccounts()` for that group. > > Adds local mirrored `AccountTreeController` action/event types (`src/types.ts`) and updates build refs to avoid a TS project-reference cycle, plus adds dependencies and tests covering no-op and error paths; changelog and dependency graph are updated accordingly. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cb54cae. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Some new Infura network have been added to `InfuraNetworkType` (#8680), but `NetworkController` uses the same list of networks to: - Build the default list of networks when creating the initial default state - Validate new Infura networks being enabled This has been fine until now because additional networks that can be enabled by users were added as "custom" networks. However, with the addition of new Infura networks, we have some networks that can be enabled by users but are not included in the default list of networks. This causes validation to fail when users try to enable those networks (via the Additional Networks list). ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the set of networks that are auto-included on initialization, which is a breaking behavioral change that can affect users’ ability to switch to previously-default networks without first adding configurations. > > **Overview** > Introduces `DEFAULT_INFURA_NETWORKS` (a curated subset of `InfuraNetworkType`) in `@metamask/controller-utils` and exports it for consumers. > > Updates `NetworkController` to build its default `networkConfigurationsByChainId` from `DEFAULT_INFURA_NETWORKS` instead of `Object.values(InfuraNetworkType)`, effectively **removing Sei, MegaETH, Avalanche, and ZKSync from the default network set** while keeping them available as Infura-supported networks. > > Adjusts controller-utils export snapshots and network-controller tests/changelogs to reflect the new default-network behavior (**breaking**). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0f8fa8c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )