-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: App slower when changing account and switching network #9721
Conversation
…he selected one, that was fixed by adding a patch to the TransactionController to only fetch per account selected
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: 5833f01 Note
|
Bitrise✅✅✅ Commit hash: 5501acc Note
|
@tommasini Can you quantify the number of API calls you have reduced by this change? Is it possible that we will see improvements on UI load performance in the Wallet View? |
Yeah I didn't take screenshots but we can do a comparison with the main branch using flipper @sethkfman |
…and added a flag for not update the balances if there is an update in progress
Bitrise❌❌❌ Commit hash: 9645cb9 Note
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9721 +/- ##
==========================================
+ Coverage 46.66% 47.24% +0.58%
==========================================
Files 1343 1370 +27
Lines 32805 33304 +499
Branches 3527 3586 +59
==========================================
+ Hits 15307 15736 +429
- Misses 16554 16607 +53
- Partials 944 961 +17 ☔ View full report in Codecov by Sentry. |
Bitrise✅✅✅ Commit hash: 8f15d00 Note
|
Quality Gate passedIssues Measures |
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.
LGTM! Are these changes also applied to core already?
On the transaction controller changes, the way that transaction statuses are being fetched really change on next versions, so there was not a follow-up to core, althought this will be saved on a core branch to help next upgrades (The core branch is: patch/mobile-transaction-controller-13-0-0) Regarding the assets controllers, this should be redirected to the core repo! I believe since now the focus is the controller upgrades, we can do it when we update assets-controllers to the latest version, begin to remove all the patch with core PRs |
Description
This PR reduces the number of api calls that happen when switching account and network, on cold and warm app starts.
Screenshot of main branch with eth_getTransactionReceipt requests:
The selected account was not orangefox.eth
https://etherscan.io/tx/0x7ce730e2e87520e179d4e351e5cfe80565c346f9ab7688a3391306422e01f0a9
Fixed a bug on Transaction controller where the getBlockByHash request was failing silently because it was missing one param.
ENS fetches now only once we switch network and we change the selected account (This was looping by number of accounts and being retriggered, one 1 second, counted 15+ fetches to ens contract , now it's just fetching once it switches network and for the selected account)Request parallelization of token balances. (This was not optimized on number of requests but on the parallelization of the requests to have a response quicker from all of them)
Update pooling of token balances from 10000 to 180000 miliseconds
Added a boolean to not let the updateBalances runs if there is an update in progress. (Probably change this to use mutex when implementing on core it's a good idea)
A snapshot was updated on this PR! It seems that this snapshot was indeed wrong, and now it have the right mocked data.
Check this transaction controller core branch with the changes: mobile-patch-performance-tx-controller-13-0-0
(Once this is approved, this changes need to be merged on the patch/mobile-transaction-controller-13-0-0 branch)
Assets controller patch easy to ready, the core branch is this one: patch/mobile-assets-controllers-26-performance.
(Once this is approved, this changes need to be merged on the patch/mobile-assets-controllers-26 branch)
Next steps
Product Changes
ENS is now get by the selected account and not every accountThis was addressed in other PR alreadyRelated issues
Fixes: #9250 #9249
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist