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

Genesis block not retrievable through eth_getBlockByNumber / eth_getBlockByHash #10385

Closed
raulk opened this issue Mar 3, 2023 · 0 comments · Fixed by #10389
Closed

Genesis block not retrievable through eth_getBlockByNumber / eth_getBlockByHash #10385

raulk opened this issue Mar 3, 2023 · 0 comments · Fixed by #10389
Assignees
Labels
area/api area/fvm kind/bug Kind: Bug P2 P2: Should be resolved
Milestone

Comments

@raulk
Copy link
Member

raulk commented Mar 3, 2023

Original report: https://filecoinproject.slack.com/archives/C04JEJB82RY/p1677833154264019

Observation

$ curl --data '{"jsonrpc": "2.0", "id":1, "method": "eth_getBlockByNumber", "params": ["0x0",true] }' -H 'Content-Type:application/json' https://api.hyperspace.node.glif.io/rpc/v1

Returns an error:

$ {"jsonrpc":"2.0","id":1,"error":{"code":1,"message":"get block bafyreiaqpwbbyjo4a42saasj36kkrpv4tsherf2e7bvezkert2a7dhonoi: cbor input should be of type array"}}

But correctly retrieves the first block:

$ curl --data '{"jsonrpc": "2.0", "id":1, "method": "eth_getBlockByNumber", "params": ["0x1",true] }' -H 'Content-Type:application/json' https://api.hyperspace.node.glif.io/rpc/v1

However, Filecoin.ChainGetTipsetByHeight works:

$ curl --data '{"jsonrpc": "2.0", "id":1, "method": "Filecoin.ChainGetTipSetByHeight", "params": [0,null]}' -H 'Content-Type:application/json' https://api.hyperspace.node.glif.io/rpc/v1

{"jsonrpc":"2.0","result":{"Cids":[{"/":"bafy2bzacebqfpeylmrl4h3pq4ofbdj2bfbw2i45fuy6qm4wxcyebpsxhrpqhu"}],"Blocks":[{"Miner":"t00","Ticket":{"VRFProof":"ZA4LPiLg3ODL5gSxjI+5qIowATHNTwlxIADDrxC4X0M="},"ElectionProof":{"WinCount":0,"VRFProof":null},"BeaconEntries":[{"Round":0,"Data":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}],"WinPoStProof":null,"Parents":[{"/":"bafyreiaqpwbbyjo4a42saasj36kkrpv4tsherf2e7bvezkert2a7dhonoi"}],"ParentWeight":"0","Height":0,"ParentStateRoot":{"/":"bafy2bzacedd6s23oi2zrc74vadn6rqx725svbrdl7wstgygasx6jb3tedt6x4"},"ParentMessageReceipts":{"/":"bafy2bzacedswlcz5ddgqnyo3sak3jmhmkxashisnlpq6ujgyhe4mlobzpnhs6"},"Messages":{"/":"bafy2bzacecmda75ovposbdateg7eyhwij65zklgyijgcjwynlklmqazpwlhba"},"BLSAggregate":null,"Timestamp":1673848800,"BlockSig":null,"ForkSignaling":0,"ParentBaseFee":"100000000"}],"Height":0},"id":1}

Impact

Explorers and graph traversal tools may error.

Resolution

Reproduce with a test and fix.

@jennijuju jennijuju added this to the v1.20.1 milestone Mar 3, 2023
@jennijuju jennijuju added P2 P2: Should be resolved kind/bug Kind: Bug area/api area/fvm labels Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api area/fvm kind/bug Kind: Bug P2 P2: Should be resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants