Polygon `eth_getTransactionReceipt` returns null
System information
Erigon version: v2.33.1
OS & Version: Ubuntu
Commit hash : abb26b080
chain: bor-mainnet
Expected behaviour
eth_getTransactionReceipt on 0x591ca00bf6b404e24e21732023abc0416673beff9586f37e61fb0f07ca560940 should return not null content.
Other bor state sync transactions seem to have the same issue, but not all of them:
- Good return for
0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131at block 36647936 from #6286 - Null return for
0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631adat block 29562816 from #6319
Maybe I need a fresh new sync or rerun some stages completely?
Actual behaviour
Null returned, described above.
Steps to reproduce the behaviour
- chain data is downloaded from https://snapshot.polygon.technology/
- I downloaded on 2023-01-12 and it was erigon-archive-snapshot-2022-12-13.tar.gz, synced to around 36M
- I also had a self-synced chain data, started around v2.31.0, upgraded with the releases. Issue is the same but I did not note down the txn hashes.
- run rpcdaemon and
curl --location --request POST {{ endpoint }} \
--header 'Content-Type: application/json' \
--data-raw '{
"method": "eth_getTransactionReceipt",
"params": [
"0x591ca00bf6b404e24e21732023abc0416673beff9586f37e61fb0f07ca560940"
],
"id": 1,
"jsonrpc": "2.0"
}'
Backtrace
[backtrace]
Same issue here, did you manage to find a fix? You can reproduce the issue by sending this to a Polygon archive node from Chainstack (running on Erigon and this version announced: erigon/0.0.5/linux-amd64/go1.18.1) but I also managed to reproduce it on a standalone archive node running erigon/2.34.0/linux-amd64/go1.18.3:
{
"jsonrpc":"2.0",
"method":"eth_getTransactionReceipt",
"params":[
"0x9117f00b17db9f4b548be5c728f0fd1e57c48a14744a4b0b8fc93c614d3888d5"
],
"id":"1"
}
Response:
{
"jsonrpc": "2.0",
"id": "1",
"result": null
}
This transaction is a valid state-sync transaction that emits a "Transfer" log: https://polygonscan.com/tx/0x9117f00b17db9f4b548be5c728f0fd1e57c48a14744a4b0b8fc93c614d3888d5
The weird thing is asking logs of this blocks returns the logs of this transaction:
{
"jsonrpc":"2.0",
"method":"eth_getLogs",
"params":[{
"fromBlock": 2240,
"toBlock": 2240
}],
"id":"1"
}
Response:
{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x000000000000000000000000a2d9846c352ca61dcb20d6aad40cec1d1b228a78"
],
"data": "0x0000000000000000000000000000000000000000000000007e9b682a0de380000000000000000000000000000000000000000000204fcce2c5a141f7f9a0000000000000000000000000000000000000000000000000000060fffa7ce3616a000000000000000000000000000000000000000000204fcce24705d9cdebbc8000000000000000000000000000000000000000000000000000df9b62a6f144ea00",
"blockNumber": "0x8c0",
"transactionHash": "0x451ea74363975f0f991a4ab484fe95b164ff70367c6765ad5d3d91fb6fb37203",
"transactionIndex": "0x0",
"blockHash": "0xf5d6089907b8f37f71b072334fddc70ed1b17cafc72451f006dd7eb4e22f2f1d",
"logIndex": "0x0",
"removed": false
},
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0x4e2ca0515ed1aef1395f66b5303bb5d6f1bf9d61a353fa53f73f8ac9973fa9f6",
"0x0000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"0x000000000000000000000000a2d9846c352ca61dcb20d6aad40cec1d1b228a78"
],
"data": "0x0000000000000000000000000000000000000000000000007e9b682a0de3800000000000000000000000000000000000000000000000000060fffa7ce3616a00000000000000000000000000000000000000000000000000df9b62a6f144ea00",
"blockNumber": "0x8c0",
"transactionHash": "0x451ea74363975f0f991a4ab484fe95b164ff70367c6765ad5d3d91fb6fb37203",
"transactionIndex": "0x0",
"blockHash": "0xf5d6089907b8f37f71b072334fddc70ed1b17cafc72451f006dd7eb4e22f2f1d",
"logIndex": "0x1",
"removed": false
},
{
"address": "0xd9c7c4ed4b66858301d0cb28cc88bf655fe34861",
"topics": [
"0xec3afb067bce33c5a294470ec5b29e6759301cd3928550490c6d48816cdc2f5d",
"0x0000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x000000000000000000000000a2d9846c352ca61dcb20d6aad40cec1d1b228a78"
],
"data": "0x0000000000000000000000000000000000000000000000007e9b682a0de380000000000000000000000000000000000000000000000000000000000000013881",
"blockNumber": "0x8c0",
"transactionHash": "0x451ea74363975f0f991a4ab484fe95b164ff70367c6765ad5d3d91fb6fb37203",
"transactionIndex": "0x0",
"blockHash": "0xf5d6089907b8f37f71b072334fddc70ed1b17cafc72451f006dd7eb4e22f2f1d",
"logIndex": "0x2",
"removed": false
}
]
}
So my idea is that maybe something fails in another part of the receipt function like the status or gas information and the node returns null in this case, which is clearly not ideal.
Not resolved by 2.35.1
Have same problem on erigon v2.37.0 and v2.36.1 and polygon (bor-mainnet).
Request:
curl -i -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x04fc48aaf20db66619419222408edfbf642520f7f08af553f180161a63687875"], "id":1}' http://127.0.0.1:8545
Response:
{"jsonrpc":"2.0","id":1,"result":null}
But same request to bor returns information as it should be.
In addition to all context above, it seems there are two type of errors returned:
- error: block has less receipts than expected: 0 <= 0 (ref. #6730 and #6289 )
- null
txhash to reproduce error 1: 0x0fff012db1ec67cbd27c1defc5652e78bbf84edb45a80ba711b4bdb456f02869
txhash to reproduce error 2:
"0x1b275ab128cf896f06f9b193e7fd6aa31dc02ea0999fba997c8aeeb4aa12b1a0"
"0xe3d674168ba370c3ded4829304b9ed8a57e6ede4d17c4596a737dceff4a33bdc"
"0x5b97d1a92dd877242d33334d3d060855466245493382a2d3f2ac62cae6639e4e"
"0x067384207d2547727ea6ead41027fc581fd3bd671341a8722f1e8f2867fd3978"
"0xb48c60ee099f91e06fc1cd064cb38f052e1dc773584ebede30fd27bc3e9ce0b9"
"0x35eea817ba01c3739be1e987da657419fa048e2f4de73e3a07606da652cd75d4"
"0x831cdfa113279ba0ae0a08cf16e7ae9e281a7ae7b9a1d79c765aa9ae3b98322f"
"0x0d717ddea0f70593f4d5f2fd1e0c12549a7b4b9b1cc31e63198a636ec8453be0"
Tested on erigon v2.36.0
Same problem curl --location --request POST 'http://localhost:8545' \
--header 'Content-Type: application/json'
--data-raw '{ "jsonrpc":"2.0", "method":"eth_getTransactionReceipt", "params":["0xc396cc74956ba20e1ef3c95e8c68f5de2fe7df28210baf8c683d74e0db40469f"], "id":1 }'''' {"jsonrpc":"2.0","id":1,"result":null}
Erigon v2.38.1 version
Same problem with 2.39.0
Same with this call on v2.38.1
{
"method": "eth_getBlockByHash",
"params": [
"0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6",
false
],
"id": 1,
"jsonrpc": "2.0"
}
A key factor to consider is the way your node has been synced. Older versions were pruning this information, and if your node was using snapshots produced by older version you will encounter this problem on older blocks. I have a node running v2.38.1 that returns correct data for the tx hashes listed above. That node was synced form scratch using the parameter --snapshots=false
Can --snapshots=false be enabled on bor-mainnet? Last time I tired I was told it was the wrong configuration and was changed to true automatically
Same problem with v2.40.1.
if your node was using snapshots produced by older version you will encounter this problem on older blocks. I have a node running v2.38.1 that returns correct data for the tx hashes listed above. That node was synced form scratch using the parameter --snapshots=false
@madumas
We synced with polygon mainnet with --snapshots=true, is there a way to redownload the correct snapshot to resolve this issue?
Don't download the snapshot. Sync the blocks directly using --snapshots=false command line argument. You have to start this from empty database. Use a recent version of erigon, like erigon version 2.40.1-stable-94b4cee5
This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.