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

Run CasmContractClass #1098

Merged
merged 87 commits into from
May 8, 2023
Merged

Run CasmContractClass #1098

merged 87 commits into from
May 8, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented May 2, 2023

TITLE

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #1098 (9feb172) into main (e284753) will decrease coverage by 1.75%.
The diff coverage is 16.88%.

@@            Coverage Diff             @@
##             main    #1098      +/-   ##
==========================================
- Coverage   98.15%   96.41%   -1.75%     
==========================================
  Files          85       88       +3     
  Lines       34561    35319     +758     
==========================================
+ Hits        33924    34053     +129     
- Misses        637     1266     +629     
Impacted Files Coverage Δ
...t_processor/cairo_1_hint_processor/dict_manager.rs 0.00% <0.00%> (ø)
...processor/cairo_1_hint_processor/hint_processor.rs 11.11% <11.11%> (ø)
...sor/cairo_1_hint_processor/hint_processor_utils.rs 32.09% <32.09%> (ø)
src/types/program.rs 99.46% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fmoletta fmoletta marked this pull request as ready for review May 5, 2023 21:18
@pefontana
Copy link
Member

Nice one @fmoletta !!!
I too think that it would be better to have this in a separate crate, but as long as it's easy to move it later to a cairo-lang crate then it's OK for me

Copy link
Member

@juanbono juanbono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pefontana pefontana added this pull request to the merge queue May 8, 2023
Merged via the queue into main with commit a789eee May 8, 2023
30 of 31 checks passed
@pefontana pefontana deleted the run-casm-contract-class branch May 8, 2023 21:57
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Implement TryFrom<CasmContractClass> for Program

* Add cairo1hintprocessor dependency

* Map hints to pc

* Add Cairo1HintProcessor

* Move cairo-1-hint-processor to cairo-rs crate

* fixes

* Fix test helper

* Remove allow

* fix test func

* Add builtins to test

* Extract builtins from contract_class

* Add _builtin to builtin names in etrypoint data

* Copy logic from cairo1 contract execution in starknet

* Remove unused code

* Use lower initial_gas value

* Add program segment size argument

* Check return values in run_cairo_1_entrypoint fn

* Remove debug prints

* Add basic fibonacci test

* Add another fibonacci case

* Always verify secure

* Clippy

* Compile casm contracts when running test target

* Remove unwrap from cell_ref_to_relocatable

* Remove paniking macro from extract_buffer

* Misc improvements

* Misc improvements

* Misc improvements

* Misc improvements

* Remove unwraps & asserts from DictSquashExecScope::pop_current_key

* Remove unwraps & asserts from DictManagerExecScope::new_default_dict

* Remove expect from get_dict_tracker

* Add constants for cairo 1 compiler binaries in makefile

* Add cairo 1 compiler to deps target in makefile

* Add cairo folder to clean target

* Remove todo from execute method

* Separate helper functions from Cairo1HintProcessor implementation

* Add untracked file

* Fix

* Add changelog entry

* Add a job to compile cairo 1 contracts in ci

* Add job dependency

* Fix yml syntax

* Fix yml syntax

* Temporarily extempt cairo-1-hint-processor from codecov

* Fix yml syntax

* Fix workflow

* Remove cache code from new job

* Fix yml syntax

* Fix wrong path

* Fix makefile

* Build only compiler binaries

* Add cairo-1-contracts-cache

* Fetch contracts cache in jobs that need them

* Use no-std version of HashMap

* Import stdlib::prelude::*

* Wrap print in not-wasm block

* Remove std path

* use slices instead of vec

* Make DictSquashExecScope fields private

* Import hint processor dependencies without default features

* -Clippy

* Add type

* Compile cairo 1 contracts in build-programs job

* Rename cache

* Use target dependency instead of explicit $(MAKE)

* Fix yml syntax

* Check for cairo folder before cloning cairo repo

* Ommit folder name

* Swap paths

* Add cairo-1-hints feature flag

* Add compile-hint feature to tests run in workflow

* Add cairo-1-hints to test_utils

* Add cairo-1-hints to test_utils

* Use both paths when fetching compiled test data

* Remove cairo-1-hints feature from test_utils feature

* Move dependencies to cairo-1-hints feature

* Update CHANGELOG.md

* Fix cfg directive

* Add cairo-1-hints to test workflow

* Add Cairo 1 considerations for Gitignore and Makefile (lambdaclass#1144)

* Add ignore for casm and sierra files

* Add libfunc experimental for cairo 1 compilation

* Add new enty to CHANGELOG

* Fix rust.yml

---------

Co-authored-by: Roberto Catalan <robertitocatalan@gmail.com>
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.

Execute a CasmContractClass program
5 participants