-
-
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: handle etherscan rate limit errors #7209
Conversation
Add background timer to update incoming transactions.
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. |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #7209 +/- ##
==========================================
- Coverage 33.15% 33.15% -0.01%
==========================================
Files 1005 1005
Lines 32656 32659 +3
Branches 8398 8398
==========================================
Hits 10827 10827
- Misses 21829 21832 +3
☔ View full report in Codecov by Sentry. |
Ignore duplicate incoming transactions.
29844c3
Kudos, SonarCloud Quality Gate passed! |
All incoming transaction notifications work as expected, push notification are also seen when the app is on the background. eth.movtoken.moviOS incoming transactions notifications in the background mode (1 - normal send / 2 - token transfer): bckgr_send.movhttps://github.com/MetaMask/metamask-mobile/assets/104780023/240f14e9-b9ab-4bdb-96ae-aa3d04734283 history_ios.movAndroid incoming ETH notification: eth.movAndroid incoming token notification: tst.movAndroid incoming ETH notification in background mode: send_eth_bkgr.movAndroid incoming TST notification in background mode: tst_bkgr.movScreen.Recording.2023-09-14.at.11.10.40.AM.movTransaction history after import on Android: |
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
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
Description
The mobile client uses the core
TransactionController
which supports the use of an API key when querying Etherscan for incoming or updated transactions.The extension, using its
TransactionController
, only queries Etherscan for normal transactions using a single callout.The mobile client, using the core
TransactionController
, queries Etherscan for both normal transactions and token transfer transactions related to an account. This requires 2 callouts and therefore consistently results in a rate limit error on one of the callouts if no API key is provided.Previously, if either request failed due to a rate limit error, the update would be skipped, and no transactions would be added. This PR instead processes whatever transactions are found, regardless of which specific callout returned a rate limit error.
Since both callouts are performed simultaneously, it is currently random chance which callout results in the rate limit error, meaning both normal and token transfer transactions are still supported, but either could experience sporadic delays.
Additional changes include:
startBlock
argument in Etherscan requests to match the previous behaviour where a bug meant this was never being utilised.Recordings
Transaction History After Import
import_history.mov
New Incoming Transaction & Notification
new_incoming.mov
Issue
Fixes #1249, #1250, #1251
Checklist