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

wrong data response #227

Closed
fenghaojiang opened this issue Sep 18, 2023 · 13 comments
Closed

wrong data response #227

fenghaojiang opened this issue Sep 18, 2023 · 13 comments

Comments

@fenghaojiang
Copy link

Chain/Network:
bsc

Steps to reproduce the behaviour

curl -X "POST" "http://localhost:8545/" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_call",
  "params": [
    {"to":"0xb4f4cd1cc2dff1a14c4aaa9e9434a92082855c64", "data":"0x0902f1ac", "id": 1}, "0x1daadce"
  ]
}'

Expected behaviour

{"jsonrpc":"2.0","id":1,"result":"0x00000000000000000000000000000000000000000000af6a0ed0be0d7e6429cd0000000000000000000000000000000000000000000003744bd08c13f11f61510000000000000000000000000000000000000000000000000000000064e6318d"}

Actual behaviour

{"id":1,"jsonrpc":"2.0","result":"0x"}
@blxdyx
Copy link
Collaborator

blxdyx commented Sep 18, 2023

image Seem it's right.

@fenghaojiang
Copy link
Author

fenghaojiang commented Sep 18, 2023

I think something went wrong when sync data. Plz check this API:

curl -X "POST" "https://rpc.ankr.com/bsc" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "jsonrpc": "2.0",
  "id": 253216,
  "method": "eth_getBlockReceipts",
  "params": [
    "0x1e34185"
  ]
}'

The ankr response normally with last transaction receipt info:

{
            "blockHash":"0xf52a957b6af2b7b1ded117b699d75f9795833b9e338e036cd0651902af2ed22e",
            "blockNumber":"0x1e34185",
            "contractAddress":null,
            "cumulativeGasUsed":"0x9550b3",
            "effectiveGasPrice":"0x3a6691e9df",
            "from":"0xcc8e6d00c17eb431350c6c50d8b8f05176b90b11",
            "gasUsed":"0x8557",
            "logs":[
                {
                    "address":"0x0000000000000000000000000000000000001000",
                    "topics":[
                        "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
                    ],
                    "data":"0x00000000000000000000000000000000000000000000000000192583a7c78537",
                    "blockNumber":"0x1e34185",
                    "transactionHash":"0x2920a7c1028b60df417682e2da3a2455dd4d2d2f928a9505a4542e10a8d5838d",
                    "transactionIndex":"0x86",
                    "blockHash":"0xf52a957b6af2b7b1ded117b699d75f9795833b9e338e036cd0651902af2ed22e",
                    "logIndex":"0xec",
                    "removed":false
                },
                {
                    "address":"0x0000000000000000000000000000000000001000",
                    "topics":[
                        "0x93a090ecc682c002995fad3c85b30c5651d7fd29b0be5da9d784a3302aedc055",
                        "0x000000000000000000000000cc8e6d00c17eb431350c6c50d8b8f05176b90b11"
                    ],
                    "data":"0x00000000000000000000000000000000000000000000000000e251a0e603aef0",
                    "blockNumber":"0x1e34185",
                    "transactionHash":"0x2920a7c1028b60df417682e2da3a2455dd4d2d2f928a9505a4542e10a8d5838d",
                    "transactionIndex":"0x86",
                    "blockHash":"0xf52a957b6af2b7b1ded117b699d75f9795833b9e338e036cd0651902af2ed22e",
                    "logIndex":"0xed",
                    "removed":false
                }
            ],
            "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000020000200000000000000000000080000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000030000000000000000000000000000000000000000000000",
            "status":"0x1",
            "to":"0x1f55109a910f20ae7303d5defb9c07fcabbd1177",
            "transactionHash":"0x2920a7c1028b60df417682e2da3a2455dd4d2d2f928a9505a4542e10a8d5838d",
            "transactionIndex":"0x86",
            "type":"0x0"
}

While my node response:

