@@ -86,6 +86,7 @@ impl SP1BlobstreamOperator {
86
86
87
87
/// Check the verifying key in the contract matches the verifying key in the prover.
88
88
async fn check_vkey ( & self ) -> Result < ( ) > {
89
+ println ! ( "Checking vkey here" ) ;
89
90
let provider = ProviderBuilder :: new ( ) . on_http ( self . rpc_url . clone ( ) ) ;
90
91
let contract = SP1Blobstream :: new ( self . contract_address , provider) ;
91
92
let verifying_key = contract
@@ -197,6 +198,7 @@ impl SP1BlobstreamOperator {
197
198
198
199
async fn run ( & self ) -> Result < ( ) > {
199
200
self . check_vkey ( ) . await ?;
201
+ println ! ( "vkey check passed" ) ;
200
202
201
203
let fetcher = TendermintRPCClient :: default ( ) ;
202
204
let block_update_interval = get_block_update_interval ( ) ;
@@ -296,14 +298,17 @@ async fn main() {
296
298
let request_interval_mins = get_loop_interval_mins ( ) ;
297
299
// If the operator takes longer than LOOP_TIMEOUT_MINS for a single invocation, or there's
298
300
// an error, sleep for the loop interval and try again.
299
- if let Err ( e) = tokio:: time:: timeout (
300
- tokio:: time:: Duration :: from_secs ( 60 * LOOP_TIMEOUT_MINS ) ,
301
- operator. run ( ) ,
302
- )
303
- . await
304
- {
305
- error ! ( "Error running operator: {}" , e) ;
301
+ tokio:: select! {
302
+ _ = tokio:: time:: sleep( tokio:: time:: Duration :: from_secs( 60 * LOOP_TIMEOUT_MINS ) ) => {
303
+ continue ;
304
+ }
305
+ e = operator. run( ) => {
306
+ if let Err ( e) = e {
307
+ error!( "Error running operator: {}" , e) ;
308
+ }
309
+ }
306
310
}
311
+
307
312
tokio:: time:: sleep ( tokio:: time:: Duration :: from_secs ( 60 * request_interval_mins) ) . await ;
308
313
}
309
314
}
0 commit comments