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

State diffing at head can leave gaps #393

Closed
dboreham opened this issue Jun 1, 2023 · 3 comments
Closed

State diffing at head can leave gaps #393

dboreham opened this issue Jun 1, 2023 · 3 comments
Assignees

Comments

@dboreham
Copy link

dboreham commented Jun 1, 2023

If some fatal error occurs in state diffing inside geth (such as this), after re-start a gap in the set of state diff data in the database can result.

geth shouldn't leave gaps even when it exits due to a fatal error / crash and is re-started.

@telackey
Copy link

Gap detection and filling has been added to https://git.vdb.to/cerc-io/chain-chunker .

It is useful when there are known to be gaps (eg, after an incident) and could be used to fill smaller gaps, such as those created by restarting the containers automatically (eg, by cron job).

In short, in makes it quite easy to fix gaps, however, it does nothing to prevent gaps, which is more of the the issue here.

Statediffing for head is triggered by the event feed for the blockchain. These events are triggered after the block is processed by geth. When geth is restarted, it will start syncing from the last block it successfully processed. However, statediffing (since it is event based) will start from the next block that geth processes. This allows for small gaps to open, since any statediffs which were in-flight at the time geth was restarted will not be triggered again.

The likely fix is to add a check (probably on restart, but perhaps periodic) which looks for any gap between the current block_number and max(block_number) from eth.header_cids and triggers statediffing accordingly.

@telackey
Copy link

I'm going to close this one as a duplicate of #292

@telackey telackey closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants