This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Support non-existing proofs in RwTable#291
Merged
Merged
Conversation
a192343 to
5503116
Compare
Merged
Contributor
We will need to add two additional columns, since the storage rows use all of the existing ones. |
5503116 to
ff5c524
Compare
z2trillion
approved these changes
Oct 4, 2022
- Add AccountFieldType.NonExisting in order to perform lookups from the EVM circuit that use non-existing proofs (for accounts) from the MPT Circuit via the State circuit. - Add MPTProofType.NonExistingStorageProof so that the MPT Circuit can prove non-existence of storage keys. - Update State Circuit to transparently use MPTProofType.NonExistingStorageProof for Storage entries when the MPT Lookup has committedValue == 0 and value == 0.
ff5c524 to
497b54e
Compare
This was referenced Nov 11, 2022
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
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.
The change that makes the State Circuit support non-existing proofs on the Storage Tag will require 2 IsZero gadgets (which require a column each). I'm not sure if there is any free column to be reused on Storage rows in the State Circuit, or 2 new columns need to be allocated.
I believe non-existence storage proofs support can be handled in 3 different ways:
RwTablefield calledNonExistenceStorage. Require all EVM circuits that perform storage read/writes to check if the proof is of non-existence (by adding 1 or 2 IsZero gadgets, depending on whether it's read or write). Then conditionally lookup to RwTable withNonExistenceStorageor `Storage.StorageorNonExistenceStorageby checking if value and valuePrev are 0 (with 2 IsZero gadgets)In #249 we discussed not doing option (c). I think option (b) is the best because it's transparent to the EVM Circuit, and also allows merging changes (for example, for an address and key there's a read where value=0, and then a write where value=v, the state circuit only performs 1 MPT lookup).
@z2trillion what do you think about this?
Resolve #249