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

396: Don't skip any blocks if the head of the chain advances by more than one block. #397

Closed telackey closed 1 year ago

telackey commented 1 year ago

As https://github.com/cerc-io/go-ethereum/issues/396 shows, we can get scenarios when the chain advances by more than a single block, but the event which is seen by the WriteLoop will only be for the new head block--however many blocks in advance it is--allowing gaps to open in the statediffing.

This code will detect and trigger statediffing for the skipped blocks. The functionality is similar to the previous "head gap" filling code. Similar enough that we are able to remove that code and allow this to cover both cases.