This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Update warp memory functionality to Cairo 1 - #1045
Merged
Merged
Conversation
…Eth/warp into wm-plugin-integration
Contributor
|
I've made a search for functions that start with "try_" in the Cairo codebase and in all cases it's functions that might return a failure ( (for some reason, I can't reply in the thread itself) |
piwonskp
reviewed
May 30, 2023
piwonskp
reviewed
May 30, 2023
piwonskp
reviewed
May 30, 2023
piwonskp
approved these changes
May 31, 2023
piwonskp
left a comment
Contributor
There was a problem hiding this comment.
Apart from the few simple changes (deleting starknet accounts, adding a few comments, indentation) it's ready to be merged
temyurchenko
reviewed
Jun 1, 2023
temyurchenko
approved these changes
Jun 1, 2023
AlejandroLabourdette
pushed a commit
that referenced
this pull request
Jun 2, 2023
* Make warplib a scarb project * Add maths module * update corelib to alpha 7 * Add arm binaries from alpha 7 * Add warp plugin binaries * Rework structure for * Fix warp dependency * Fix warplib and delete files to ignore * delete autogenerted warplib scripts * Add corelib and bin for linux_x64 * Scarb package name replaces - for _ * Update compileCairo1 to use new binary * Update compilation testing framework * Some comments * Address review * Add unimplemented traits for WarpMemory * Typo * Delete maths.cairo * Fix comp errors * Add array handling logic * Fix some compilation errors * Make memory operations safe * Update part of memory systems * Add implicit conversion cases * fix typo * Array concat * Minor refactoring to importPath.ts * Use Serde trait to store/retrieve from memory (#1040) * Use Serde trait to store/retrieve from memory * Fix missing import * Fix function naming in the trait * Replace individual memory reads with a call to warp_memory * Divide MemoryTrait into low level trait and external interface * Remove unused import * Add missing newline * Fix wrong imports * Cell accessor -> Warp memory impl * Fix missing imports * Use memory's own `read`instead of Felt252Dict's method * Add memory implicit to memoryRead * Fix arrayLiteral implicits --------- Co-authored-by: Piotr Piwoński <piwonskp> * Address review * Update read_id to get_or_create_id * Remove warplib/target * Update imports * Rewrite memory to calldata * memory to storage * Update workflow * Fix tsc compilation errors * Update warplib testing framwerk * Fix bugs and compilation erros in warplib * Add unit tests to Warplib * Remove warplib sierra * calldata to memory * Add storage to memory * Fix tsc compile bugs * Add cairo1 compile and format for when using warp * Update abi imports * Improvements to memory util func gen * Other import updates * Fix some issues with imports * Update a maths util function * Minor bug fixes in accessors * Address review + add new test * Use into * Address review * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * start_pos -> position * Fix and test change * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Minor stuff * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Remove starknet_accounts_devnet * Add super to importPaths * Fix testing * Improvments + linting * Remove mut * Some minor fixes * Fix * linting * Address review * Add endent in calldataToMemory * Improvements in concat util func gen * Add utilitie * General fixes * Improvements * Update src/cairoUtilFuncGen/memory/implicitConversion.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Linting * General fixes and improvements * Relocation of warplib function * Update src/cairoUtilFuncGen/memory/memoryStruct.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Bug fix * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToCalldata.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Rename to try * Endent * try rename * Add felt constant and minor improvements * Typo * Linting * Restore .starknet_account_devnet * Write variables as mut * Remove triple sss * Remainig triple sss * Nitpicks * remove .starknet_accounts_devnet * Add some comments * Untry * Restore behaviour file to default * Restore behaviour file to default 2 --------- Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>
piwonskp
added a commit
that referenced
this pull request
Jun 5, 2023
* Make warplib a scarb project * Add maths module * update corelib to alpha 7 * Add arm binaries from alpha 7 * Add warp plugin binaries * Rework structure for * Fix warp dependency * Fix warplib and delete files to ignore * delete autogenerted warplib scripts * Add corelib and bin for linux_x64 * Scarb package name replaces - for _ * Update compileCairo1 to use new binary * Update compilation testing framework * Some comments * Address review * Add unimplemented traits for WarpMemory * Typo * Delete maths.cairo * Fix comp errors * Add array handling logic * Fix some compilation errors * Make memory operations safe * fix typo * functions for bytes * Use Serde trait to store/retrieve from memory (#1040) * Use Serde trait to store/retrieve from memory * Fix missing import * Fix function naming in the trait * Replace individual memory reads with a call to warp_memory * Divide MemoryTrait into low level trait and external interface * Remove unused import * Add missing newline * Fix wrong imports * Cell accessor -> Warp memory impl * Fix missing imports * Use memory's own `read`instead of Felt252Dict's method * Add memory implicit to memoryRead * Fix arrayLiteral implicits --------- Co-authored-by: Piotr Piwoński <piwonskp> * remove wm prefix * Address review * camel case to snake case * read bytes length as a felt * fixed compilation errors * Update read_id to get_or_create_id * Remove warplib/target * Update workflow * Fix tsc compilation errors * Update warplib testing framwerk * Fix bugs and compilation erros in warplib * Add unit tests to Warplib * Refactor and separate type conversions from maths * separate external input check functions from math * delete autogenerated * update gitignore * renaming variable * Minor bug fixes in accessors * Address review + add new test * Use into * Address review * update references to warplib conversions in the branch * create directory for autogen if it dosnt exist * do not include in git types autogenerated files * implementation of fixed bytes types * include types in warplib lib * try to find traits and structs first to export instead of functions * remove support for bitwise operations with fixedBytes * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * start_pos -> position * Fix and test change * remove bytes handwritten implementation for warpmemory * add a generated warp memory bytes implementation * add imports needed for warp memory bytes * test for warp memory bytes converter * definition for `atIndex` function * remove pow2 * pow2 autogenerated by warplib * extend pow2 to n=255 * pow2 return now u128 * implement atIndex using pow2 * tests for atIndex * implement bitwise operators for fixed bytes * tests for bitwise operations with fixed bytes * lint * new line at files end * rename byte location variable * remove starknet accounts json * refactor body of bytes bitwise operations * delete bytes autogen file * fix various issues converted with conversions to the address type (#1060) - conversions from int variables used to call a Cairo 0 function. It was replaced with a new, Cairo 1, function---`unsafe_contract_address_from_felt`. - conversions from int literals were represented in Cairo as raw int literals, which fails the type system. - conversions from int literals to address wouldn't trigger typeString change from 'int_const bla-bla' to 'address', which caused primitiveTypeToCairo to fail. - added tests - the regex had to be changed, as it accidentally was catching methods of traits. Anyway, we might need to consider a solution not involving regexes, although it's not that bad, given that we only impose it on the code written by us * Behavior tests and CI (#1055) * enable behaviour tests in CI, again * comments * new warp-plugin bin with bug fixes (#1078) * Add depured darwin version of warp-plugin * Add x64 warp plugin binaries --------- Co-authored-by: Piotr Piwoński <piwonskp> * Do not include starknet accounts file in commits (#1077) Co-authored-by: Piotr Piwoński <piwonskp> * Update warp memory functionality to Cairo 1 (#1045) * Make warplib a scarb project * Add maths module * update corelib to alpha 7 * Add arm binaries from alpha 7 * Add warp plugin binaries * Rework structure for * Fix warp dependency * Fix warplib and delete files to ignore * delete autogenerted warplib scripts * Add corelib and bin for linux_x64 * Scarb package name replaces - for _ * Update compileCairo1 to use new binary * Update compilation testing framework * Some comments * Address review * Add unimplemented traits for WarpMemory * Typo * Delete maths.cairo * Fix comp errors * Add array handling logic * Fix some compilation errors * Make memory operations safe * Update part of memory systems * Add implicit conversion cases * fix typo * Array concat * Minor refactoring to importPath.ts * Use Serde trait to store/retrieve from memory (#1040) * Use Serde trait to store/retrieve from memory * Fix missing import * Fix function naming in the trait * Replace individual memory reads with a call to warp_memory * Divide MemoryTrait into low level trait and external interface * Remove unused import * Add missing newline * Fix wrong imports * Cell accessor -> Warp memory impl * Fix missing imports * Use memory's own `read`instead of Felt252Dict's method * Add memory implicit to memoryRead * Fix arrayLiteral implicits --------- Co-authored-by: Piotr Piwoński <piwonskp> * Address review * Update read_id to get_or_create_id * Remove warplib/target * Update imports * Rewrite memory to calldata * memory to storage * Update workflow * Fix tsc compilation errors * Update warplib testing framwerk * Fix bugs and compilation erros in warplib * Add unit tests to Warplib * Remove warplib sierra * calldata to memory * Add storage to memory * Fix tsc compile bugs * Add cairo1 compile and format for when using warp * Update abi imports * Improvements to memory util func gen * Other import updates * Fix some issues with imports * Update a maths util function * Minor bug fixes in accessors * Address review + add new test * Use into * Address review * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * start_pos -> position * Fix and test change * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Minor stuff * Update warplib/src/test/warp_memory_test.cairo Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Remove starknet_accounts_devnet * Add super to importPaths * Fix testing * Improvments + linting * Remove mut * Some minor fixes * Fix * linting * Address review * Add endent in calldataToMemory * Improvements in concat util func gen * Add utilitie * General fixes * Improvements * Update src/cairoUtilFuncGen/memory/implicitConversion.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Linting * General fixes and improvements * Relocation of warplib function * Update src/cairoUtilFuncGen/memory/memoryStruct.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Bug fix * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToStorage.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Update src/cairoUtilFuncGen/memory/memoryToCalldata.ts Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * Rename to try * Endent * try rename * Add felt constant and minor improvements * Typo * Linting * Restore .starknet_account_devnet * Write variables as mut * Remove triple sss * Remainig triple sss * Nitpicks * remove .starknet_accounts_devnet * Add some comments * Untry * Restore behaviour file to default * Restore behaviour file to default 2 --------- Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> * accesssor -> accessor --------- Co-authored-by: rodrigo-pino <rodrodpino@gmail.com> Co-authored-by: Piotr Piwoński <piwonskp@gmail.com> Co-authored-by: Artem Yurchenko <44875844+murcake@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.