-
Notifications
You must be signed in to change notification settings - Fork 39
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_getBlockByNumber doesn't follow Ethereum JSON-RPC API specification #700
Comments
e00dan
changed the title
Graph-node fails to index Axon chain
eth_getBlockByNumber doesn't follow Ethereum JSON-RPC API specification
Sep 13, 2022
Thanks for your report. Please fix this issue @ImJeremyHe thx. |
@kuzirashi Hello! Please pull the newest code. If the bug is still there, would you mind offering more details? curl 'http://127.0.0.1:8000/' \
-H 'Accept: */*' \
-H 'Accept-Language: zh-CN,zh;q=0.9' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: chrome-extension://coohjcphdfgbiolnekdpbcijmhambjff' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: none' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw $'{\n\u0009"jsonrpc":"2.0",\n\u0009"method":"eth_getBlockByNumber",\n\u0009"params":[\n\u0009\u0009"0x0", \n\u0009\u0009false\n\u0009],\n\u0009"id":1\n}\n' \
--compressed Output: {
"jsonrpc": "2.0",
"result": {
"hash": "0x03b46bcebf4b6e984342f10211fb95c805044e85de1fd2c9de6c29e8f941c929",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"author": "0x0000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"stateRoot": "0xdda84758b8397c4c86d4610fb98ee3dcd09cb92738a9ed64be715819ad585260",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"number": "0x0",
"gasUsed": "0x0",
"gasLimit": "0x0",
"extraData": "0x",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x61b828ca",
"difficulty": "0x0",
"totalDifficulty": null,
"sealFields": [],
"baseFeePerGas": "0x539",
"uncles": [],
"transactions": [
"0x3bbe1ebf56b864d91ff5d7505be6df8a13a232a3c5969b30ad5fd254226c6e6b",
"0x01240fb109c0c9ca0c095542d04140cc00d13bb66dd262ec088ba1b27424c8ac",
"0xdf58cdda98ae3139026750bda1e3100442b59f91e26b6adac5749e3b026219ef",
"0xfcbd67037cb8789fcb215cabed5e60a66afec59698a36d2afaa0cda626d66f07",
"0x41bdc59db755cd3da3f41c2fdaf936e16d16130b202a8fd3c608c06b14d243ce",
"0xca338c9e4eb563817bc363a243602b30c5a9608d94e3a04f948f60d40fc127f8",
"0x378803d6f9517956f38e67c773956cf646625775207080b237e82334cbebcdb2"
],
"size": "0x222",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000"
},
"id": 1
} This PR seems to have fixed the bug you mentioned. #647 |
Oh, thank you for the information! I've used Axon CLI for the test so maybe that's why I have older code. I will check the latest version! |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened:
Request:
returns block with "nonce": "0x0".
This is crashing graph-node events indexer because it expects 8 bytes of hex-encoded data.
What you expected to happen:
Nonce should be 8 bytes data:
"nonce": "0x0000000000000000"
According to Ethereum JSON RPC specification nonce should be 8 bytes: "nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block."
Source: https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash
Additional information:
I think Axon doesn't pad hex values length to what Ethereum spec uses. eg. Axon returns nonce: 0x0 instead of Rinkeby nonce: "nonce": "0x0000000000000000" for Genesis block.
Axon genesis block:
Rinkeby genesis block:
The text was updated successfully, but these errors were encountered: