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

Ability to backfill state information #23722

Closed
thomasj02 opened this issue Oct 12, 2021 · 3 comments
Closed

Ability to backfill state information #23722

thomasj02 opened this issue Oct 12, 2021 · 3 comments

Comments

@thomasj02
Copy link

Users who do fast sync or snap sync, even when pruning is disabled, are only able to access state information after the pivot block. There's no way for a user to access information even one block before the pivot without syncing an archive node.

I'd like to propose a feature to backfill state information. From a UI perspective, the user can specify a block number N, and all state information for blocks N to the latest block are downloaded.

I'm a new geth developer, but I would be willing to help with implementing this feature if someone can provide guidance.

@s1na
Copy link
Contributor

s1na commented Oct 13, 2021

The issue is we can't download state entries for blocks before the pivot block. That's because other nodes on the network prune their state and won't serve us those entries. That said even with a full (non-archive) sync geth maintains "state checkpoints" every once in a while so that you can re-generate the state for block N by re-executing blocks from the last checkpoint.

@thomasj02
Copy link
Author

Thanks, that makes sense. I assume that archive nodes or nodes that are keeping significant history are rare enough that it's just not practical?

Re-generating the state seems totally reasonable if a non-full user can get the state checkpoint data. Are the state checkpoints you're referring to the same thing as snapshots?

@s1na
Copy link
Contributor

s1na commented Oct 14, 2021

Thanks, that makes sense. I assume that archive nodes or nodes that are keeping significant history are rare enough that it's just not practical?

Yep pretty much infeasible AFAIK.

No snapshots are an accelerating data structure where you store only the leaves of the state trie and read them via single disk access. These checkpoints are blocks for which you have the full state trie and exactly which blocks you have is different based on a couple of factors and they're not the same between users (you can see your nodes checkpoints by debug_getAccessibleState, see #23646). So you can't really expect multiple nodes to be able to feed you state for the same old block.

@holiman holiman closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@holiman @s1na @thomasj02 and others