scroll-tech / go-ethereum

Scroll's fork of the official Go implementation of the Ethereum protocol
GNU Lesser General Public License v3.0
470 stars 271 forks source link

fix: blockhash mismatch #913

Open jonastheis opened 1 month ago

jonastheis commented 1 month ago

1. Purpose or design rationale of this PR

This PR fixes the problem of mismatching block hashes due to the missing header fields difficulty and extraData in DA. It should be reviewed in conjunction with https://github.com/scroll-tech/go-ethereum/pull/903, which provides a way to prepare this missing data and describes the format in more detail.

Specifically, this PR implements a missing header fields manager that:

Tested on mainnet:

inserted block with hash 0xd229dc5edaebccff15987f42bb5c23060b3f0372251e19e843f1bb69742bfab1 blockchain height=64500

https://scrollscan.com/block/64500: 0xd229dc5edaebccff15987f42bb5c23060b3f0372251e19e843f1bb69742bfab1

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

3. Deployment tag versioning

Has the version in params/version.go been updated?

4. Breaking change label

Does this PR have the breaking-change label?