-
Notifications
You must be signed in to change notification settings - Fork 631
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
[ReshardingV3] State Witness #12019
Comments
[for old notes] ProofThe key proof is new state roots generation. (Do we ever need to check that K1 or K2 must exist?) VerifyingFirst, verifier proves that K1 < boundary <= K2 and there are no other keys in between (one trie iteration).
Note that path has enough information, new root is generated by removing information from the path and recomputing the hash. The result will be added as field (Check annoying usecases related to node compression and going to some extra children) |
GoalDescribe how to handle shard layout on stateless validation. OverviewThe chunk application logic contains many different steps. Some of them have to be adjusted in order to respect resharding. Though I prepare list of exact changes to be made, it may look messy.
PreparationThere is a specific step "new chunk extra generation" which will be mentioned couple times.
After that we continue normal processing. This diagram may help:
The vertical arrow is "manual chunk extra creation". We may need to add special condition for GC to remove these extra "extras". To implement that, we need to adjust code residing in process_resharding_results. This code belongs to ReshardingV2, but now it needs to be triggered only once, not for the whole epoch. ProofSee #12074. Stateless LogicStarting from start_validating_chunk...
There, in old shard layout, we need to pass parent of shard id. After prevalidation finishes, we start execution. We get
It must get header for parent shard id. 4.1: We have chunk extra for the prev block.Then we track shard and we should have new chunk extra generation completed. Thus, chunk extra for new shard layout will exist, so it is enough to do 4.2: We don't have chunk extra.Then validate_chunk_state_witness is called.
Stateful LogicThere is a lot of ReshardingV2 logic to remove. For example,
We won't discuss it here. Actual changes: Before epoch switch: Somewhere on epoch switch, we rely on new memtrie being generated which allows processing of chunks in the new layout. After epoch switch: On missing chunks: just new chunk extra will be generated with state root copied from the previous one. On the first chunk in new shard layout: On state witness generation, the previously generated proof must be included. Note that the changes are the same for nodes which only track the shard, excluding state witness sending. Next Steps
Challenges
|
Goals
The text was updated successfully, but these errors were encountered: