Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Selector to syscall map #346

Merged
merged 5 commits into from
Apr 19, 2023
Merged

Selector to syscall map #346

merged 5 commits into from
Apr 19, 2023

Conversation

igamigo
Copy link
Contributor

@igamigo igamigo commented Apr 17, 2023

Closes #343

This PR adds a map from selector to syscall as seen in new_syscalls.cairo
Example output of BusinessLogicSyscallHandler::create_selector_to_syscall_map()

{92376026794327011772951660: "library_call", 25500403217443378527601783667: "replace_class", 94901967946959054011942058057773508207: "get_execution_info", 100890693370601760042082660: "storage_read", 20853273475220472486191784820: "call_contract", 433017908768303439907196859243777073: "send_message_to_l1", 75202468540281: "deploy", 1280709301550335749748: "emit_event", 25828017502874050592466629733: "storage_write"}

@igamigo igamigo changed the base branch from main to library-call-syscall April 17, 2023 20:23
Copy link
Collaborator

@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.

Please see comments

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Merging #346 (db24f1a) into library-call-syscall (9515ef1) will decrease coverage by 0.21%.
The diff coverage is 0.00%.

@@                   Coverage Diff                    @@
##           library-call-syscall     #346      +/-   ##
========================================================
- Coverage                 89.63%   89.42%   -0.21%     
========================================================
  Files                        52       52              
  Lines                      8995     9016      +21     
========================================================
  Hits                       8063     8063              
- Misses                      932      953      +21     
Impacted Files Coverage Δ
...rc/core/syscalls/business_logic_syscall_handler.rs 0.00% <0.00%> (ø)

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

@igamigo igamigo marked this pull request as ready for review April 18, 2023 16:33
@igamigo igamigo force-pushed the library-call-syscall branch from 0daf65b to 9515ef1 Compare April 18, 2023 18:24
@igamigo igamigo force-pushed the selector-to-syscall branch from 788dc03 to ac95f87 Compare April 18, 2023 18:46
@igamigo
Copy link
Contributor Author

igamigo commented Apr 18, 2023

@juanbono after hardcoding the map as we discussed offline, I also removed new_syscalls.cairo since we don't read from it anymore. It might still be a good idea to include it though, as you wish.

@igamigo igamigo requested a review from juanbono April 18, 2023 18:50
Copy link
Collaborator

@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

@juanbono
Copy link
Collaborator

@igamigo yes, we should include it to compile it later and use its functions in tests

Base automatically changed from library-call-syscall to add_call_contract_syscall April 19, 2023 15:34
@igamigo igamigo force-pushed the selector-to-syscall branch from c2edf4e to c894054 Compare April 19, 2023 18:17
@igamigo igamigo changed the base branch from add_call_contract_syscall to 0.11 April 19, 2023 18:19
Copy link
Collaborator

@SantiagoPittella SantiagoPittella left a comment

Choose a reason for hiding this comment

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

LGTM

@igamigo igamigo added this pull request to the merge queue Apr 19, 2023
Merged via the queue into 0.11 with commit e3dbe03 Apr 19, 2023
@juanbono juanbono deleted the selector-to-syscall branch April 19, 2023 19:43
juanbono added a commit that referenced this pull request May 20, 2023
* Migrate to cairo 0.11 (#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

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

* Warnings

* Cargo fmt

* fmt

* Migrate to cairo 0.11 (#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 (#268)

* Fix cargo lock

* Fix merge issues from main (#278)

* Update to the new release of cairo-rs (#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 (#279)

* add new BLSH struct

* Rename old trait

* use renamed trait

* Use segment arena builtin (#283)

* Initialized SegmentArenaBuiltin for CairoRunner in execution_entry_point

* Updated error message expected in test

* add empty syscallhandler trait (#321)

* Rename deprecated syscall request/response structs/modules (#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 (#332)

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

* Refactor for optionality in field ResponseBody

* Change visibility level to crate

* Add new version of syscall send_message_to_l1 (#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 (#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 (#345)

* Add StorageWriteRequest

* Add storage_write syscall

* Update syscall_storage_write

* Adding CompiledContractClass (#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 (#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 (#346)

* Adding map

* Adding missing newline after copying file

* Initializing with lazy_static

* Format macro code

* Implement storage cached state (#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 (#354)

* Add call_contract syscall for cairo 0.11 (#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 (#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 (#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 (#373)

* Add storage read syscall (#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` (#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 (#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 (#378)

* get block number syscall (#379)

* Refactor execution entrypoint execute (#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 (#384)

* Cleanup

* Update hint_processor.rs

* Execute internal declare v2 (#377)

* Execution function

* Rewrite verify version

* Fix clippy

* Add Cairo1HintProcessor.alloc_segment (#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 (#389)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

* Add Cairo1HintProcessor.test_less_than

* add test_less_than_or_equal hint (#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 (#399)

* Assert le is first arc excluded (#407)

* AssertLeIsFirstArcExcluded

* activate actions

* Fix clippy

* Optional hash (#380)

* Accept hash as a parameter

* Fix clippy

* Add sqrt hint (#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 (#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 (#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 (#412)

* Add assert_le_is_second_excluded hint

* Reverse order for clarity

* Add assert le find small arcs (#406)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Alloc felt256 (#422)

* Alloc Felt 256 Dict

* Add dict manager mod

* Change hint interface

* Remove panic in exchange for HintError::CustomHint

* Add DebugPrint (#439)

* Add get next dict key (#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 (#440)

* update cairo-vm to latest version

* remove unwraps

* remove felt packages

* fix wrong identifier

* fix tests

* U256squareroot (#442)

* Uint256 square root

* Fic clippy

* ShouldSkipSquashLoop (#448)

* ShouldSkipSquashLoop

* Remove unwrap

* fix clippy

* Change pre commit (#453)

* Change pre commit

* Change pre commit to format

* Add felt252 dict read and write (#423)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Add base hint

* Add Cairo1HintProcessor.read_dict

* Add Felt252 Dict Write hint (#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 (#452)

* RandomEcPoint (#413)

* RandomEcPoint

* Import macro

* remove expects (#451)

* remove expects

* remove unnecessary error mapping

* GetCurrentAccessDelta (#444)

* GetCurrentAccessDelta

* remove unwrap

* Remove unwrap and expected

* Delete comment

* Dict Entry Init (#441)

* Implement dict entry init

* Connflict resolution

* Remove expect()

* Init squash data (#446)

* Init squash data

* change expect for hint error

* Add field_sqrt (#414)

* add AssertLtAssertValidInput hint (#456)

* GetCurrentAccessIndex (#445)

* Felt252 dict entry update (#443)

* Felt252DictEntryUpdate

* merge 0.11

* Add should_continue_squash_loop (#447)

* Add should_continue_squash_loop

* Update current_access_indices

* Commit

* `AssertAllKeysUsed` hint implementation (#458)

* Hint implementation

* Remove unused arg

* fmt fix

* Add assert current indices is empty (#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 (#469)

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

* New execute (#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 (#460)

* remove cairo 1 hint processor crate (#479)

* Refactor syscall handlers (#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 (#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 (#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* Rename bl syscall handler with deprecated

* add objects.rs tests (#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 (#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>
ElFantasma pushed a commit that referenced this pull request May 21, 2023
* Migrate to cairo 0.11 (#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

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

* Warnings

* Cargo fmt

* fmt

* Migrate to cairo 0.11 (#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 (#268)

* Fix cargo lock

* Fix merge issues from main (#278)

* Update to the new release of cairo-rs (#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 (#279)

* add new BLSH struct

* Rename old trait

* use renamed trait

* Use segment arena builtin (#283)

* Initialized SegmentArenaBuiltin for CairoRunner in execution_entry_point

* Updated error message expected in test

* add empty syscallhandler trait (#321)

* Rename deprecated syscall request/response structs/modules (#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 (#332)

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

* Refactor for optionality in field ResponseBody

* Change visibility level to crate

* Add new version of syscall send_message_to_l1 (#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 (#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 (#345)

* Add StorageWriteRequest

* Add storage_write syscall

* Update syscall_storage_write

* Adding CompiledContractClass (#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 (#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 (#346)

* Adding map

* Adding missing newline after copying file

* Initializing with lazy_static

* Format macro code

* Implement storage cached state (#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 (#354)

* Add call_contract syscall for cairo 0.11 (#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 (#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 (#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 (#373)

* Add storage read syscall (#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` (#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 (#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 (#378)

* get block number syscall (#379)

* Refactor execution entrypoint execute (#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 (#384)

* Cleanup

* Update hint_processor.rs

* Execute internal declare v2 (#377)

* Execution function

* Rewrite verify version

* Fix clippy

* Add Cairo1HintProcessor.alloc_segment (#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 (#389)

* Cleanup

* Update hint_processor.rs

* Add Cairo1HintProcessor.alloc_segment

* Fix merge

* Add Cairo1HintProcessor.test_less_than

* add test_less_than_or_equal hint (#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 (#399)

* Assert le is first arc excluded (#407)

* AssertLeIsFirstArcExcluded

* activate actions

* Fix clippy

* Optional hash (#380)

* Accept hash as a parameter

* Fix clippy

* Add sqrt hint (#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 (#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 (#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 (#412)

* Add assert_le_is_second_excluded hint

* Reverse order for clarity

* Add assert le find small arcs (#406)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Alloc felt256 (#422)

* Alloc Felt 256 Dict

* Add dict manager mod

* Change hint interface

* Remove panic in exchange for HintError::CustomHint

* Add DebugPrint (#439)

* Add get next dict key (#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 (#440)

* update cairo-vm to latest version

* remove unwraps

* remove felt packages

* fix wrong identifier

* fix tests

* U256squareroot (#442)

* Uint256 square root

* Fic clippy

* ShouldSkipSquashLoop (#448)

* ShouldSkipSquashLoop

* Remove unwrap

* fix clippy

* Change pre commit (#453)

* Change pre commit

* Change pre commit to format

* Add felt252 dict read and write (#423)

* Add get_segment_arena_index

* Add assert_le_find_small_arcs

* Add base hint

* Add Cairo1HintProcessor.read_dict

* Add Felt252 Dict Write hint (#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 (#452)

* RandomEcPoint (#413)

* RandomEcPoint

* Import macro

* remove expects (#451)

* remove expects

* remove unnecessary error mapping

* GetCurrentAccessDelta (#444)

* GetCurrentAccessDelta

* remove unwrap

* Remove unwrap and expected

* Delete comment

* Dict Entry Init (#441)

* Implement dict entry init

* Connflict resolution

* Remove expect()

* Init squash data (#446)

* Init squash data

* change expect for hint error

* Add field_sqrt (#414)

* add AssertLtAssertValidInput hint (#456)

* GetCurrentAccessIndex (#445)

* Felt252 dict entry update (#443)

* Felt252DictEntryUpdate

* merge 0.11

* Add should_continue_squash_loop (#447)

* Add should_continue_squash_loop

* Update current_access_indices

* Commit

* `AssertAllKeysUsed` hint implementation (#458)

* Hint implementation

* Remove unused arg

* fmt fix

* Add assert current indices is empty (#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 (#469)

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

* New execute (#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 (#460)

* remove cairo 1 hint processor crate (#479)

* Refactor syscall handlers (#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>

* Added Cairo1HintProcessor

* removed unused casm_contract_class

* add compile_hint impl

* Add casm compilation (#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

* Added System Call Hints processing

* Migrate to cairo 0.11 (#234)

* Migrate to cairo 0.11

* Fix toml in starknet-rs-py

* Change layout

* add test and update deps

* add comments

* Rename bl syscall handler with deprecated

* add objects.rs tests (#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 (#494)

* Working execution_entrypoint for cairo_1

* merge 0.11

* remove references to rs-py

* fix tests

* Improved code based on PR review

* Improved code based on PR review

* Delete remaining starknet-rs-py files (#497)

* Fixing some Makefile targts

* Fixing some Makefile targts

* Fixing some Makefile targtes

* Delete devnet docs (#499)

* Delete devnet documentation

* Remove script add-funds.sh

* Re add script add-funds.sh

* remove add_funds.sh

---------

Co-authored-by: juanbono <juanbono94@gmail.com>

* Remove references to rs-py

* update starknet-api version

* add newline at EOF

* Process entrypoint builtins in `ExecuteEntryPoint::_execute` (#503)

* Add fn to pasrse BuiltinNames from String

* Rename fn and add it to _execute

* Clippy

* Remove references in storage related things

* Iterating entrypoint_args

* Remove unused function

* change wrong unreachable code

* remove unnecessary clone()

* Properly advance syscall_ptr after fetching gas & selector (#507)

* fix tests

* Delete repeated cairo1 program

* Remove `DeprecatedSyscallHandler` trait (#484)

* Remove DeprecatedSyscallHandler trait

* Remove trait `SyscallHandler` (#492)

* Remove unused trait SyscallHandler

* Move methods to BusinessLogicSyscallHandler

* Misc fixes

---------

Co-authored-by: Esteban Dimitroff Hódi <esteban.dimitroff@entropy1729.com>

---------

Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Santiago Pittella <87827390+SantiagoPittella@users.noreply.github.com>
Co-authored-by: Milton <milton.scuderi@lambdaclass.com>
Co-authored-by: Roberto Catalan <rcatalan@itba.edu.ar>
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: SantiagoPittella <pittellasantiago@gmail.com>
Co-authored-by: juanbono <juanbono94@gmail.com>
Co-authored-by: mfachal <647731+mfachal@users.noreply.github.com>
Co-authored-by: fmoletta <99273364+fmoletta@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add function for mapping selectors to syscall types
4 participants