cerc-io / go-ethereum

Read-only mirror of https://git.vdb.to/cerc-io/go-ethereum (Statediffing-fork of the official Go implementation of the Ethereum protocol)
https://git.vdb.to/cerc-io/go-ethereum
GNU Lesser General Public License v3.0
13 stars 4 forks source link

Possibility of statediffing gap if restarted in the midst of a reorg #402

Closed telackey closed 11 months ago

telackey commented 1 year ago

The current reorg handling code chases backwards to fill in missing parents. If that interrupted part way through it would leave a gap. That gap would not be noticed by the current gap checking code which is purely numeric, and we do have a block at that height, it is just the wrong one.

We should improve the gap checking code to consider not just numbers, but missing parents as well.