-
-
Notifications
You must be signed in to change notification settings - Fork 279
perf(multichain-account-service)!: avoid excessive state syncing #6654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
aa318fe
feat: have group align method print all provider errors
hmalik88 17e855f
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
hmalik88 924a679
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
hmalik88 be8b2f7
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
hmalik88 b49f7b4
feat: construct service state at the top level and pass state slices …
hmalik88 a261e1e
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
hmalik88 6104131
chore: readd code removed by mistake
hmalik88 c45f612
feat: add getAccounts method to AccountsController
hmalik88 acf36e0
chore: update types to include getAccounts action
hmalik88 ce3cef4
refactor: derive account ID and use that to do a getAccounts call ins…
hmalik88 891fa50
feat: finish refactor
hmalik88 83060d6
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 01096bf
chore: add JSDoc for wallet init
hmalik88 4c2e582
chore: remove accountId to context mapping since with the removal of …
hmalik88 43972f8
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 7cec854
feat: start to add logic that will let createMultichainAccountWallet …
hmalik88 f05e6da
feat: remove need for mnemonicAsBytes
hmalik88 e325c77
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
hmalik88 6c5b86e
feat: update creatMultichainAccountWallet method to cover all entry p…
hmalik88 7d805ef
chore: update JSDoc
hmalik88 6b6e776
chore: update log messages
hmalik88 33e5e34
chore: add more JSDocs
hmalik88 f4d79c0
test: update multichain service tests
hmalik88 350aa93
fix: address type errors, remove try/catch block to not swallow error…
hmalik88 ce322e0
fix: lint fixes
hmalik88 31a6d71
chore: remove commented test
hmalik88 4c485a6
refactor: make changes to messenger and providers to make the compati…
hmalik88 c82de17
refactor: simplify init and properly filter for rejected already alig…
hmalik88 7d6e76a
fix: properly initialize group state
hmalik88 2d55dbd
test: update multichain account group tests
hmalik88 b8a87ff
test: update multichain account wallet tests
hmalik88 92d1c3a
test: update provider tests so that they are compatible with the new …
hmalik88 8dedd1a
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 11cc131
test: update btc and trx tests to account for new logic
hmalik88 d28a324
chore: update changelogs
hmalik88 f308e9f
fix: lint fixes
hmalik88 8bc1237
test: add test for getAccounts
hmalik88 19cfdf3
feat: register getAccounts message handler
hmalik88 82fece8
chore: update JSDoc
hmalik88 c812a82
refactor: use Object.entries in wallet init
hmalik88 91aa52e
refactor: simplified error logic and include provider names in error …
hmalik88 4b19ed5
test: have account group creation test check actual failure message
hmalik88 5bcaa53
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 c12435a
test: update tests
hmalik88 e9ab58d
chore: remove old comment
hmalik88 521a71b
chore: update changelog
hmalik88 1162348
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 31f0193
feat: add code to remove disabled provider state from groups
hmalik88 7128b55
test: add tests for disabled provider
hmalik88 0c9324c
fix: update param passed to clean disabled provider state function
hmalik88 6b15c2d
fix: update logic and tests
hmalik88 0ec9181
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 98db5d3
fix: lint fix
hmalik88 98d6373
refactor: rename function and add JSDoc
hmalik88 5733fac
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 eab65ca
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 99d70dd
chore: apply code review
hmalik88 6f02157
fix: lint fix
hmalik88 a544fb3
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 b7a7108
chore: split off accounts controller changes
hmalik88 2df0f84
chore: split off keyring controller changes
hmalik88 9f6890d
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 9e44c34
refactor: apply code review
hmalik88 ba51a39
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 37f79b6
refactor: changed logic to clear entire virtual list for a provider w…
hmalik88 f56a14a
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 a1855a6
refactor: make changes after rebase
hmalik88 db00bc8
fix: more fix after rebase
hmalik88 9fc2ee2
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 5e076b3
fix: update tests
hmalik88 f8a7783
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 a414253
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 c3b8390
fix: update tests
hmalik88 6bb050e
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 612a846
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 483da6e
refactor: apply code review
hmalik88 b746565
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 602ce8f
fix: lint fix
hmalik88 a5746db
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 981817a
fix: add override init method
hmalik88 01c594c
refactor: apply code review
hmalik88 2a4c71f
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 7334bbc
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 0e24c48
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 ea00380
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 0a0db20
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 82fa21d
add remove account actions
hmalik88 bcd998a
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 21c74ac
fix: update tests
hmalik88 550c11f
feat: add param to remove account wallet method
hmalik88 8e22d1d
fix: update tests
hmalik88 a7483ff
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 a6d4432
feat: add messenger registration for removeMultichainAccountWallet an…
hmalik88 1881a2c
fix: lint fixes
hmalik88 b747e5f
fix: more lint fixes
hmalik88 770e25f
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 7d64234
fix: test fixes
hmalik88 176a79b
fix: fix naming
hmalik88 73add20
chore: update suppressions
hmalik88 8b0cc36
fix: prettier fix
hmalik88 cb57f4c
fix: move clearAccountToProviderState logic to only clear provider st…
hmalik88 6bf879c
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 6158c7f
chore: update jsdoc for remove wallet method
hmalik88 a2ea0f1
feat: add logic to init a newly created wallet
hmalik88 66051a5
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 6a56850
fix: update changelog
hmalik88 f7eec3f
fix: make sure we're creating the first account on import
hmalik88 5288909
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 b96fd74
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 fd4aea5
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 0e4b151
fix: update logic to create first multichain group in newly created w…
hmalik88 4a66b65
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 a8c05bb
fix: add another fix to prevent hanging promise
hmalik88 903db2d
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 1142ae4
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 766f706
fix: wallet creation fix and update to enum usage
hmalik88 91e7f90
Merge remote-tracking branch 'origin/main' into hm/bip-44-perf-and-de…
hmalik88 cd0d095
Merge branch 'main' into hm/bip-44-perf-and-devx-improvements
ccharly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
|
|
||
| - **BREAKING** A performance refactor was made around all the classes in this package ([#6654](https://github.com/MetaMask/core/pull/6654)) | ||
| - Add logic in the `createMultichainAccountWallet` method in `MultichainAccountService` so that it can handle all entry points: importing an SRP, recovering a vault and creating a new vault. | ||
| - Add a `getAccountIds` method which returns all the account ids pertaining to a group. | ||
| - Add an `addAccounts` method on the `BaseBip44AccountProvider` class which keeps track of all the account IDs that pertain to it. | ||
|
|
||
| ### Changed | ||
|
|
||
| - Bump `@metamask/keyring-controller` from `^25.0.0` to `^25.1.0` ([#7713](https://github.com/MetaMask/core/pull/7713)) | ||
|
|
@@ -123,8 +130,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
|
|
||
| ### Changed | ||
|
|
||
| - **BREAKING** A performance refactor was made around all the classes in this package ([#6654](https://github.com/MetaMask/core/pull/6654)) | ||
| - The `MultichainAccountService` is refactored to construct a top level service state for its `init` function, this state is passed down to the `MultichainAccountWallet` and `MultichainAccountGroup` classes in slices for them to construct their internal states. | ||
| - Additional state is generated at the entry points where it needs to be updated i.e. `createMultichainAccountGroup`, `discoverAccounts` and `alignAccounts`. | ||
| - We no longer prevent group creation if some providers' `createAccounts` calls fail during group creation, only if they all fail. | ||
| - The `getAccounts` method in the `BaseBip44AccountProvider` class no longer relies on fetching the entire list of internal accounts from the `AccountsController`, instead it gets the specific accounts that it stores in its internal accounts list. | ||
| - The `EvmAccountProvider` no longer fetches from the `AccountController` to get an account for its ID, we deterministically get the associated account ID through `getUUIDFromAddressOfNormalAccount`. | ||
| - The `EvmAccountProvider` now uses the `getAccount` method from the `AccountsController` when fetching an account after account creation as it is more efficient. | ||
| - Bump `@metamask/base-controller` from `^8.4.1` to `^8.4.2` ([#6917](https://github.com/MetaMask/core/pull/6917)) | ||
|
|
||
| ### Removed | ||
|
|
||
| - **BREAKING** A performance refactor was made around all the classes in this package ([#6654](https://github.com/MetaMask/core/pull/6654)) | ||
| - Remove `#handleOnAccountAdded` and `#handleOnAccountRemoved` methods in `MultichainAccountService` due to internal state being updated within the service. | ||
| - Remove `getAccountContext` (and associated map) in the `MultichainAccountService` as the service no longer uses that method. | ||
| - Remove the `sync` method in favor of the sole `init` method for both `MultichainAccountWallet` and `MultichainAccountGroup`. | ||
|
|
||
|
Comment on lines
+142
to
+148
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, those sections are misplaced (probably because of a bad rebase, I'll change this when releasing this package) |
||
| ## [1.6.1] | ||
|
|
||
| ### Changed | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, those sections are misplaced (probably because of a bad rebase, I'll change this when releasing this package)