@@ -21,7 +21,7 @@ use openvm_stark_sdk::{
2121 config:: baby_bear_poseidon2:: BabyBearPoseidon2Engine ,
2222 engine:: { StarkEngine , StarkFriEngine } ,
2323} ;
24- use tracing:: info_span ;
24+ use tracing:: instrument ;
2525
2626use crate :: {
2727 commit:: { AppExecutionCommit , CommitBytes } ,
@@ -118,9 +118,11 @@ where
118118 }
119119
120120 /// Generates proof for every continuation segment
121- ///
122- /// This function internally calls [verify_app_proof] to verify the result before returning the
123- /// proof.
121+ #[ instrument(
122+ name = "app_prove" ,
123+ skip_all,
124+ fields( group = self . program_name. as_ref( ) . unwrap_or( & "app_proof" . to_string( ) ) )
125+ ) ]
124126 pub fn prove (
125127 & mut self ,
126128 input : StdIn < Val < E :: SC > > ,
@@ -138,19 +140,30 @@ where
138140 self . vm_config ( ) . as_ref ( ) ,
139141 & self . instance . vm . engine . fri_params ( ) ,
140142 ) ;
141- let proofs = info_span ! (
142- "app proof" ,
143- group = self
144- . program_name
145- . as_ref( )
146- . unwrap_or( & "app_proof" . to_string( ) )
147- )
148- . in_scope ( || {
149- #[ cfg( feature = "metrics" ) ]
150- metrics:: counter!( "fri.log_blowup" )
151- . absolute ( self . instance . vm . engine . fri_params ( ) . log_blowup as u64 ) ;
152- ContinuationVmProver :: prove ( & mut self . instance , input)
153- } ) ?;
143+ #[ cfg( feature = "metrics" ) ]
144+ metrics:: counter!( "fri.log_blowup" )
145+ . absolute ( self . instance . vm . engine . fri_params ( ) . log_blowup as u64 ) ;
146+ ContinuationVmProver :: prove ( & mut self . instance , input)
147+ }
148+
149+ /// Generates proof for every continuation segment
150+ ///
151+ /// This function internally calls [verify_segments] to verify the result before returning the
152+ /// proof.
153+ ///
154+ /// **Note**: This function calls [`app_commit`](Self::app_commit), which is computationally
155+ /// intensive if it is the first time it is called within an `AppProver` instance.
156+ #[ instrument( name = "app_prove_and_verify" , skip_all) ]
157+ pub fn prove_and_verify (
158+ & mut self ,
159+ input : StdIn < Val < E :: SC > > ,
160+ ) -> Result < ContinuationVmProof < E :: SC > , VirtualMachineError >
161+ where
162+ <VB :: VmConfig as VmExecutionConfig < Val < E :: SC > > >:: Executor : Executor < Val < E :: SC > >
163+ + MeteredExecutor < Val < E :: SC > >
164+ + PreflightExecutor < Val < E :: SC > , VB :: RecordArena > ,
165+ {
166+ let proofs = self . prove ( input) ?;
154167 // We skip verification of the user public values proof here because it is directly computed
155168 // from the merkle tree above
156169 let res = verify_segments (
0 commit comments