Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: web3 getBlock api could return empty transactions #778

Closed
yihuang opened this issue Nov 24, 2021 · 3 comments · Fixed by #781
Closed

Problem: web3 getBlock api could return empty transactions #778

yihuang opened this issue Nov 24, 2021 · 3 comments · Fixed by #781

Comments

@yihuang
Copy link
Contributor

yihuang commented Nov 24, 2021

System info: ethermint 0.7.2

Steps to reproduce:

We found in production that, eth_getBlockByNumber API can return empty transactions occasionally. Which causes issues in explorer and other clients.

Investigation shows that for the problematic block, the tx indexer fails to work at all.

$ curl localhost:26657/tx_search?query=%22ethereum_tx.ethereumTxHash=%270x0e46038e00945639488178aeee4af84f63c6a2229d3c0658e8a8582fb5e63c42%27%22
{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "txs": [],
    "total_count": "0"
  }
}

And the web3 API tries to call GetTxsByEthHash for each tx, and fails to find them.

The tx indexer can also lag behind block commit since it's running async.

Expected behavior: getBlock API should work all the time

Actual behavior: fails occasionally

Additional info:

Possible solution:

  • don't rely on GetTxsByEthHash at all in eth_getBlockByNumber and similar apis, we can call BlockResults to get the information we need.
  • Still need to investigate why tx indexer fails occationally.
@leejw51crypto
Copy link
Contributor

does it happen to latest block only?

@yihuang
Copy link
Contributor Author

yihuang commented Nov 25, 2021

does it happen to latest block only?

tendermint/tendermint#7312
it can also happen when tx indexer miss a whole block.

@JayT106
Copy link
Contributor

JayT106 commented Nov 25, 2021

Can we see the log of the node which might have the missing tx indexing?

@crypto-facs crypto-facs mentioned this issue Nov 25, 2021
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants