Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

StorageDoesNotExist lookups #1724

Closed
wants to merge 3 commits into from

Conversation

miha-stopar
Copy link
Collaborator

@miha-stopar miha-stopar commented Jan 9, 2024

Description

This PR introduces non-existing proofs for the initial state circuit for the leaves that don't exist yet in the trie. The required changes in the MPT circuit are implemented here.

Issue Link

The related issue is here, but this PR only partially resolves it.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@@ -359,6 +359,8 @@ impl<F: Field> Circuit<F> for InitialStateCircuit<F> {
vec![q_enable * xnif(is_last_or_padding.expr(), new_root_propagation.expr())]
});

/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miha-stopar can you elaborate more why are you disabling this check?

The idea is that we have a consecutive set of non-changing transformations (the initial values) and a consecutive set of changing transformations (the changes in the block). Here I see that you remove the check of this transition, but I cannot see how this links with the non-existing-proofs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly the constraint ensures that if the root changed in the previous row, it needs to change in the current row as well. However, in the non-existing-proofs the root doesn't change from S to C (old_root to new_root) proofs - both proofs are the same and have the same root (only one would suffice, it's just because of the circuit layout).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adria0 There were four subtle things that were causing this constraint failure:

  • implicitly created accounts
  • the read proofs has been mixed within the write proofs (now they are at the beginning)
  • the read proof was tried to be generated also for the accounts that didn't exist in the old block
  • double entries that you fixed in a0b86fb

Seems like now works ok :)

@ed255 ed255 modified the milestone: ZK Light Client part 2 Jan 18, 2024
@ed255 ed255 linked an issue Jan 18, 2024 that may be closed by this pull request
@miha-stopar
Copy link
Collaborator Author

Closing this because the light client is deprecated. I wrote down the observations and fixes from this PR in the MPT specs: privacy-scaling-explorations/zkevm-specs@8fd8bc8

miha-stopar added a commit that referenced this pull request Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MPT issues found by light client big blocks
3 participants