This repository was archived by the owner on Apr 18, 2025. It is now read-only.
forked from privacy-ethereum/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 389
refactor ZktrieState [dup #903] #968
Merged
Merged
Conversation
This file contains hidden or 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
lispc
reviewed
Sep 27, 2023
lispc
approved these changes
Sep 27, 2023
lispc
left a comment
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.
nothing very bad but i cannot review line by line. can be merged first.
Member
Author
|
Have run mock proving on 40 batches (>200 chunks) from replayed alpha testnet, so far so good |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 duplicated the target of #903 with another approach:
We consider:
CircuitInputBuilderobject should not be reused for building more witness block after it is used insideblock_traces_to_witness_block_with_updated_state. as the result, we can updated theZktrieStatememeber in it into the zktrie state after the witness block is applied, just like thestate/code_dbmembers.Witnessgeneratordo not need a snapshot about account /storage states since all the information can be read from the underlying database (ZkMemoryDbhere) with trivial cost. SoZktrieStatealso do not need to keep such a snapshot inside it (they have been kept in state db).ZktrieStatenow can esaily switch to any state it have been once updated to, and create newZkTrieobject with almost no cost, which is ready for being updated by another witness block.