@@ -13,7 +13,7 @@ use alloy::{
1313 sol_types:: { SolCall , SolError } ,
1414 transports:: TransportError ,
1515} ;
16- use eyre:: { bail, eyre } ;
16+ use eyre:: bail;
1717use init4_bin_base:: deps:: {
1818 metrics:: { counter, histogram} ,
1919 tracing:: { self , Instrument , debug, debug_span, error, info, instrument, warn} ,
@@ -105,15 +105,7 @@ impl SubmitTask {
105105 Ok ( TransactionRequest :: default ( ) . with_blob_sidecar ( sidecar) . with_input ( data) )
106106 }
107107
108- /// Returns the next host block height.
109- async fn next_host_block_height ( & self ) -> eyre:: Result < u64 > {
110- let result = self . provider ( ) . get_block_number ( ) . await ?;
111- let next = result. checked_add ( 1 ) . ok_or_else ( || eyre ! ( "next host block height overflow" ) ) ?;
112- debug ! ( next, "next host block height" ) ;
113- Ok ( next)
114- }
115-
116- /// Prepares and then sends the EIP-4844 transaction with a sidecar encoded with a rollup block to the network.
108+ /// Prepares and sends the EIP-4844 transaction with a sidecar encoded with a rollup block to the network.
117109 async fn submit_transaction (
118110 & self ,
119111 retry_count : usize ,
@@ -122,7 +114,7 @@ impl SubmitTask {
122114 ) -> eyre:: Result < ControlFlow > {
123115 let tx = self . prepare_tx ( retry_count, resp, block) . await ?;
124116
125- self . send_transaction ( retry_count , resp, tx) . await
117+ self . send_transaction ( resp, tx) . await
126118 }
127119
128120 /// Prepares the transaction by extracting the signature components, creating the transaction
@@ -240,7 +232,6 @@ impl SubmitTask {
240232 /// and any additionally configured broadcast providers.
241233 async fn send_transaction (
242234 & self ,
243- retry_count : usize ,
244235 resp : & SignResponse ,
245236 tx : TransactionRequest ,
246237 ) -> Result < ControlFlow , eyre:: Error > {
@@ -254,10 +245,8 @@ impl SubmitTask {
254245 let fut = spawn_provider_send ! ( self . provider( ) , & tx) ;
255246
256247 // spawn send_tx futures on retry attempts for all additional broadcast host_providers
257- if retry_count > 0 {
258- for host_provider in self . config . connect_additional_broadcast ( ) {
259- spawn_provider_send ! ( & host_provider, & tx) ;
260- }
248+ for host_provider in self . config . connect_additional_broadcast ( ) {
249+ spawn_provider_send ! ( & host_provider, & tx) ;
261250 }
262251
263252 // send the in-progress transaction over the outbound_tx_channel
@@ -393,6 +382,12 @@ impl SubmitTask {
393382 let now = std:: time:: SystemTime :: now ( ) ;
394383 now. duration_since ( UNIX_EPOCH ) . unwrap ( ) . as_secs ( )
395384 }
385+
386+ /// Returns the next host block height.
387+ async fn next_host_block_height ( & self ) -> eyre:: Result < u64 > {
388+ let block_num = self . provider ( ) . get_block_number ( ) . await ?;
389+ Ok ( block_num + 1 )
390+ }
396391
397392 /// Task future for the submit task
398393 /// NB: This task assumes that the simulator will only send it blocks for
0 commit comments