Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/upload_artifacts_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Upload-Artifacts
on:
push:
branches:
- main
- noamp/app_prog_hash_func_hint

jobs:
artifacts-push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ pub fn prepare_aggregator_simple_bootloader_output_segment(
Ok(())
}

/// Implements
/// %{ GET_AGGREGATOR_PROGRAM_HASH_FUNCTION %}
pub fn get_aggregator_program_hash_function(
exec_scopes: &mut ExecutionScopes,
) -> Result<(), HintError> {
let program_input: &String = exec_scopes.get_ref(vars::PROGRAM_INPUT)?;
let applicative_bootloader_input: ApplicativeBootloaderInput =
serde_json::from_str(program_input).unwrap();
exec_scopes.insert_value(
vars::PROGRAM_HASH_FUNCTION,
applicative_bootloader_input
.aggregator_task
.program_hash_function,
);
Ok(())
}

/// Implements
///%{
/// from starkware.cairo.bootloaders.bootloader.objects import BootloaderInput
Expand Down
2 changes: 2 additions & 0 deletions crates/cairo-program-runner-lib/src/hints/codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ pub const VERIFIER_GET_INDEX_LAST_BIT: &str = "ids.bit = ids.current.index & 1";
pub const VERIFIER_DIVIDE_QUERIES_IND_BY_COSET_SIZE_TO_FP_OFFSET: &str =
"memory[fp + 1] = to_felt_or_relocatable(ids.queries.index // ids.params.coset_size)";

pub const APPLICATIVE_GET_PROGRAM_HASH_FUNCTION: &str = "APPLICATIVE_GET_PROGRAM_HASH_FUNCTION";

pub const APPLICATIVE_LOAD_INPUTS: &str =
"from starkware.cairo.bootloaders.applicative_bootloader.objects import (
ApplicativeBootloaderInput,
Expand Down
4 changes: 4 additions & 0 deletions crates/cairo-program-runner-lib/src/hints/hint_processors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use cairo_vm::vm::errors::hint_errors::HintError;
use cairo_vm::vm::runners::cairo_runner::ResourceTracker;
use cairo_vm::vm::vm_core::VirtualMachine;

use crate::hints::applicative_bootloader_hints::get_aggregator_program_hash_function;
use crate::hints::bootloader_hints::{
assert_is_composite_packed_output, assert_program_address,
compute_and_configure_fact_topologies, compute_and_configure_fact_topologies_simple,
Expand Down Expand Up @@ -190,6 +191,9 @@ impl HintProcessorLogic for MinimalBootloaderHintProcessor {
ids_data,
ap_tracking,
),
APPLICATIVE_GET_PROGRAM_HASH_FUNCTION => {
get_aggregator_program_hash_function(exec_scopes)
}
APPLICATIVE_SET_UP_UNPACKER_INPUTS => {
prepare_root_task_unpacker_bootloader_output_segment(
vm,
Expand Down
Loading