Description
Describe the bug
MetaMask keeps a cache of request/response in order to minimize the calls to the RPC endpoint, but its refresh interval is set too high even for the Ethereum blockchain, let alone other EVM-compatible blockchains with sub-second block creation time.
The PollingBlockTracker cache is instantiated with the default pollingInterval value that is set to 20 seconds:
The result is that block creations are detected much later than they actually happened, with the consequence that transaction confirmations and event logs are delayed, ruining the user experience.
For the transaction confirmation there is a workaround, it's possible to manually poll the eth_getTransactionReceipt
function that bypass the cache and also allow MetaMask to detect a block change faster, as soon as the receipt with a more recent block number is returned. But for the event logs I haven't found a workaround yet.
It'd be very useful if the default polling interval was set to a more sane value (5 seconds?), and perhaps overridable from the MetaMask network configuration (and the related API to add a network to MM).
Steps to reproduce
- Connect to a network with sub-second block finality
- Call the
eth_blockNumber
(or submit a transaction, or listen to events)
Error messages or log output
No response
Version
10.8.2
Build type
No response
Browser
Chrome, Firefox
Operating system
Windows, MacOS, Linux
Hardware wallet
No response
Additional context
No response