Skip to content
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

Allow setting shorter pollingInterval for tx receipts + requirements for tx receipt validity #27221

Open
thedevbirb opened this issue Sep 17, 2024 · 0 comments
Labels
external-contributor INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template.

Comments

@thedevbirb
Copy link

thedevbirb commented Sep 17, 2024

This issue is related to #13302 but it also close to a feature request.

Context
I'm experimenting with adding support for inclusion preconfirmations on Ethereum Mainnet using Bolt (Flow docs). In essence, this consists of giving an user a near-instant feedback of successful execution on transactions which cannot fail like transfers (after basic balance checks), for which inclusion is credibly guaranteed by proposers using collateral at a later block.

Why pollingInterval and receipts
One way this could be achieved in MetaMask would be leveraging a shorter pollingInterval to ask for a transaction receipt which would be returned by an appropriate RPC aware of this primitive. This is because the wallet knowns already how to update its internal state and display such changes to the user, and the receipt is what's needed in order to show an execution confirmation.

Receipts validity
However, one challenge of this is that it requires MetaMask accepting a receipt that isn't completely backed by real data, because blockHash, blockNumber, transactionIndex, cumulativeGasUsed cannot be predicted until the block is actually created. At the same time, I'm not sure which of these fields is needed in order to make MetaMask work correctly. I did some attempts and my mocked receipts where rejected, and the tx was shown as still pending.

Desiderata
I'd be very grateful to know if it possible to:

  • Allow setting a shorter pollingInterval for the transactions receipts -- this would benefit the UX also on rollups as outlined on [Performance Issue]: PollingBlockTracker is instantiated with too high pollingInterval #13302
  • Know what MetaMask needs in order to consider a receipt valid. I'm not very familiar with the codebase and I had some difficulties in finding this answer by myself.
  • Lastly, if no mocked receipts can be accepted by MetaMask as of now, would you be available to allow this behind an "experimental" feature flag?

Thanks a lot for the collaboration.

@metamaskbot metamaskbot added external-contributor INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template.
Projects
None yet
Development

No branches or pull requests

2 participants