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

eth_getLogs return wrong blockHash in logs (after 2.0.0 upgrade) #650

Open
VladMatyunin opened this issue Sep 30, 2024 · 1 comment
Open

Comments

@VladMatyunin
Copy link

In the last stable release of node (2.0.0) I've faced up with the following issue: the eth_getLogs method returns wrong block hash in the logs response in a self-deployed node. Below are the examples with 1.6.0 release vs 2.0.0 (you can see that v1.6 node returns correct blockHash, while 2.0 - wrong):

Command:

curl -k --user someauth https://urltonode.com --data-raw '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock":"0x4C8A306", "toBlock": "0x4C8A306"}],"id":"sadasq1"}' --header 'Content-Type: application/json'

Node v2.0.0 Response:

{
  "jsonrpc": "2.0",
  "id": "sadasq1",
  "result": [
    {
      "address": "0x0000000000000000000000000000000000000092",
      "topics": [],
      "data": "0x",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0xd06201af75527dc46f573c4c4b558ec15623446c0694f1e674279f9df049c8ef",
      "transactionIndex": "0x0",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x0",
      "removed": false
    },
    {
      "address": "0x951857744785e80e2de051c32ee7b25f9c458c42",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e",
        "0x00000000000000000000000061b7b0009fced05695ee811b7f8f78ba37c38344"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000000015d3ef79800",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x1",
      "removed": false
    },
    {
      "address": "0xfa4ddcfa8e3d0475f544d0de469277cf6e0a6fd1",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000490a37cfed26b73",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x2",
      "removed": false
    },
    {
      "address": "0x951857744785e80e2de051c32ee7b25f9c458c42",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000005543df729c000",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x3",
      "removed": false
    },
    {
      "address": "0x2340cd5ec3e6c51c217212f5092d56d594f0bd0e",
      "topics": [
        "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67",
        "0x000000000000000000000000ecf4ea7907e779b8a7d0f90cb95fe06f43b610fb",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000005543df729c000fffffffffffffffffffffffffffffffffffffffffffffffffb6f5c83012d948d000000000000000000000000000000000000000ee21a72b847dc794c2859c07c000000000000000000000000000000000000000000054c3baeecedc586c97967000000000000000000000000000000000000000000000000000000000000d2f7",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x4",
      "removed": false
    },
    {
      "address": "0x8d470bde66ee52981d7d29bc2e6fca3b4dc17879",
      "topics": [
        "0x4736edcab43476194077e25fadaf13bbfb18c7db442202d616b41fd1d549dc9c",
        "0x0000000000000000000000000000000000000000000000000066d8f64d9a4ffc",
        "0x0000000000000000000000000000000000000000000000000000000066f7380e"
      ],
      "data": "0x",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x24529db9dbe187dbb8c44fab0a8af8705c756cd62ca9ee3af617d610a6ca4420",
      "transactionIndex": "0x4",
      "blockHash": "0xc7173695db69068292df5d0354b34630dcfc7041557e54fb23b28fd8b0ba527b",
      "logIndex": "0x5",
      "removed": false
    }
  ]
}

Node v1.6.0 Response for the same request:

{
  "jsonrpc": "2.0",
  "id": "sadasq1",
  "result": [
    {
      "address": "0x0000000000000000000000000000000000000092",
      "topics": [],
      "data": "0x",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0xd06201af75527dc46f573c4c4b558ec15623446c0694f1e674279f9df049c8ef",
      "transactionIndex": "0x0",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x0",
      "removed": false
    },
    {
      "address": "0x951857744785e80e2de051c32ee7b25f9c458c42",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e",
        "0x00000000000000000000000061b7b0009fced05695ee811b7f8f78ba37c38344"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000000015d3ef79800",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x1",
      "removed": false
    },
    {
      "address": "0xfa4ddcfa8e3d0475f544d0de469277cf6e0a6fd1",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000490a37cfed26b73",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x2",
      "removed": false
    },
    {
      "address": "0x951857744785e80e2de051c32ee7b25f9c458c42",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b",
        "0x0000000000000000000000002340cd5ec3e6c51c217212f5092d56d594f0bd0e"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000005543df729c000",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x3",
      "removed": false
    },
    {
      "address": "0x2340cd5ec3e6c51c217212f5092d56d594f0bd0e",
      "topics": [
        "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67",
        "0x000000000000000000000000ecf4ea7907e779b8a7d0f90cb95fe06f43b610fb",
        "0x0000000000000000000000000e0f27454205a2c70f75b5e626567c654700760b"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000005543df729c000fffffffffffffffffffffffffffffffffffffffffffffffffb6f5c83012d948d000000000000000000000000000000000000000ee21a72b847dc794c2859c07c000000000000000000000000000000000000000000054c3baeecedc586c97967000000000000000000000000000000000000000000000000000000000000d2f7",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x16f1833a098c5ab15db5911765cf585698c02e0a2d5c0d9419393c79679c3035",
      "transactionIndex": "0x1",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x4",
      "removed": false
    },
    {
      "address": "0x8d470bde66ee52981d7d29bc2e6fca3b4dc17879",
      "topics": [
        "0x4736edcab43476194077e25fadaf13bbfb18c7db442202d616b41fd1d549dc9c",
        "0x0000000000000000000000000000000000000000000000000066d8f64d9a4ffc",
        "0x0000000000000000000000000000000000000000000000000000000066f7380e"
      ],
      "data": "0x",
      "blockNumber": "0x4c8a306",
      "transactionHash": "0x24529db9dbe187dbb8c44fab0a8af8705c756cd62ca9ee3af617d610a6ca4420",
      "transactionIndex": "0x4",
      "blockHash": "0x0bd0a112e9b669ca477fe5177949d13136740226e590acf620d3bf72a869f59b",
      "logIndex": "0x5",
      "removed": false
    }
  ]
}
@gzliudan
Copy link
Collaborator

gzliudan commented Oct 10, 2024

I will look into this issue. As a temporary solution, would you please apply PR #320 on your RPC node first ?

gzliudan added a commit to gzliudan/XDPoSChain that referenced this issue Oct 16, 2024
gzliudan added a commit that referenced this issue Oct 16, 2024
return right blockHash for eth_getLogs (#650)
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

2 participants