Open
Description
Describe the bug
Polling eth_blockNumber
gives incorrect results when Metamask is connected to a local dev chain. Presumably, there's a cache that is only updated every ~20s. This is too infrequent for dev chains with, say, a 2s block time.
Steps to reproduce
- Start a local dev chain, e.g., with geth or ganache.
- Connect metamask to this chain
- Run the following command repeatedly on a metamask-connected site:
await window.ethereum.request({method: "eth_blockNumber", params: []})
Expected behavior
eth_blockNumber
should always return the current block number.
Browser details (please complete the following information):
- OS: Linux
- Browser: Mozilla Firefox 86.0
- MetaMask Version: 9.1.0
Additional context
curl
ing the node directly always gives the right answer.