You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently public inputs are not given a pre verification. The following tasks improve robustness of the verifier:
Change the proving mode with a trace to actually use public memory (This may need a small PR to the cairo VM to add a derive deserialize to the public inputs, so we can load it)
Add an option to take a compiled program with proof mode from Cairo0, and use that code to check the public memory, enforcing the program used is the given one
Add an option to take a Cairo (1) Program as an input. Inside the code should be updated as the Cairo1 Proof Mode in the VM. Then public memory constraints should be applied.
Add small checks from the Starkex Verifier (rc min < rc max, etc)
Investigate additional checks to be added
For the first task, this is the recommended approach:
The VM currently serializes the public inputs in the same format as the old python VM, but can't deserialize because that's something it doesn't need. Now, since we have everything written in rust, it may be easier to just add the deserialize there in the Cairo VM. Most of the work is just adding a Deserialize derive everywhere. If I remember correctly the problem comes here
Since layout_params is a reference to something that is not in the public input, Serde can't derive how to create the data type.
We can start by replicating the PublicInput assuming there are no relevant layout params, or that we can write whatever we need ourselves (Like in plain layout). And then add a From method to transform this new struct that can be something like PublicInputForDeserializer, to the real PublicInput. And if we have this it's easy to include in the proof or use them to verify.
The text was updated successfully, but these errors were encountered:
Currently public inputs are not given a pre verification. The following tasks improve robustness of the verifier:
For the first task, this is the recommended approach:
We have the public inputs here
https://github.com/lambdaclass/cairo-vm/blob/8f2ddf818f2797cd1a38486b646a09384fd71f9e/vm/src/air_public_input.rs#L59-L68
The VM currently serializes the public inputs in the same format as the old python VM, but can't deserialize because that's something it doesn't need. Now, since we have everything written in rust, it may be easier to just add the deserialize there in the Cairo VM. Most of the work is just adding a Deserialize derive everywhere. If I remember correctly the problem comes here
https://github.com/lambdaclass/cairo-vm/blob/8f2ddf818f2797cd1a38486b646a09384fd71f9e/vm/src/air_public_input.rs#L66-L67
Since layout_params is a reference to something that is not in the public input, Serde can't derive how to create the data type.
We can start by replicating the PublicInput assuming there are no relevant layout params, or that we can write whatever we need ourselves (Like in plain layout). And then add a From method to transform this new struct that can be something like PublicInputForDeserializer, to the real PublicInput. And if we have this it's easy to include in the proof or use them to verify.
The text was updated successfully, but these errors were encountered: