Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Mismatch Block Hash in RPC Response #721

Closed
ghost opened this issue Jan 17, 2021 · 1 comment · Fixed by #755
Closed

Mismatch Block Hash in RPC Response #721

ghost opened this issue Jan 17, 2021 · 1 comment · Fixed by #755

Comments

@ghost
Copy link

ghost commented Jan 17, 2021

System info:

In RPC eth.getBlock Response, the Block Hash is generated by header.Hash() which mismatch the header.LastBlockID.Hash.

For example, Block[N+1] Parent Hash != Block[N] Block Hash due to the Block[N].header.Hash() != Block[N+1]. header.LastBlockID.Hash.

Steps to reproduce:

Simply start the chain and observe the parentHash field of any Block Height > 1 and the previous Block in RPC eth.getBlock Response.

Some of the Block Hash may not equal the next Block's Parent Hash.

Expected behavior: Block[N] Hash = Block[N+1] Parent Hash

Actual behavior: Block[N] Hash != Block[N+1] Parent Hash

Additional info:

We may use back the BlockID information from the Tendermint ResultBlock Response to reproduce a correct Block Hash.

A simple modification can reference to Fix Web3 Block Hash

@fedekunze
Copy link
Contributor

closed via #755

freddyli7 pushed a commit that referenced this issue Apr 15, 2021
This was referenced Apr 15, 2021
freddyli7 added a commit that referenced this issue Apr 15, 2021
Co-authored-by: Freddy Li <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant