[wip]: trie: stacktrie initialization from proof #28231
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is (the start of) an alternative to #28225, and the successor to the abandoned #24560 .
This PR implements initializing a stacktrie using a proof. The stacktrie can then be filled with keys.
If this approach is used to initialize the
genTrie
s, we will avoid the corruption on left-hand side in the chunks.This PR still does not implement right-hand hash-filling, which is a required step if we want to use stacktrie to replace regular trie in verifying trie subslices.
An alternative to right-hand hash-filling, is a one-time conversion from
stacktrie -> trie
. After converting from stacktrie to trie, it would be very simple to feed in the right hand side of the proof, and complete the verification.In order to simplify that part, I think it would make sense to first move ahead with #28233 -- that would make the stacktrie more "alike" the regular trie, with distinction between "the trie itself" and the internal nodes.