-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Increased time interval of pending tx tracker #4872
base: main
Are you sure you want to change the base?
Conversation
@cloudonshore Hi Sam, some of us on the Wallet Framework team took a look at the PR and the details you left in your strategy doc. Improving the user experience on chains that aren't Mainnet sounds like a worthwhile goal. However, we still need to mindful of Mainnet, and we're not sure the strategy you've implemented would be ideal across the board. It seems that in your PR you are increasing the number of times a request is made to fetch the status of a transaction. We suspect that this kind of request (or any request that fetches on-chain data) is likely fairly expensive in comparison to fetching the block number. Not only this, but the transaction status request seems to be made regardless of whether a new block is available. This seems wasteful for slower chains like Mainnet. Instead of checking transaction statuses more often, wouldn't it be more efficient to check for a new block more often, i.e. reduce the polling interval of the block tracker? It seems that you were concerned about the impact of this change for other parts of the codebase that rely on the block tracker, especially on faster chains, so here are a couple of alternative strategies for your consideration:
What are your thoughts? |
92% of transactions on metamask are not eth mainnet. In my PR, accelerated transaction polling only occurs when a new pending transaction is added, and it only runs for a short burst after the transaction is added. This should help resolve transactions faster while using the absolute minimum number of calls. @mcmire |
This may also introduce issues with integrations with 3rd party RPC providers as it would vastly increase requests the user is sending to 3rd party RPC clients - leading to more occurrences of hitting rate limits for users. |
@mcmire 'Give me the last block number' and 'Give me this transaction' are both 'head' requests, so they’re read from Infura’s RAM and have the same resources impact. The only difference is that the transaction request uses slightly more memory and bandwidth if the transaction exists (but you’d need that resources used anyway, also in the current model). If the tx is not included yet, 'Give me this transaction' is even more efficient because is a MISS on the cache, slightly better than getting an integer. But anyway... small differences, they are both very well performing. So, I don’t quite understand how or why 'Give the block, and then the transaction' would be better than 'Give the transaction' directly. This BTW would only apply to users who have submitted a transaction and only for a limited time (as is the case with the current mechanism). Thank you for clarifying! (and thanks for your time) Marco |
Explanation
References
Changelog
@metamask/package-a
@metamask/package-b
Checklist