Skip to content

Commit

Permalink
Use return type info from sierra when serializing return values in ca…
Browse files Browse the repository at this point in the history
…iro1-run crate (#1665)

* Start implementing new serialize_output

* Handle enums

* Add extra handling for boolean enums

* Use new serialization in main loop

* Handle panic wrapper

* Fix panic handling

* Fix variant idx calc

* Add test for dict with struct

* Add Array & Snapshot

* Fix

* Handle box + fix spellings + update tests

* Update test value

* Add signed felt

* Add test for squashed dict

* Handle Nullable being Null

* Complete unhandled barnches

* Clippy

* Remove old impl of serialize_output

* Add Changelog entry

* Fix comments

* Remove empty case

* Fox typo

* Handle multiple array formats when serializing

* Add test

* Fix test value

---------

Co-authored-by: Pedro Fontana <[email protected]>
  • Loading branch information
fmoletta and pefontana authored Mar 18, 2024
1 parent c4d2108 commit f887435
Show file tree
Hide file tree
Showing 9 changed files with 577 additions and 139 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## Cairo-VM Changelog

#### Upcoming Changes

* feat(BREAKING): Use return type info from sierra when serializing return values in cairo1-run crate [#1665](https://github.com/lambdaclass/cairo-vm/pull/1665)
* Removed public function `serialize_output`.
* Add field `serialize_output` to `Cairo1RunConfig`.
* Function `cairo_run_program` now returns an extra `Option<String>` value with the serialized output if `serialize_output` is enabled in the config.
* Output serialization improved as it now uses the sierra program data to identify return value's types.

* feat: add a `--tracer` option which hosts a web server that shows the line by line execution of cairo code along with memory registers [#1265](https://github.com/lambdaclass/cairo-vm/pull/1265)

* feat: Fix error handling in `initialize_state`[#1657](https://github.com/lambdaclass/cairo-vm/pull/1657)
Expand Down
1 change: 1 addition & 0 deletions cairo1-run/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bincode.workspace = true
assert_matches = "1.5.0"
rstest = "0.17.0"
mimalloc = { version = "0.1.37", default-features = false, optional = true }
num-traits = { version = "0.2", default-features = false }

[features]
default = ["with_mimalloc"]
Expand Down
Loading

0 comments on commit f887435

Please sign in to comment.