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

Occasional null balances returned on getBalance balance call. #5842

Closed
danjm opened this issue Nov 27, 2018 · 2 comments
Closed

Occasional null balances returned on getBalance balance call. #5842

danjm opened this issue Nov 27, 2018 · 2 comments

Comments

@danjm
Copy link
Contributor

danjm commented Nov 27, 2018

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.

@W3stside
Copy link

W3stside commented Dec 12, 2018

Seconding that this happens for us. Exact same call. We have also seen certain Contract.sol calls returning imposisble values. In this case a [0, 0] (in BigNumber) when such case is impossible.

EDIT: For more clarity: in the above function, the explicit return is stated as (uint num, uint den)

@Gudahtt
Copy link
Member

Gudahtt commented Jan 6, 2021

Closing, as we haven't had reports of this in a long time. Please open a new issue if you see this again!

@Gudahtt Gudahtt closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants