Always use a normal segment for first SegmentArena segment - #45
Draft
notlesh wants to merge 10 commits into
Draft
Conversation
We've discovered that using the `cairo-vm` crate in our projects brings in a lot of unnecessary dependencies and in the end leads to our binary being linked with the `libbz2` library. Turns out that neither of these is actually required and this happens because the `zip` crate has a large number of features enabled by default. This change disables all `zip` features except `deflate` which the code actually uses.
* Fix Zero segment location. * Fixed has_zero_segment naming * Fix prover input. * Fixed version reading when no version is supplied * Added change to changelog. * fix test_from_serializable() * fix panic_impl error * fix cairo version * remove outdated test * Enable ensure-no_std on test * Add correct test * Rename tset * Add comment --------- Co-authored-by: Alon Titelman <alon.titelman@starkware.co> Co-authored-by: Omri Eshhar <omri@starkware.co> Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com> Co-authored-by: OmriEshhar1 <45786542+OmriEshhar1@users.noreply.github.com>
* update cairo-lang to 2.8.0 * working * format * typo * fix lints * update rusttoolchain * remove duplicated imports * remove unused imports * remove zip unused dependencies * uncomment * undo dependecy upgrade * update readme --------- Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
* Update pip cairo-lang to 0.13.2 * Update CHANGELOG --------- Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
|
Benchmark Results for unmodified programs 🚀
|
* Add debug scripts * Add debugging document * Add changelog * Revert changelog * Improve script usage code blocks * Remove extra space
* Fix Zero segment location. * Fixed has_zero_segment naming * Fix prover input. * Fixed version reading when no version is supplied * Added change to changelog. * fix test_from_serializable() * fix panic_impl error * fix cairo version * remove outdated test * Enable ensure-no_std on test * Add correct test * Rename tset * Add comment --------- Co-authored-by: Alon Titelman <alon.titelman@starkware.co> Co-authored-by: Omri Eshhar <omri@starkware.co> Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com> Co-authored-by: OmriEshhar1 <45786542+OmriEshhar1@users.noreply.github.com>
6 tasks
|
Benchmark Results for modified programs 🚀
|
* add default value for MAX_HIGH and MAX_LOW * update tests
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem: Starknet OS expects SegmentArena segments to all be temporary except the first segment, which must be normal. This is so that relocation rules for all segments can chain back into the first.
Solution: Use temporary segments only if it's not the first.
Description
The Starknet OS verifies the continuity of the segments in
SegmentArenas here, which requires relocation rules to be properly set up.The requirements for this to work are that each
src_ptris a temporary segment and eachdest_ptris a non-temporary segment (or a temporary segment with an existing rule mapping it to a non-temporary segment).cairo-vmuses a number of hints to accomplish this, and these are injected by the sierra-to-casm compiler. However, it relies on one additional hint which is not injected anywhere in the case of SNOS.This hint seems to ensure the same condition needed in SNOS: that the initial segment is a normal segment and that all other segments are temporary segments with relocation rules pointing back to the initial one.
SNOS handles this by simply allocating the initial segment as a normal one as explained here. This seems to alleviate the need to later recreate the segment in
relocate_all_segments(), allowing the implementation to work in SNOS without the hint mentioned above.Checklist