erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.12k stars 1.11k forks source link

eth_getBlockByNumber does not return compatible response to geth when v,r,s are null #4948

Open PeaStew opened 2 years ago

PeaStew commented 2 years ago

System information

v2022.07.04

Polygon blockchain in this case but I suspect the issue is wide spread

Expected behaviour

In response to this call

{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xE4E1C0", true],"id":1}

The last response should be, if queried on Geth :

{ "blockHash": "0x2176fb1693c51cb956b68599b8f7705fd51be138ea43a71f7e3d3bc31fae4e7d", "blockNumber": "0xe4e1c0", "from": "0x0000000000000000000000000000000000000000", "gas": "0x0", "gasPrice": "0x0", "hash": "0x04fc48aaf20db66619419222408edfbf642520f7f08af553f180161a63687875", "input": "0x", "nonce": "0x0", "to": "0x0000000000000000000000000000000000000000", "transactionIndex": "0x184", "value": "0x0", "type": "0x0", "chainId": "0x0", "v": "0x0", "r": "0x0", "s": "0x0" }

Actual behaviour

Response is:

{ "blockHash": "0x2176fb1693c51cb956b68599b8f7705fd51be138ea43a71f7e3d3bc31fae4e7d", "blockNumber": "0xe4e1c0", "from": "0x0000000000000000000000000000000000000000", "gas": "0x0", "gasPrice": "0x0", "hash": "0x04fc48aaf20db66619419222408edfbf642520f7f08af553f180161a63687875", "input": "0x", "nonce": "0x0", "to": "0x0000000000000000000000000000000000000000", "transactionIndex": "0x184", "value": "0x0", "type": "0x0", "chainId": "0x0", "v": null, "r": null, "s": null }

Steps to reproduce the behaviour

query {"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xE4E1C0", true],"id":1} on polygon mainnet

PeaStew commented 2 years ago

@0xKrishna

PeaStew commented 2 years ago

I believe this is a serialization issue, when these values are null in the response, they are being ignored instead of being converted to "0x0", I suspect there is probably a setting that can be applied to substitute "0x0" for null values on a case by case basis, if not globally.

@mandrigin has suggested this may be the streaming processor.

yperbasis commented 8 months ago

Reported as still happening in v2.56.2.