File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ use reqwest_middleware::ClientWithMiddleware as HttpClientWithMiddleware;
1515use serde:: { de:: DeserializeOwned , Serialize } ;
1616use sp1_core_machine:: io:: SP1Stdin ;
1717use sp1_prover:: { HashableKey , SP1VerifyingKey } ;
18- use tonic:: { transport:: Channel , Code } ;
1918use tokio:: sync:: OnceCell ;
19+ use tonic:: { transport:: Channel , Code } ;
2020
2121use super :: {
2222 grpc,
@@ -478,11 +478,20 @@ impl NetworkClient {
478478 }
479479
480480 pub ( crate ) async fn get_channel ( & self ) -> Result < Channel > {
481- Ok ( self . channel . get_or_try_init ( || async {
482- let channel = grpc:: configure_endpoint ( & self . rpc_url ) ?. connect ( ) . await ?;
483- Ok ( channel)
484- } )
485- . await . map_err ( |e| anyhow:: anyhow!( "Failed to connect: {:?}" , e) ) ?. clone ( ) )
481+ Ok ( self
482+ . channel
483+ . get_or_try_init ( || {
484+ self . with_retry (
485+ || async {
486+ let channel = grpc:: configure_endpoint ( & self . rpc_url ) ?. connect ( ) . await ?;
487+ Ok ( channel)
488+ } ,
489+ "connecting to network rpc" ,
490+ )
491+ } )
492+ . await
493+ . map_err ( |e| anyhow:: anyhow!( "Failed to connect: {:?}" , e) ) ?
494+ . clone ( ) )
486495 }
487496
488497 pub ( crate ) async fn prover_network_client ( & self ) -> Result < ProverNetworkClient < Channel > > {
You can’t perform that action at this time.
0 commit comments