-
-
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
refactor: use block tracker to poll incoming transactions #6998
refactor: use block tracker to poll incoming transactions #6998
Conversation
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. |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
Codecov Report
@@ Coverage Diff @@
## main #6998 +/- ##
==========================================
+ Coverage 32.65% 32.69% +0.04%
==========================================
Files 994 993 -1
Lines 26646 26606 -40
Branches 2089 2083 -6
==========================================
Hits 8700 8700
+ Misses 17532 17492 -40
Partials 414 414
|
@SocketSecurity ignore-all |
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.
🚀 🚀 Awesome work! Great to see this on mobile.
Kudos, SonarCloud Quality Gate passed! 3 Bugs 15.4% Coverage The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Description
Currently the mobile client uses a version of the core
TransactionController
where incoming transactions are polled on request via afetchAll
method called from the frontend in a polling loop and explicitly on events such as the network changing.In addition, the client is currently responsible for specifying what block number to search from and therefore is also responsible for maintaining it's own object in the persisted state to track the last fetched block number per account per network.
This PR primarily updates the
TransactionController
to a version which both polls internally for incoming transactions using a block tracker referencing the current network, and maintains its own last fetched block number object.Note that this update is via a patch due to additional breaking changes blocking a direct version update.
As a result, this PR also includes the following changes:
fetchAll
controller method.Engine.refreshTransactionHistory
method.startIncomingTransactionPolling
andstopIncomingTransactionPolling
methods to control internal polling.updateIncomingTransactions
controller method when immediate updates are required such as when changing networks.eth-block-tracker
and@metamask/swappable-obj-proxy
packages to support the patchedTransactionController
.Issue
Fixes #1195
Checklist