@@ -471,7 +471,7 @@ mod fast_parallel {
471471 } ;
472472 use miden_core_lib:: CoreLibrary ;
473473 use miden_processor:: {
474- DefaultHost , ExecutionOptions , FastProcessor , ProcessorState , StackInputs ,
474+ DefaultHost , ExecutionOptions , FastProcessor , ProcessorState , StackInputs , StackOutputs ,
475475 advice:: { AdviceInputs , AdviceMutation } ,
476476 event:: { EventError , EventHandler } ,
477477 trace:: build_trace,
@@ -592,6 +592,56 @@ mod fast_parallel {
592592
593593 #[ test]
594594 fn test_prove_from_trace_sync_preserves_precompile_requests ( ) {
595+ let LoggedPrecompileProofFixture {
596+ program,
597+ stack_inputs,
598+ stack_outputs,
599+ proof,
600+ verifier_registry,
601+ expected_transcript,
602+ } = prove_logged_precompile_fixture ( HashFunction :: Blake3_256 ) ;
603+
604+ let ( _, pc_transcript_digest) = verify_with_precompiles (
605+ program. into ( ) ,
606+ stack_inputs,
607+ stack_outputs,
608+ proof,
609+ & verifier_registry,
610+ )
611+ . expect ( "proof verification with precompiles failed" ) ;
612+ assert_eq ! ( expected_transcript. finalize( ) , pc_transcript_digest) ;
613+ }
614+
615+ #[ test]
616+ fn test_poseidon2_recursive_verify_with_precompile_requests ( ) {
617+ let LoggedPrecompileProofFixture {
618+ program,
619+ stack_inputs,
620+ stack_outputs,
621+ proof,
622+ verifier_registry,
623+ expected_transcript,
624+ } = prove_logged_precompile_fixture ( HashFunction :: Poseidon2 ) ;
625+
626+ super :: assert_recursive_verify (
627+ program. to_info ( ) ,
628+ stack_inputs,
629+ stack_outputs,
630+ expected_transcript. state ( ) ,
631+ & proof,
632+ ) ;
633+
634+ verify_with_precompiles (
635+ program. into ( ) ,
636+ stack_inputs,
637+ stack_outputs,
638+ proof,
639+ & verifier_registry,
640+ )
641+ . expect ( "proof verification with precompiles failed" ) ;
642+ }
643+
644+ fn prove_logged_precompile_fixture ( hash_fn : HashFunction ) -> LoggedPrecompileProofFixture {
595645 const NUM_ITERATIONS : usize = 256 ;
596646 let fixtures = logged_precompile_fixtures ( NUM_ITERATIONS ) ;
597647
@@ -638,7 +688,7 @@ mod fast_parallel {
638688
639689 let ( stack_outputs, proof) = prove_from_trace_sync ( TraceProvingInputs :: new (
640690 trace_inputs,
641- ProvingOptions :: with_96_bit_security ( HashFunction :: Blake3_256 ) ,
691+ ProvingOptions :: with_96_bit_security ( hash_fn ) ,
642692 ) )
643693 . expect ( "prove_from_trace_sync failed" ) ;
644694
@@ -663,15 +713,23 @@ mod fast_parallel {
663713 }
664714 assert_eq ! ( transcript. finalize( ) , expected_transcript. finalize( ) ) ;
665715
666- let ( _ , transcript_digest ) = verify_with_precompiles (
667- program. into ( ) ,
716+ LoggedPrecompileProofFixture {
717+ program,
668718 stack_inputs,
669719 stack_outputs,
670720 proof,
671- & verifier_registry,
672- )
673- . expect ( "proof verification with precompiles failed" ) ;
674- assert_eq ! ( expected_transcript. finalize( ) , transcript_digest) ;
721+ verifier_registry,
722+ expected_transcript,
723+ }
724+ }
725+
726+ struct LoggedPrecompileProofFixture {
727+ program : Program ,
728+ stack_inputs : StackInputs ,
729+ stack_outputs : StackOutputs ,
730+ proof : ExecutionProof ,
731+ verifier_registry : PrecompileVerifierRegistry ,
732+ expected_transcript : PrecompileTranscript ,
675733 }
676734
677735 fn logged_precompile_fixtures ( num_iterations : usize ) -> Vec < LoggedPrecompileFixture > {
0 commit comments