-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use program builtins in
initialize_main_entrypoint
& `read_ret…
…urn_values` (#1703) * Ignore pesky pie zip files * Add zero segment * Handle zero segment when counting memory holes * Add Changelog entry * Fix macro * First draft of runner & instance_def * Complete struct * Impl initialize_segments + read_n_words_value * Implement read_inputs * Implement read_memory_vars * Impl fill_inputs * Impl fill_offsets * Impl write_n_words_value * Implement fill_value * Implement fill_memory * Integrate mod builtin under feature flag * Add test file * Impl hint * Push hint impl file * Add quick impl of run_additional_security_checks * Some fixes * Fixes * Fix bugs * Temp testing code * Refactor: Use a struct to represent inputs * Refactor: use a struct to represent memory vars * Refactor: Use a constant N_WORDS * Refactor: use fixed N_WORDS size arrays to ensure safe indexing * Store prime as NonZeroFelt * Refactor: Used a fixed-size array for shift_powers * Clippy * Clippy * Small improvments * Refactor: Use only offsets_ptr instead of all inputs in fill_offsets * Refactor(Simplification): Reduce the return type of read_memory_vars to only a b & c as the other values are not used * Fix(Refactor: Use BigUint to represent values as we have to accomodate values up to U384 * Refactor: Optimize fill_offsets loop so clippy does not complain about it * Add a fill_memory wrapper on the vm to avoid cloning the builtin runners * Fixes * Check batch size * Refactors: Reduce duplication in mod_builtin_fill_memory & combine loops in fill_value * Safety: Use saturating sub * Refactor: Avoid creating empty structs in fill_memory * Add integration test * Add error handling + integration tests * Fix bugged shift_powers creation * Improve error formatting * Simplify error string generation * Fix test * Add test using large batch size + hint impl for circuits using large batch size * Add test with large batch size * Fix hint impl + rename module * Improve error handling of run_additional_security_checks * Remove unused method BuiltinRunner::get_memory_accesses * Impl mark_accessed_memory * Mark cells created by fill_memory as accessed during execution * Remove mark_accessed_memory * Finalize zero segment * WIP: Move final_stack to enum impl * Remove unused methods from builtin runners * Remove commented code * Get rid of empty impls in builtin runners * Move get_memory_segment_addresses impl to enum impl * Impl builtin methods * Add placeholder value * Fix cells_per_instance * Remove temp testing code * Run modulo builtin security checks when running builtin security checks * Use realistic value for mod builtin ratio * Draft(private inputs) * Impl air_private_input * Update private input structure * Improve struct compatibility for serialization * Relocate zero_segment_address + Use BtreeMap keep batches sorted * Fix field names * Clippy * Remove unused attribute from modulo module + limit feature gated code * Fix test files EOF * Relocate ptrs when creating mod private input * Remove feature * Update requirements.txt * Update program + add changelog entry * Impl new hints * Adjust recursive_large_output params * Update tests * Remove allow(unused) * Push bench file * Add non-std imports * Remove unused func * Remove dead code * Box error contents to reduce errir size * Avoid needless to_string when reporting errors * Copy common lib modules so that we can run mod builtin tests in CI * Add mod_builtin to special features so we can run the tests in CI * Fix file * Fix get_used_instances for segment arena * Fix test * Add temp fix * Clippy * fmt * Add no-std import * Add no-std import * Push changelog * Push deleted comment * fmt * Fix typo * Compile with proof mode on CI + add air_private_input tests * Run proof mode integration tests * Push symlinks for convenience as these will be moved soon * Fix test * Fix test value * Fix test value * Fix * Use rea data in layoyts + adjust tests accordingly * Update air priv input tests value (Accounting for increased ratios in layout) * Remove feature mod_builtin * Revert "Remove feature mod_builtin" This reverts commit 5cc921c. * Remove dbg print * Fix read_return_values * Fix initialize_main_entrypoint & read_return_values * Add test * Fix OutputBuiltinRunner::get_public_memory * Fix air public input generation * Fix tests * Fix EOF * Add checks * Fix tests * Fix order * Add CHANGELOG entry * Fix * Re,ove unused import * Fix * Update CHANGELOG.md * Fix test * fmt * Fix
- Loading branch information
Showing
11 changed files
with
188 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
%builtins output pedersen range_check ecdsa bitwise ec_op | ||
|
||
from starkware.cairo.common.cairo_builtins import HashBuiltin | ||
from starkware.cairo.common.hash import hash2 | ||
|
||
func main{output_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr, ecdsa_ptr, bitwise_ptr, ec_op_ptr}() { | ||
let (seed) = hash2{hash_ptr=pedersen_ptr}(0, 0); | ||
assert [output_ptr] = seed; | ||
let output_ptr = output_ptr + 1; | ||
return (); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.