@@ -88,7 +88,7 @@ async fn submit_block_with_timeout(
8888 api_version : & BuilderApiVersion ,
8989 fork_name : ForkName ,
9090) -> Result < Option < SubmitBlindedBlockResponse > , PbsError > {
91- let url = relay. submit_block_url ( * api_version) ?;
91+ let mut url = relay. submit_block_url ( * api_version) ?;
9292 let mut remaining_timeout_ms = timeout_ms;
9393 let mut retry = 0 ;
9494 let mut backoff = Duration :: from_millis ( 250 ) ;
@@ -121,6 +121,14 @@ async fn submit_block_with_timeout(
121121 }
122122 }
123123
124+ Err ( err) if err. is_not_found ( ) && matches ! ( api_version, BuilderApiVersion :: V2 ) => {
125+ warn ! (
126+ relay_id = relay. id. as_ref( ) ,
127+ "relay does not support v2 endpoint, retrying with v1"
128+ ) ;
129+ url = relay. submit_block_url ( BuilderApiVersion :: V1 ) ?;
130+ }
131+
124132 Err ( err) => return Err ( err) ,
125133 } ;
126134
@@ -184,8 +192,16 @@ async fn send_submit_block(
184192 warn ! ( relay_id = relay. id. as_ref( ) , retry, %err, "failed to get payload (this might be ok if other relays have it)" ) ;
185193 return Err ( err) ;
186194 } ;
195+
187196 if api_version != & BuilderApiVersion :: V1 {
188197 // v2 response is going to be empty, so just break here
198+ debug ! (
199+ relay_id = relay. id. as_ref( ) ,
200+ retry,
201+ latency = ?request_latency,
202+ "successful request"
203+ ) ;
204+
189205 return Ok ( None ) ;
190206 }
191207
0 commit comments