Skip to content

Commit

Permalink
Merge 0.11 into main (lambdaclass#498)
Browse files Browse the repository at this point in the history
* Migrate to cairo 0.11 (lambdaclass#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* Add new contracts to include Poseidon for computing class hash (lambdaclass#242)

* Warnings

* Cargo fmt

* fmt

* Migrate to cairo 0.11 (lambdaclass#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* Rolling back using the deprecated names

* Fixing VM to use included builtin

* Removing dead code

* fmt

* Renames fmt

---------

Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>

* rename BusinessLogicSyscallHandler (lambdaclass#268)

* Fix cargo lock

* Fix merge issues from main (lambdaclass#278)

* Update to the new release of cairo-rs (lambdaclass#269)

* Update cairo-rs version & Fix new changes

* Change cair-lang to 0.11 & Fix serialization issue

* Remove old modules from starknet_rs_py

* Comment starknet_rs_py_test due to failure in CI

* Add BusinessLogicSyscallHandlerStruct (lambdaclass#279)

* add new BLSH struct

* Rename old trait

* use renamed trait

* Use segment arena builtin (lambdaclass#283)

* Initialized SegmentArenaBuiltin for CairoRunner in execution_entry_point

* Updated error message expected in test

* add empty syscallhandler trait (lambdaclass#321)

* Rename deprecated syscall request/response structs/modules (lambdaclass#327)

* Prefix syscalls with Deprecated

* Add SyscallResponse common fields

* Rename `syscall_response` -> `body`

* Remove `failure_flag` field

* Add utils::get_felt_range

* Add missing variants

* Refactor: separate deprecated BLSyscallHandler and SyscallHandler into own files (lambdaclass#332)

* Refactor SyscallResponse for crate visibility and optionality in ResponseBody (lambdaclass#331)

* Refactor for optionality in field ResponseBody

* Change visibility level to crate

* Add new version of syscall send_message_to_l1 (lambdaclass#324)

* Rename old syscall functions & Add new syscall req

* Add implementation FromPtr to new syscall

* Add new syscall to SyscallHandler

* Add incomplete impl of BLSyscall Handler

* Add send_message_to_L1 for BLSyscall Handler

* Refactor ResponseBody as optional field

* Add missing changes

* Declare version2 (lambdaclass#243)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* Implement declare version 2

* Add version 2 of declare

* Sierra compiler

* comments to fix sierra

* Add structs for version 2

* Port functions to hash internal declare v2

* Add hash value into declare v2 structure

* comment function to fix in another ticker

* Fix clippy errors

* test

* delete core lib

* add test json

* Order change and poseidon builtin

* Remove old comments

* delete debug info

* Comment declare v2 test till sierra compiler is working

* move ContractClass to ContractClasses::ContractClass

* Update starknet-rs-py

* rename ContractClass to DeprecatedContractClass

* Revert commits move ContractClass to ContractClasses::ContractClass, Update starknet-rs-py and rename ContractClass to DeprecatedContractClass

* fix conflicts of merge

* Restore pre commit

---------

Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Pedro Fontana <pedro.fontana@lamdaclass.com>

* Add storage_write syscall (lambdaclass#345)

* Add StorageWriteRequest

* Add storage_write syscall

* Update syscall_storage_write

* Adding CompiledContractClass (lambdaclass#353)

* Moved current ContractClass to deprecated_conctract_class module and added Casm and Compiled Contract Classes

* Used Box to prevent clippy warning

* Made to_cairo_runner_program function public

* Add `deploy` syscall (lambdaclass#329)

* Add SyscallHandler::deploy related methods

* Rename old FromPtr trait and add new one

* Add request

* Code restructuration

* Fix format

* merge main

* Add todo comment

* Add to do comment

* Fix merge

* fix clippy

* Fix merge conflict

* Add allocate_segment function

---------

Co-authored-by: Milton <milton.scuderi@lambdaclass.com>
Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>

* Selector to syscall map (lambdaclass#346)

* Adding map

* Adding missing newline after copying file

* Initializing with lazy_static

* Format macro code

* Implement storage cached state (lambdaclass#363)

* Implement functins in state reader trait

* Fix function calls and borrow checker warnings

* Fix internals

* Add field to InMemoryStateReader

* Add setters

* Update storage_write syscall (lambdaclass#354)

* Add call_contract syscall for cairo 0.11 (lambdaclass#326)

* Add SyscallHandler

* Add call_contract signature

* Add cairo-lang reference code

* Add SyscallHandler.read_and_validate_syscall_request

* Add BusinessLogicSyscallHandler.increment_syscall_count()

* Add SyscallHandler.read_syscall_request()

* Refactor: separate deprecated syscall handler in different files

* Add BusinessLogicSyscallHandler.expected_syscall_ptr

* Add Call parameters

* Add execution_entry_point

* Add call execution

* Update SyscallHandler.call_contract

* Fix compile errors

* Remove unused file

* Update syscall call_contract

* Implement new `library_call` syscall and deprecate older one (lambdaclass#325)

* Library call syscall merge

* Change syscall ptr to request

* Merge fixes

* clippy fmt

* Fix merge issues

* Fix ExecutionEntryPoint::new

---------

Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Nacho <amigoigna@gmail.com>

* Add StateDiff.class_hash_to_compiled_class (lambdaclass#352)

* Add StateDiff.class_hash_to_compiled_class

* Implement squash for class_hash_to_compiled_class

* Update StateDiff.class_hash_to_compiled_class data type

* Add StateCache.compiled_class_hash

* Update StateDiff.from_cached_state

* Fix tests

* Add TODO

* Remove unused CompiledClass

* add necessary step for actions to run on queue (lambdaclass#373)

* Add storage read syscall (lambdaclass#340)

* save work

* save work

* add impl of req/res structs

* fix clippy errors

* use syscallRequest instead of reloc ptr

* remove unnecessary allow

* New version of syscall `emit_event` (lambdaclass#323)

* Implement utils::get_felt_range

* New SyscallRequest:EmitEvent and deprecate old one

* Implement new syscall emit_event

* use syscallResponse instead of empty result

* rename EmitEvent request struct

* refactor emit_event method to use request struct instead of pointer

* fix function call

* remove unnecessary allow

---------

Co-authored-by: SantiagoPittella <pittellasantiago@gmail.com>

* Implement `syscall()` and minor refactors (lambdaclass#371)

* Implement cairo-lang's syscall()

* Update business_logic_syscall_handler.rs

* Retrieve gas as u64

* clippy fmt

* merge fixes

* Addressing reviews

* Merge conflicts fix

* add get_block_timestamp implementation (lambdaclass#378)

* get block number syscall (lambdaclass#379)

* Refactor execution entrypoint execute (lambdaclass#369)

* Refactor StateReader.get_compiled_class

* Remove unwrap

* Add _execute_version0_class

* Update InternalDeclare

* Fix compile error

* Revert "Fix compile error"

This reverts commit 32fdc99.

* Revert fix

* Revert "Update InternalDeclare"

This reverts commit 726b09e.

* Remove get_compiled_classes

* Fix get_compiled_class

* Fix get_compiled_class

* Move deprecated/casm branch execution to execute()

* Cairo 1 Hint Processor crate (lambdaclass#384)

* Cleanup

* Update hint_processor.rs

* Execute internal declare v2 (lambdaclass#377)

* Execution function

* Rewrite verify version

* Fix clippy

* Add Cairo1HintProcessor.alloc_segment (lambdaclass#388)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

---------

Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>

* Add test less than hint (lambdaclass#389)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

* Add Cairo1HintProcessor.test_less_than

* add test_less_than_or_equal hint (lambdaclass#397)

---------

Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Santiago Pittella <87827390+SantiagoPittella@users.noreply.github.com>

* Linear Split (lambdaclass#399)

* Assert le is first arc excluded (lambdaclass#407)

* AssertLeIsFirstArcExcluded

* activate actions

* Fix clippy

* Optional hash (lambdaclass#380)

* Accept hash as a parameter

* Fix clippy

* Add sqrt hint (lambdaclass#390)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

* Add Cairo1HintProcessor.test_less_than

* Add Cairo1HintProcessor.square_root

---------

Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>

* Add div mod hint (lambdaclass#391)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

* Add Cairo1HintProcessor.test_less_than

* Add Cairo1HintProcessor.square_root

* Add Cairo1HintProcessor.div_mod

* Fix state api

* Uint256 Div Mod hint (lambdaclass#398)

* Uint256_div_mod hint for hintprocessor

* clippy

* Clippy fmt

* Fix merge error

* Update Cargo.toml

newline

* Remove duplicate function

* clippy fmt

* Remove unused match

---------

Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>

* Assert le is second arc excluded (lambdaclass#412)

* Add assert_le_is_second_excluded hint

* Reverse order for clarity

* Add assert le find small arcs (lambdaclass#406)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Alloc felt256 (lambdaclass#422)

* Alloc Felt 256 Dict

* Add dict manager mod

* Change hint interface

* Remove panic in exchange for HintError::CustomHint

* Add DebugPrint (lambdaclass#439)

* Add get next dict key (lambdaclass#424)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Add base hint

* Add Cairo1HintProcessor.read_dict

* Add get_next_dict_key

* Remove expect

* update cairo-vm to latest version (lambdaclass#440)

* update cairo-vm to latest version

* remove unwraps

* remove felt packages

* fix wrong identifier

* fix tests

* U256squareroot (lambdaclass#442)

* Uint256 square root

* Fic clippy

* ShouldSkipSquashLoop (lambdaclass#448)

* ShouldSkipSquashLoop

* Remove unwrap

* fix clippy

* Change pre commit (lambdaclass#453)

* Change pre commit

* Change pre commit to format

* Add felt252 dict read and write (lambdaclass#423)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Add base hint

* Add Cairo1HintProcessor.read_dict

* Add Felt252 Dict Write hint (lambdaclass#425)

* Add Felt252 Dict Write hint

* Merge fixes, clippy fmt

* Merge conflict resolution fixes

* Remove expect

* Remove other expects

* Remove unnecesary match

---------

Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Nacho <amigoigna@gmail.com>

* Add assert_all_accesses_used (lambdaclass#452)

* RandomEcPoint (lambdaclass#413)

* RandomEcPoint

* Import macro

* remove expects (lambdaclass#451)

* remove expects

* remove unnecessary error mapping

* GetCurrentAccessDelta (lambdaclass#444)

* GetCurrentAccessDelta

* remove unwrap

* Remove unwrap and expected

* Delete comment

* Dict Entry Init (lambdaclass#441)

* Implement dict entry init

* Connflict resolution

* Remove expect()

* Init squash data (lambdaclass#446)

* Init squash data

* change expect for hint error

* Add field_sqrt (lambdaclass#414)

* add AssertLtAssertValidInput hint (lambdaclass#456)

* GetCurrentAccessIndex (lambdaclass#445)

* Felt252 dict entry update (lambdaclass#443)

* Felt252DictEntryUpdate

* merge 0.11

* Add should_continue_squash_loop (lambdaclass#447)

* Add should_continue_squash_loop

* Update current_access_indices

* Commit

* `AssertAllKeysUsed` hint implementation (lambdaclass#458)

* Hint implementation

* Remove unused arg

* fmt fix

* Add assert current indices is empty (lambdaclass#449)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Add base hint

* Add Cairo1HintProcessor.read_dict

* Add get_next_dict_key

* Remove expect

* Add assert_current_access_indices_is_empty

* assert_current_access_indices_is_empty fails when no current_access_indices

* Implement alloc constant size (lambdaclass#469)

* Implement assert le assert third arc excluded (lambdaclass#471)

* New execute (lambdaclass#426)

* Refactor StateReader.get_compiled_class

* Remove unwrap

* Add _execute_version0_class

* Update InternalDeclare

* Fix compile error

* Revert "Fix compile error"

This reverts commit 32fdc99.

* Revert fix

* Revert "Update InternalDeclare"

This reverts commit 726b09e.

* Remove get_compiled_classes

* Fix get_compiled_class

* Fix get_compiled_class

* Move deprecated/casm branch execution to execute()

* Added entry_point_execution v2

* Added some TODO comments and fixed a clippy warning

* Fixed repeated implementation of allocate_segment function

---------

Co-authored-by: matias-gonz <maigonzalez@fi.uba.ar>

* Remove duplicate function (lambdaclass#460)

* remove cairo 1 hint processor crate (lambdaclass#479)

* Refactor syscall handlers (lambdaclass#473)

* Refactor StateReader.get_compiled_class

* Remove unwrap

* Add _execute_version0_class

* Update InternalDeclare

* Fix compile error

* Revert "Fix compile error"

This reverts commit 32fdc99.

* Revert fix

* Revert "Update InternalDeclare"

This reverts commit 726b09e.

* Remove get_compiled_classes

* Fix get_compiled_class

* Fix get_compiled_class

* Move deprecated/casm branch execution to execute()

* Added entry_point_execution v2

* Added some TODO comments and fixed a clippy warning

* Fixed repeated implementation of allocate_segment function

* Big execution refactor

* removed unused casm_contract_class

* Removed unneeded dummy StarknetRunner creation to initialize os_context

* Added support_reverted parameter to execution_entry_point and removed unused code

* Fixed some PR review comments

* Fixed some PR review comments

---------

Co-authored-by: matias-gonz <maigonzalez@fi.uba.ar>

* Add casm compilation (lambdaclass#470)

* Store casm class in InternalDeclare

* Move store casm implementantion

* Refactor casm compilation and storage

* Refactor casm test

* Refactor casm test to add sierra compilation

* Little refactor to avoid clones

* Check that can retrieve casm contract class from storage

* Change panic for unreachable

* delete cairo-hint-processor

* Modificate .ignore to avoid cairo/ and sierra files

* Modificate Makefile to pin a cairo repo version

* Modificate Makefile to fetch repo with https

* Modificate Makefile to compile sierra in coverage

* Migrate to cairo 0.11 (lambdaclass#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* Rename bl syscall handler with deprecated

* add objects.rs tests (lambdaclass#482)

* add replace_class syscall to deprecated bl

* rename syscall handler with deprecated

* use builtin arena

* refactor deprecated structs

* add new files for bl

* Add utils function

* Delete starknet-rs-py (lambdaclass#494)

* merge 0.11

* remove references to rs-py

* fix tests

* Remove references to rs-py

* update starknet-api version

* add newline at EOF

* Remove references in storage related things

* Remove unused function

* change wrong unreachable code

* remove unnecessary clone()

* fix tests

---------

Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Milton <milton.scuderi@lambdaclass.com>
Co-authored-by: Roberto Catalan <rcatalan@itba.edu.ar>
Co-authored-by: ElFantasma <estebandh@gmail.com>
Co-authored-by: Tomás <47506558+MegaRedHand@users.noreply.github.com>
Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>
Co-authored-by: Nacho <amigoigna@gmail.com>
Co-authored-by: Pedro Fontana <pedro.fontana@lamdaclass.com>
Co-authored-by: Amin Arria <arria.amin@gmail.com>
Co-authored-by: mfachal <647731+mfachal@users.noreply.github.com>
Co-authored-by: juanbono <juanbono94@gmail.com>
  • Loading branch information
13 people authored May 20, 2023
1 parent 3b980f7 commit 2501a16
Show file tree
Hide file tree
Showing 115 changed files with 9,317 additions and 6,603 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,6 @@ jobs:
run: make deps
- name: Run tests
run: make test

test-py:
runs-on: ubuntu-20.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Deps
run: make deps
- name: Run rs-py tests
run: make test-py

coverage:
runs-on: ubuntu-20.04
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# will have compiled files and executables
debug/
target/

cairo/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
#Cargo.lock
Expand Down Expand Up @@ -39,6 +39,7 @@ target/

starknet-venv/
**/*.json
cairo_programs/cairo_1_contracts/*.sierra
default.profraw
**.DS_Store
/scripts/reports
Expand Down
3 changes: 1 addition & 2 deletions .rusty-hook.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[hooks]
pre-commit = "cargo fmt --all -- --check"

pre-commit = "cargo fmt --all -- --check && make clippy"
[logging]
verbose = true
Loading

0 comments on commit 2501a16

Please sign in to comment.