@@ -158,12 +158,19 @@ pub fn load_bootloader_config(
158158 . map ( |h| Box :: new ( MaybeRelocatable :: from ( h) ) as Box < dyn Any > )
159159 . collect ( ) ;
160160
161+ let supported_applicative_bootloader_hashes: Vec < Box < dyn Any > > = config
162+ . applicative_bootloader_program_hash_list
163+ . iter ( )
164+ . map ( |h| Box :: new ( MaybeRelocatable :: from ( h) ) as Box < dyn Any > )
165+ . collect ( ) ;
166+
161167 let args: Vec < Box < dyn Any > > = vec ! [
162168 maybe_relocatable_box!( config. supported_simple_bootloader_hash_list. len( ) ) ,
163169 any_box!( supported_simple_bootloader_hashes) ,
164170 maybe_relocatable_box!( config. supported_cairo_verifier_program_hashes. len( ) ) ,
165171 any_box!( supported_verifier_hashes) ,
166- maybe_relocatable_box!( config. applicative_bootloader_program_hash) ,
172+ maybe_relocatable_box!( config. applicative_bootloader_program_hash_list. len( ) ) ,
173+ any_box!( supported_applicative_bootloader_hashes) ,
167174 ] ;
168175
169176 // Store the args in the VM memory
@@ -316,14 +323,14 @@ pub fn compute_and_configure_fact_topologies(
316323 let output_builtin = vm. get_output_builtin_mut ( ) ?;
317324
318325 let bootloader_input: BootloaderInput = exec_scopes. get ( vars:: BOOTLOADER_INPUT ) ?;
319- let applicative_bootloader_program_hash = bootloader_input
326+ let applicative_bootloader_program_hash_list = bootloader_input
320327 . bootloader_config
321- . applicative_bootloader_program_hash ;
328+ . applicative_bootloader_program_hash_list ;
322329
323330 let plain_fact_topologies = compute_fact_topologies (
324331 & packed_outputs,
325332 & fact_topologies,
326- applicative_bootloader_program_hash ,
333+ applicative_bootloader_program_hash_list ,
327334 )
328335 . map_err ( Into :: < HintError > :: into) ?;
329336
@@ -520,7 +527,7 @@ mod tests {
520527 Felt252 :: from( 1234 ) ,
521528 Felt252 :: from( 5678 ) ,
522529 ] ,
523- applicative_bootloader_program_hash : Felt252 :: from ( 2222 ) ,
530+ applicative_bootloader_program_hash_list : vec ! [ Felt252 :: from( 2222 ) ] ,
524531 supported_cairo_verifier_program_hashes : vec ! [
525532 Felt252 :: from( 3333 ) ,
526533 Felt252 :: from( 4444 ) ,
@@ -699,7 +706,7 @@ mod tests {
699706 let config_segment = vm
700707 . segments
701708 . memory
702- . get_continuous_range ( bootloader_config_segment, 5 )
709+ . get_continuous_range ( bootloader_config_segment, 6 )
703710 . unwrap ( ) ;
704711
705712 let simple_bootloader_hash_list_segment_len = match & config_segment[ 0 ] {
@@ -722,7 +729,16 @@ mod tests {
722729 "Expected a relocatable value for cairo_verifier_program_hashes_segment_addr"
723730 ) ,
724731 } ;
725- let applicative_bootloader_program_hash = & config_segment[ 4 ] ;
732+ let applicative_bootloader_program_hashes_segment_len = match & config_segment[ 4 ] {
733+ MaybeRelocatable :: Int ( x) => ( * x) . to_usize ( ) . unwrap ( ) ,
734+ _ => {
735+ panic ! ( "Expected an integer for applicative_bootloader_program_hashes_segment_len" )
736+ }
737+ } ;
738+ let applicative_bootloader_program_hashes_segment_addr = match & config_segment[ 5 ] {
739+ MaybeRelocatable :: RelocatableValue ( relocatable) => relocatable,
740+ _ => panic ! ( "Expected a relocatable value for applicative_bootloader_program_hashes_segment_addr" ) ,
741+ } ;
726742
727743 // Assert that the simple bootloader hash list segment length matches the expected length
728744 assert ! ( matches!(
@@ -766,11 +782,29 @@ mod tests {
766782 ) ;
767783 }
768784
785+ // Assert that the applicative bootloader program hashes segment length matches the expected
786+ // length
787+ assert ! ( matches!(
788+ applicative_bootloader_program_hashes_segment_len,
789+ x if x == config. applicative_bootloader_program_hash_list. len( )
790+ ) ) ;
769791 // Assert that the applicative bootloader program hash matches the expected value
770- assert ! (
771- matches!( applicative_bootloader_program_hash, MaybeRelocatable :: Int ( x) if * x ==
772- config. applicative_bootloader_program_hash)
773- ) ;
792+ let applicative_bootloader_program_hashes_segment = vm
793+ . segments
794+ . memory
795+ . get_continuous_range (
796+ * applicative_bootloader_program_hashes_segment_addr,
797+ applicative_bootloader_program_hashes_segment_len,
798+ )
799+ . unwrap ( ) ;
800+ for ( i, hash) in applicative_bootloader_program_hashes_segment
801+ . iter ( )
802+ . enumerate ( )
803+ {
804+ assert ! (
805+ matches!( hash, MaybeRelocatable :: Int ( x) if * x == config. applicative_bootloader_program_hash_list[ i] )
806+ ) ;
807+ }
774808 }
775809
776810 #[ rstest]
@@ -951,7 +985,7 @@ mod tests {
951985 bootloader_config : BootloaderConfig {
952986 supported_simple_bootloader_hash_list : vec ! [ Felt252 :: from( 1234 ) ] ,
953987 supported_cairo_verifier_program_hashes : Default :: default ( ) ,
954- applicative_bootloader_program_hash : Felt252 :: from ( 2222 ) ,
988+ applicative_bootloader_program_hash_list : vec ! [ Felt252 :: from( 2222 ) ] ,
955989 } ,
956990 packed_outputs : packed_outputs. clone ( ) ,
957991 } ;
0 commit comments