Skip to content

Commit

Permalink
Runner: use CairoProgram::assemble_ex for producing bytecode, which i…
Browse files Browse the repository at this point in the history
…ncludes constants data
  • Loading branch information
m-kus committed Oct 31, 2024
1 parent 159f67d commit 6c23578
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#### [2.0.0-rc0] - 2024-10-22

* fix: [#1864](https://github.com/lambdaclass/cairo-vm/pull/1864):
* Runner: include data from constants segment to the bytecode when assembling program

* chore: bump `cairo-lang-` dependencies to 2.9.0-dev.0 [#1858](https://github.com/lambdaclass/cairo-vm/pull/1858/files)

* chore: update Rust required version to 1.81.0 [#1857](https://github.com/lambdaclass/cairo-vm/pull/1857)
Expand Down
12 changes: 8 additions & 4 deletions cairo1-run/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,14 @@ pub fn cairo_run_program(
cairo_run_config.copy_to_output(),
);

let data: Vec<MaybeRelocatable> = instructions
.flat_map(|inst| inst.assemble().encode())
.map(|x| Felt252::from(&x))
.map(MaybeRelocatable::from)
// The bytecode includes all program instructions plus entry/footer,
// plus data from the constants segments.
let data: Vec<MaybeRelocatable> = casm_program
.assemble_ex(&entry_code.instructions, &libfunc_footer)
.bytecode
.into_iter()
.map(Into::<Felt252>::into)
.map(Into::<MaybeRelocatable>::into)
.collect();

let program = if cairo_run_config.proof_mode {
Expand Down

0 comments on commit 6c23578

Please sign in to comment.