Skip to content

Polling eth_blockNumber gives incorrect results #10572

Open
@jannikluhn

Description

@jannikluhn

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

  1. Start a local dev chain, e.g., with geth or ganache.
  2. Connect metamask to this chain
  3. 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

curling the node directly always gives the right answer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions