Skip to content

Commit

Permalink
update unimplemented hints list
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Dec 10, 2024
1 parent d46a987 commit a761698
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion crates/starknet-os/src/hints/unimplemented.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
use indoc::indoc;

#[allow(unused)]
pub const HINT_4: &str = indoc! {r#"exit_syscall(selector=ids.SHA256_PROCESS_BLOCK_SELECTOR)"#};
const LOG2_CEIL: &str = indoc! {r#"
from starkware.python.math_utils import log2_ceil
ids.res = log2_ceil(ids.value)"#
};

#[allow(unused)]
const COMPRESS: &str = indoc! {r#"
from starkware.starknet.core.os.data_availability.compression import compress
data = memory.get_range_as_ints(addr=ids.data_start, size=ids.data_end - ids.data_start)
segments.write_arg(ids.compressed_dst, compress(data))"#
};

#[allow(unused)]
pub const DICTIONARY_FROM_BUCKET: &str =
indoc! {r#"initial_dict = {bucket_index: 0 for bucket_index in range(ids.TOTAL_N_BUCKETS)}"#};

#[allow(unused)]
const GET_PREV_OFFSET: &str = indoc! {r#"
dict_tracker = __dict_manager.get_tracker(ids.dict_ptr)
ids.prev_offset = dict_tracker.data[ids.bucket_index]"#
};
#[allow(unused)]
pub const ADD_DA_SEGMENT: &str = indoc! {r#"# `use_kzg_da` is used in a hint in `process_data_availability`.
use_kzg_da = ids.use_kzg_da
if use_kzg_da or ids.compress_state_updates:
ids.state_updates_start = segments.add()
else:
# Assign a temporary segment, to be relocated into the output segment.
ids.state_updates_start = segments.add_temp_segment()"#};

#[allow(unused)]
pub const WRITE_N_UPDATES_SMALL: &str =
indoc! {r#"ids.is_n_updates_small = ids.n_actual_updates < ids.N_UPDATES_SMALL_PACKING_BOUND"#};

0 comments on commit a761698

Please sign in to comment.