Skip to content

[pull] main from MetaMask:main#285

Merged
pull[bot] merged 2 commits into
dmrazzy:mainfrom
MetaMask:main
Aug 18, 2025
Merged

[pull] main from MetaMask:main#285
pull[bot] merged 2 commits into
dmrazzy:mainfrom
MetaMask:main

Conversation

@pull

@pull pull Bot commented Aug 18, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

salimtb and others added 2 commits August 18, 2025 18:22
## Explanation

This PR adds an init function to the network-enablement controllers,
initializing them from the network configuration. It also listens for
the transaction:submitted event and enables the relevant network so
users can immediately see the submitted transaction and their assets.

<!--
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?
-->

## 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/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
## Explanation

**What is the current state of things and why does it need to change?**
An alignment mechanism didn't exist for multichain account groups. It
needs to be added because we can have multiple scenarios where
misalignment occurs:
1. State 1 -> State 2 - We will have to align existing account groups
when they are created.
2. New protocols added - Existing groups will have to have an account
associated with the new provider (chain).
3. Basic functionality toggle - With basic functionality off, we can
have a scenario where only an EVM account is created when a group is
created.
4. Discovery - When importing an SRP, the discovery process might not
necessarily yield a discovered account for every provider and we have to
align the group in those scenarios.

**What is the solution your changes offer and how does it work?** It
adds an alignment mechanism at the group level and it runs through the
list of providers and checks to see if any accounts exist for that
particular group, if there aren't any, then it calls
`provider.createAccounts` with the associated entropy id and group
index. Alignment methods were added at the wallet level where a wallet
would call align on all of its existing groups and similarly at the
service level where it can call align on all of its wallets. Singular
methods were also added at the wallet and service level where a
particular group associated with a wallet can be aligned and a
particular wallet can be aligned by the service.

Note: I also refactored the `withCreateAccount` in `SnapAccountProvider`
to be a bit more readable and easier to understand.

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
@pull pull Bot locked and limited conversation to collaborators Aug 18, 2025
@pull pull Bot added the ⤵️ pull label Aug 18, 2025
@pull pull Bot merged commit 7be2c73 into dmrazzy:main Aug 18, 2025
0 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants