Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: expose serialize in RustVM pythonic hints #887

Merged
merged 7 commits into from
Feb 28, 2025

Conversation

enitrat
Copy link
Collaborator

@enitrat enitrat commented Feb 27, 2025

Exposes a serialize function, available in the scope of all hints, that enables the serialization using serde of cairo types, and returns their python representation.

This can be used for the logging / tracing system.

I am welcoming any alternative idea on the currently proposed design - as working with python globals() has been quite a hassle.

Also, i'm not sure yet how we can make this entirely transparent with the pythonVM runs. If we realize there's a need for that, we can do it later.

This does introduce a small performance overhead of about ~5% from what i've observed empirically. So in production we'll need to make sure we're not compiling with this flag.
Closes #883

@enitrat enitrat marked this pull request as draft February 27, 2025 18:10
@enitrat enitrat force-pushed the dev/serde-rustvm-compatible branch from e3d2402 to d875877 Compare February 28, 2025 09:31
@enitrat enitrat marked this pull request as ready for review February 28, 2025 09:31
ClementWalter
ClementWalter previously approved these changes Feb 28, 2025
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.24%. Comparing base (e81b61c) to head (cc2cb5c).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
- Coverage   81.92%   78.24%   -3.69%     
==========================================
  Files          64       64              
  Lines       15320    16746    +1426     
==========================================
+ Hits        12551    13103     +552     
- Misses       2769     3643     +874     
Flag Coverage Δ
ci 78.24% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementWalter ClementWalter merged commit 24e78b6 into main Feb 28, 2025
9 of 11 checks passed
@ClementWalter ClementWalter deleted the dev/serde-rustvm-compatible branch February 28, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev: make Serde usable from hints executed on Rust VM
2 participants