lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
514 stars 144 forks source link

`Error: IlegalReturnValue` when try to run a cairo program with `--proof_mode` #1791

Closed FilipLaurentiu closed 3 months ago

FilipLaurentiu commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

cd cairo1-run

cargo run -r ../cairo_programs/cairo-1-programs/fibonacci.cairo --trace_file fibonacci.trace --memory_file fibonacci.memory --proof_mode --air_public_input=public_input.json --air_private_input=private_input.json --layout recursive
 cairo1-run git:(main) cargo run ../cairo_programs/cairo-1-programs/fibonacci.cairo --trace_file fibonacci.trace --memory_file fibonacci.memory --proof_mode --air_public_input=public_input.json --air_private_input=private_input.json --layout recursive
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `/home/filip/Learn/cairo-vm/target/debug/cairo1-run ../cairo_programs/cairo-1-programs/fibonacci.cairo --trace_file fibonacci.trace --memory_file fibonacci.memory --proof_mode --air_public_input=public_input.json --air_private_input=private_input.json --layout recursive`
Error: IlegalReturnValue

Expected behavior A clear and concise description of what you expected to happen.

What version/commit are you on? last version: 8b5d1c6

fmoletta commented 3 months ago

Running in proof_mode only allows Array<felt252> as input and output value, as stated in the crate's documentation. This is currently necessary to make cairo 1 programs provable