Skip to content

v4.0.0

Latest

Choose a tag to compare

@YairVaknin-starkware YairVaknin-starkware released this 26 Nov 18:04
· 1 commit to main since this release
3c3f112

Cairo VM 4.0.0 splits the Cairo 1 hint processor into its own crate and adds a Stwo runner API. cairo-vm 4.0.0 · cairo1-hint-processor 4.0.0

Breaking changes

  • Replace the cairo-1-hints feature with a dependency on cairo1-hint-processor. Use cairo1_hint_processor::program_from_casm_contract_class to convert a CasmContractClass into a Program.
  • The VM rejects instructions that lack a dedicated Stwo opcode component with VirtualMachineError::GenericInstruction.
  • The extensive_hints feature has been removed. Runtime hints are always supported, and VirtualMachine::step and step_hint take a RunHints. The mod_builtin feature has also been removed.
  • Replace CairoRunner::new_v2 with CairoRunner::new(&Program, &CairoRunConfig). Pass the CairoLayout to CairoRunConfig::new. The former cairo_run::CairoRunConfig is now Cairo0RunConfig, and VirtualMachine::new takes &VirtualMachineConfig.
  • CairoRunner::run_from_entrypoint requires the test_utils feature. For calls by program counter, pass EntryPoint::Pc(pc) and a slice of CairoArg values.
  • get_extended_execution_resources returns counts as usize.

Other changes

  • The Stwo runner API includes StwoCairoRunConfig, cairo_run_stwo, and cairo_run_pie_stwo.
  • The VM caches decoded instructions across all executable segments, including segments that hold Starknet OS contracts.
  • Fixed off-by-one comparisons in the split_int, assert_250_bit, and sqrt hints.

4.0.0 changelog · Full comparison with v3.2.0