swapper-org / NodeChain

Nodechain is a service that allows you to create nodes on a blockchain and connect to them natively through APIs. The goal is to allow the user to build their own nodes natively without having to rely on external services.
MIT License
7 stars 5 forks source link

[Indexer] Ethereum indexer fails when syncing #177

Closed bridgedragon closed 2 years ago

bridgedragon commented 2 years ago

Issue

The following error is thrown when indexer is running in testnet.

2022-05-06 10:03:13,160 - INFO - Current block in index 3464364. Current block in ETH chain: 12242022
Traceback (most recent call last):
  File "./indexer.py", line 169, in <module>
    main()
  File "./indexer.py", line 123, in main
    insertBlockTransactions(web3=web3, blockNumber=blockNumber, numTxs=numTxs, cur=cur)
  File "./indexer.py", line 159, in insertBlockTransactions
    logger.info(f"Skipping {tx['txhash'].hex()} tx. Incorrect contract_to length: {len(contractTo)}")
  File "/usr/local/lib/python3.6/site-packages/web3/datastructures.py", line 51, in __getitem__
    return self.__dict__[key]  # type: ignore
KeyError: 'txhash'
0xp3gasus commented 2 years ago

Bug fixed in https://github.com/swapper-org/eth-transactions-indexer/pull/2