I work at www.goldsky.com and we're trying to add XDC to our list of supported networks for subgraphs. We've successfully added mainnet. However, we're having trouble adding the XDC Testnet. It seems that the testnet RPC at https://earpc.apothem.network does not provide reliable RPC responses. Here's a log output that the Graph Node (the thing which powers subgraphs) spits out in a loop:
goldskyraw-indexer-0-graph-node-69c676fdc6-dg8k6 graph-node Oct 18 08:56:22.768 INFO receipt block mismatch, receipt_tx_hash: 0x03fe…bfd0, tx_hash: 0x03fe…bfd0, block_hash: 0xd5ed…d9a4, receipt_block_hash: 0x91e1…10d5, provider: xdc-testnet, component: EthereumPollingBlockIngestor
Note that the receipt_block_hash
and block_hash
are not equivalent fetching fetching the listed transaction (whose receipt hash matches itself).
Discussion (8)
Could you please share the below files?
So I can reproduce your problem.
I don't have a docker compose setup to share since this is happening in production. This also isn't happening because of a specific subgraph but during initial network setup in the graph node.
Here are more logs: gist.github.com/paymog/33659ee46f0...
Here's how you can manually reproduce this:
curl -X POST -H "Content-Type: application/json" -d '{"method": "eth_getBlockByHash", "params": ["0xd28bc799751815a0923d673d97dc8ca932e32c41e1d1f8ec08956106bd981018", false], "id": 1, "jsonrpc": "2.0"}' https://earpc.apothem.network
which contains a single transaction:0xc1b52110f52120b4faf9e8502d568fb6dc88e90b0acd9f48d0af443782b9f55b
curl -X POST -H "Content-Type: application/json" -d '{"method": "eth_getTransactionReceipt", "params": ["0xc1b52110f52120b4faf9e8502d568fb6dc88e90b0acd9f48d0af443782b9f55b"], "id": 1, "jsonrpc": "2.0"}' https://earpc.apothem.network
which apparently belongs to block0x037d2d9f0e9e5c38ee9fb0c6721f5873cee7984bfe3bca2f91974daadcebbfd7
Note that the two block hashes,
0xd28bc799751815a0923d673d97dc8ca932e32c41e1d1f8ec08956106bd981018
and0x037d2d9f0e9e5c38ee9fb0c6721f5873cee7984bfe3bca2f91974daadcebbfd7
, differ and match the log statements which sayIn your case, both of blocks
0x354ce39
and0x354ce45
contain the transaction hash0xc1b52110f52120b4faf9e8502d568fb6dc88e90b0acd9f48d0af443782b9f55b
. This is reported in github.com/XinFinOrg/XDPoSChain/pu.... Maybe this is a problem or bug. I will study your log messages later. Would you please share below files?Please set
ETHEREUM_REORG_THRESHOLD
to 1. You can refer to github.com/XinFinOrg/XDC-Graph-Nod....That seems like a bandaid solution that will end up with incorrect data long term. From the graph node docs
Note that we're not seeing this against the XDC mainnet, only the testnet. Are the RPC calls I provided above expected and correct behavior?
I'm not sure whether the mainnet has this issue. This issue will affect some software. But It's a very big project to solve it.
I'll write a script to check the duplicate transaction hashes on mainnet when I'm free.
The mainnet has same transaction hash bug also, such as both of blocks 39185599 and 39185611 has transaction hash 0x000f94c5677e68504bc8daabdb051d3f1e51fd626b59d9533f5fc55f656f6fd1. There is a fix already: github.com/XinFinOrg/XDPoSChain/pu.... Please wait for some time.