-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate proof for resharding (retain_multi_range) and check that it is valid against existing retain tests, already including memtrie and disktrie. Surprisingly, #12390 allows to make the change almost invisible. The actual work here is to move `&mut TrieRecorder` inside `TrieChangesTracker` which is inside `MemTrieUpdate`. Reasoning: when we work with `MemTrieUpdate`, it is in fact unique owner of the logic to record proof (what I called "2nd stage" in the previous PR, after "1st stage" of trie lookups). And now, if we are sure that proof doesn't need values, `MemTrieUpdate` can fully hold the `&mut`, because memtrie has all the necessary information, and we can record nodes directly on node access instead of doing it retroactively (which was really bad). `TrieRecorder` now is passed as a separate mode to process memtrie updates. We indeed need three modes - on loading we don't record anything, for non-validators we save trie changes, for validators we also save proofs. And after that, all we need to do for `retain_split_shard` is to create `TrieRecorder` and in the end get recorded storage from it. Next step will be to validate this proof in the actual state witness processing...
- Loading branch information
1 parent
8d180da
commit 6934fc2
Showing
6 changed files
with
149 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.