@@ -30,6 +30,7 @@ pub struct ProofsFetcher {
3030 rpc_provider : RPCProvider ,
3131 aligned_service_manager : AlignedLayerServiceManagerContract ,
3232 last_aggregated_block : u64 ,
33+ pre_verification_enabled : bool ,
3334}
3435
3536impl ProofsFetcher {
@@ -48,6 +49,7 @@ impl ProofsFetcher {
4849 rpc_provider,
4950 aligned_service_manager,
5051 last_aggregated_block,
52+ pre_verification_enabled : config. pre_verification_enabled ,
5153 }
5254 }
5355
@@ -154,19 +156,21 @@ impl ProofsFetcher {
154156 proofs_to_add. len( )
155157 ) ;
156158
157- // Try to add them to the queue
158- // We do this in parallel, as SP1 can take quite some time in verifying
159- // because of the overhead of setting up the prover
160- proofs_to_add = proofs_to_add
161- . into_par_iter ( )
162- . filter ( |proof| match proof. verify ( ) {
163- Ok ( _) => true ,
164- Err ( err) => {
165- error ! ( "Could not add proof, verification failed: {:?}" , err) ;
166- return false ;
167- }
168- } )
169- . collect ( ) ;
159+ if self . pre_verification_enabled {
160+ // Try to add them to the queue
161+ // We do this in parallel, as SP1 can take quite some time in verifying
162+ // because of the overhead of setting up the prover
163+ proofs_to_add = proofs_to_add
164+ . into_par_iter ( )
165+ . filter ( |proof| match proof. verify ( ) {
166+ Ok ( _) => true ,
167+ Err ( err) => {
168+ error ! ( "Could not add proof, verification failed: {:?}" , err) ;
169+ return false ;
170+ }
171+ } )
172+ . collect ( ) ;
173+ }
170174
171175 proofs. extend ( proofs_to_add) ;
172176 }
0 commit comments