Skip to content

Occasional null balances returned on getBalance balance call. #5842

@danjm

Description

@danjm

Symptom of this bug described in #5723

Network requests for getBalance (https://web3js.readthedocs.io/en/1.0/web3-eth.html#getbalance) to infura seem to arbitrarily return null for the balance

Here are four such network requests and the responses, made on four successive block updates:

Request
GET https://api.infura.io/v1/jsonrpc/mainnet/eth_getBalance?params=%5B%220xbfc4bf9c3b454eb7fb9e4d1b95e4c1f53e5330bf%22%2C%220x6767f0%22%5D

Response
Status: 200
Payload: {"jsonrpc":"2.0","id":0,"result":"0x1d2d8f25e458"}

----
Request
GET https://api.infura.io/v1/jsonrpc/mainnet/eth_getBalance?params=%5B%220xbfc4bf9c3b454eb7fb9e4d1b95e4c1f53e5330bf%22%2C%220x6767f2%22%5D

Response
Status: 200
Payload: {"jsonrpc":"2.0","id":0,"result":null}

----
Request
GET https://api.infura.io/v1/jsonrpc/mainnet/eth_getBalance?params=%5B%220xbfc4bf9c3b454eb7fb9e4d1b95e4c1f53e5330bf%22%2C%220x6767f6%22%5D

Response
Status: 200
Payload: {"jsonrpc":"2.0","id":0,"result":"0x1d2d8f25e458"}

----
Request
GET https://api.infura.io/v1/jsonrpc/mainnet/eth_getBalance?params=%5B%220xbfc4bf9c3b454eb7fb9e4d1b95e4c1f53e5330bf%22%2C%220x6767f7%22%5D

Response
Status: 200
Payload: {"jsonrpc":"2.0","id":0,"result":null}

These requests are ultimately triggered by the account-tracker on block updates. When they are sent, a request is sent for each of the currently added accounts. So one you can observe them in your console in groups.

screenshot from 2018-11-26 12-07-33
screenshot from 2018-11-26 12-07-26

One strange occurrence is that in any given group, it is possible for 1, 2, 3 or 0 of the responses to have a null balance.

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