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
504 stars 138 forks source link

Refactor cairo1-run crate for library use #1623

Closed barabanovro closed 4 months ago

barabanovro commented 6 months ago

Is your feature request related to a problem? Please describe. The current implementation of cairo1-run crate as a CLI restricts its usability in other projects that could benefit from its functionality as a library.

Describe the solution you'd like Transform the cairo1-run crate into a standalone library that can be used by external projects. Ideally, the run function would return:

  1. Output of program execution.
  2. Relocated trace and memory.
  3. Sierra (with debug info) and CASM programs.
  4. CASM additional instructions (proof_mode_header, entry_code, libfunc_footer).
  5. Diagnostics.
  6. Compiler RootDatabase.

Motivation We need it for https://cairovm.codes and https://walnut.dev — projects aiming to build a debugger for Cairo / Starknet.

fmoletta commented 6 months ago

Hello! We recently refactored the cairo1-run crate to also expose a cairo_run_program function that takes a sierra program and returns the runner, vm, and return values after the run #1601

fmoletta commented 4 months ago

Closed by #1714