-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
[WIP]: improve snapshot generation #22465
Conversation
This is a neat idea, and I'm sure we'll iterate on it a bit.
I'd expect this to decrease the error-margin of the snap layer probably by an order of magnitude or more. |
accTrie, err := trie.NewSecure(dl.root, dl.triedb) | ||
// Verify the state segment with range prover, ensure that all flat states | ||
// in this range correspond to merkle trie. | ||
_, _, _, cont, err := trie.VerifyRangeProof(root, origin, last, keys, vals, proof) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you ignore the db here, it would be neat to use a version of the range prover which uses the stacktrie instead of the full trie.
OTOH it doesn't matter a whole lot, since you're only using a few hundred key/values per iteration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the stacktrie is not suitable for range prove. Stacktrie expects all the inputs from the most left side and to the most right side. It won't accept the segment in the middle, even the segment is continuous.
* core/state/snapshot: refactor * core/state/snapshot: tiny fix and polish Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
core/state/snapshot: less copy core/state/snapshot: revert split loop core/state/snapshot: handle storage becoming empty, improve test robustness core/state: test modified codehash core/state/snapshot: polish
Can we close this in favour of #22504 ? |
Implements https://gist.github.com/rjl493456442/85832a0c760f2bafe2a69e33efe68c60, a better snapshot generation mechanism.
The range-proving based snapshot generation can be used in lots of different purposes.
So that the snapshot UX can be improved a bit.