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

Uncle blocks are missing in eth_getBlockByHash RPC response #332

Closed
APshenkin opened this issue Mar 12, 2021 · 3 comments · Fixed by #333
Closed

Uncle blocks are missing in eth_getBlockByHash RPC response #332

APshenkin opened this issue Mar 12, 2021 · 3 comments · Fixed by #333

Comments

@APshenkin
Copy link

APshenkin commented Mar 12, 2021

Hi there,

Please note that this is an issue tracker reserved for bug reports and feature requests.

For general questions please use discord or the Ethereum stack exchange at https://ethereum.stackexchange.com.

System information

Geth version: 1.11.22
OS & Version: Windows/Linux/OSX Docker
Commit hash : (if develop)

Expected behaviour

eth_getBlockByHash should return uncles in data as array

Actual behaviour

uncles are missing

Steps to reproduce the behaviour

curl --location --request POST 'https://myetcnode.com' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": [
        "0x2733c5587974f120453b556a71bf096199c587b5a530d98d6a4d6a1746ec967b",
        true
    ],
    "id": 83
}'
@APshenkin APshenkin changed the title Uncle blocks are missing in eth_getBlockByHash RPC request Uncle blocks are missing in eth_getBlockByHash RPC response Mar 12, 2021
@APshenkin
Copy link
Author

Also eth_getBlockByHash don't return transactions array if it's empty. Seems like some issue with serialization? (it removes empty arrays from response)

@APshenkin
Copy link
Author

Seems related to this code.

Uncles []common.Hash `json:"uncles,omitempty"`

omitempty should be removed

@meowsbits
Copy link
Contributor

Yeap, I think you're right on. Will have a PR in today fixing this. Good catch, thank you!

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

Successfully merging a pull request may close this issue.

2 participants