{
            "blockHash":"0xde3b1f6e784e88635943c2a62a5d905eded1d7d66f47e81451589acd8de8c414",
            "blockNumber":"0x1de2408",
            "contractAddress":null,
            "cumulativeGasUsed":"0x80b3fc",
            "from":"0x7ae2f5b9e386cd1b50a4550696d957cb4900f03a",
            "gasUsed":"0x8557",
            "logs":[
                {
                    "address":"0x0000000000000000000000000000000000001000",
                    "topics":[
                        "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
                    ],
                    "data":"0x000000000000000000000000000000000000000000000000000a45094ef3bccc",
                    "blockNumber":"0x1de2408",
                    "transactionHash":"0xb3159d3ea1034eff82209ef2c582ffdc5d57d2300534806d3165a5c137372261",
                    "transactionIndex":"0x56",
                    "blockHash":"0xde3b1f6e784e88635943c2a62a5d905eded1d7d66f47e81451589acd8de8c414",
                    "logIndex":"0xfe",
                    "removed":false
                },
                {
                    "address":"0x0000000000000000000000000000000000001000",
                    "topics":[
                        "0x93a090ecc682c002995fad3c85b30c5651d7fd29b0be5da9d784a3302aedc055",
                        "0x0000000000000000000000007ae2f5b9e386cd1b50a4550696d957cb4900f03a"
                    ],
                    "data":"0x000000000000000000000000000000000000000000000000005c6d53c691a32d",
                    "blockNumber":"0x1de2408",
                    "transactionHash":"0xb3159d3ea1034eff82209ef2c582ffdc5d57d2300534806d3165a5c137372261",
                    "transactionIndex":"0x56",
                    "blockHash":"0xde3b1f6e784e88635943c2a62a5d905eded1d7d66f47e81451589acd8de8c414",
                    "logIndex":"0xff",
                    "removed":false
                }
            ],
            "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010010000000000000000000000000000200020000200200000000000000000080000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000010000000000000000000000000000000000000000000000",
            "status":"0x1",
            "to":"0x0000000000000000000000000000000000001000",
            "transactionHash":"0xb3159d3ea1034eff82209ef2c582ffdc5d57d2300534806d3165a5c137372261",
            "transactionIndex":"0x56"
}

How could I fix these data and resync if nothing goes wrong?

@blxdyx
Copy link
Collaborator

blxdyx commented Sep 18, 2023

try headers_stage reset, if not work,may need resync from the snapshot

@rayn316
Copy link

rayn316 commented Sep 20, 2023

@blxdyx
I see that there are many reorganizations and repairs in the historical version. Could it be that the previous data has been damaged? After upgrading to the latest version, the previous data has been damaged and all the data has been synchronized to the present. It is bad.

@fenghaojiang
Copy link
Author

@blxdyx I see that there are many reorganizations and repairs in the historical version. Could it be that the previous data has been damaged? After upgrading to the latest version, the previous data has been damaged and all the data has been synchronized to the present. It is bad.

Agreed, same situation seems happened on my server. Frustrated when facing the problem

@zhy827827
Copy link

zhy827827 commented Sep 20, 2023

I resync from the snapshot.but

curl -X "POST" "http://localhost:8545/" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_call",
  "params": [
    {"to":"0xb4f4cd1cc2dff1a14c4aaa9e9434a92082855c64", "data":"0x0902f1ac", "id": 1}, "0x1daadce"
  ]
}'

{"jsonrpc":"2.0","id":1,"result":"0x"}

how to fix this issues?

@blxdyx
Copy link
Collaborator

blxdyx commented Sep 20, 2023

Need more investigate

@blxdyx I see that there are many reorganizations and repairs in the historical version. Could it be that the previous data has been damaged? After upgrading to the latest version, the previous data has been damaged and all the data has been synchronized to the present. It is bad.
there are something wrong with the history data, resync may help

@zhy827827
Copy link

i use snapshot verison erigon_data_20230905

@blxdyx
Copy link
Collaborator

blxdyx commented Sep 20, 2023

It's resposed correct in my local archive node.

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Oct 31, 2023
@blxdyx
Copy link
Collaborator

blxdyx commented Oct 31, 2023

Fix by this:#234

@github-actions github-actions bot removed the Stale label Nov 1, 2023
@blxdyx
Copy link
Collaborator

blxdyx commented Nov 6, 2023

Reopen if still have some problems.

@blxdyx blxdyx closed this as completed Nov 6, 2023
@fenghaojiang
Copy link
Author

Reopen if still have some problems.

Ok. Appreciate to your works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants