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

core, eth, ethdb, trie: simplify range proofs #22762

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

karalabe
Copy link
Member

The snap sync range prover was overly complicated because snap sync originally needed the list of trie nodes reconstructed from the proofs to avoid duplicating code. Since snap sync nowadays does not require trie nodes for large contracts and can easily reconstruct them for small ones via stacktrie, a lot of code can be deleted.

The only catch is that stack tries silently commit data to the persistent backend, so if we want to continue to properly measure the storage metrics of snap sync, we need to hook into that silent black box. This PR does so by creating a HookedBatch, which just allows us to run some code when a caller Puts an item into a wrapped batch.

@karalabe karalabe added this to the 1.10.3 milestone Apr 28, 2021
@karalabe karalabe force-pushed the snap-lower-complexity branch from c927084 to 2a36665 Compare April 28, 2021 20:38
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, generally LGTM

trie/proof.go Outdated Show resolved Hide resolved
trie/proof.go Show resolved Hide resolved
trie/proof_test.go Show resolved Hide resolved
trie/proof_test.go Show resolved Hide resolved
@karalabe karalabe force-pushed the snap-lower-complexity branch from 2a36665 to fae165a Compare April 29, 2021 07:59
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

2 participants