Skip to content

Commit

Permalink
Merge branch 'main' into add-reduce-v2-hint
Browse files Browse the repository at this point in the history
  • Loading branch information
pefontana committed Aug 28, 2023
2 parents 9b3dc8b + 4267138 commit 612c907
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/hint_accountant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
uses: Swatinem/rust-cache@v2
- name: Checkout
uses: actions/checkout@v3
- name: Check Build
run: cargo build -p hint_accountant
- name: Run the hint accounting script
run: cargo r -p hint_accountant | tee comment.md
- name: Update comment in tracking issue
Expand Down
3 changes: 2 additions & 1 deletion hint_accountant/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![deny(warnings)]
#![forbid(unsafe_code)]
use cairo_vm::stdlib::collections::{HashMap, HashSet};
use cairo_vm::{
hint_processor::{
builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor,
Expand All @@ -8,8 +9,8 @@ use cairo_vm::{
serde::deserialize_program::ApTracking,
types::exec_scope::ExecutionScopes,
vm::{errors::hint_errors::HintError, vm_core::VirtualMachine},
with_std::collections::{HashMap, HashSet},
};

use serde::Deserialize;
use serde_json::Value;

Expand Down
7 changes: 7 additions & 0 deletions hint_accountant/whitelists/cairo_secp.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
"x = pack(ids.x, PRIME) % SECP_P"
]
},
{
"allowed_expressions": [],
"hint_lines": [
"from starkware.cairo.common.cairo_secp.secp_utils import pack",
"value = pack(ids.x, PRIME) % SECP_P"
]
},
{
"allowed_expressions": [],
"hint_lines": [
Expand Down
28 changes: 14 additions & 14 deletions hint_accountant/whitelists/latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,6 @@
"ids.multiplicities = segments.gen_arg([len(positions_dict[k]) for k in output])"
]
},
{
"allowed_expressions": [],
"hint_lines": [
"from starkware.cairo.common.keccak_utils.keccak_utils import keccak_func",
"_keccak_state_size_felts = int(ids.KECCAK_STATE_SIZE_FELTS)",
"assert 0 <= _keccak_state_size_felts < 100",
"",
"output_values = keccak_func(memory.get_range(",
" ids.keccak_ptr - _keccak_state_size_felts, _keccak_state_size_felts))",
"segments.write_arg(ids.keccak_ptr, output_values)"
]
},
{
"allowed_expressions": [],
"hint_lines": [
Expand Down Expand Up @@ -419,6 +407,18 @@
"segments.write_arg(ids.res.address_, split(value))"
]
},
{
"allowed_expressions": [],
"hint_lines": [
"from starkware.cairo.common.keccak_utils.keccak_utils import keccak_func",
"_keccak_state_size_felts = int(ids.KECCAK_STATE_SIZE_FELTS)",
"assert 0 <= _keccak_state_size_felts < 100",
"",
"output_values = keccak_func(memory.get_range(",
" ids.keccak_ptr - _keccak_state_size_felts, _keccak_state_size_felts))",
"segments.write_arg(ids.keccak_ptr, output_values)"
]
},
{
"allowed_expressions": [],
"hint_lines": [
Expand Down Expand Up @@ -887,13 +887,13 @@
{
"allowed_expressions": [],
"hint_lines": [
"syscall_handler.send_message_to_l1(segments=segments, syscall_ptr=ids.syscall_ptr)"
"syscall_handler.replace_class(segments=segments, syscall_ptr=ids.syscall_ptr)"
]
},
{
"allowed_expressions": [],
"hint_lines": [
"syscall_handler.replace_class(segments=segments, syscall_ptr=ids.syscall_ptr)"
"syscall_handler.send_message_to_l1(segments=segments, syscall_ptr=ids.syscall_ptr)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include!("./with_std.rs");
#[cfg(not(feature = "std"))]
include!("./without_std.rs");

mod stdlib {
pub mod stdlib {
pub mod collections {
#[cfg(feature = "std")]
pub use crate::with_std::collections::*;
Expand Down

0 comments on commit 612c907

Please sign in to comment.