@@ -8,8 +8,8 @@ use crate::{
88 eoa:: {
99 EoaExecutorStore ,
1010 store:: {
11- CleanupReport , ConfirmedTransaction , ReplacedTransaction , SubmittedTransactionDehydrated ,
12- TransactionStoreError ,
11+ CleanupReport , ConfirmedTransaction , ReplacedTransaction ,
12+ SubmittedTransactionDehydrated , TransactionStoreError ,
1313 } ,
1414 worker:: {
1515 EoaExecutorWorker ,
@@ -49,9 +49,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
4949
5050 if self . store . is_manual_reset_scheduled ( ) . await ? {
5151 tracing:: info!( "Manual reset scheduled, executing now" ) ;
52- self . store
53- . reset_nonces ( transaction_counts. latest )
54- . await ?;
52+ self . store . reset_nonces ( transaction_counts. latest ) . await ?;
5553 }
5654
5755 let cached_transaction_count = match self . store . get_cached_transaction_count ( ) . await {
@@ -111,31 +109,39 @@ impl<C: Chain> EoaExecutorWorker<C> {
111109 error = ?e,
112110 "Failed to attempt gas bump for stalled nonce, trying fallback"
113111 ) ;
114-
112+
115113 // Fallback: try to send a no-op transaction
116114 tracing:: info!(
117115 nonce = transaction_counts. preconfirmed,
118116 "Gas bump failed, attempting no-op transaction as fallback"
119117 ) ;
120- if let Ok ( noop_tx) = self . send_noop_transaction ( transaction_counts. preconfirmed ) . await {
118+ if let Ok ( noop_tx) = self
119+ . send_noop_transaction ( transaction_counts. preconfirmed )
120+ . await
121+ {
121122 if let Err ( e) = self . store . process_noop_transactions ( & [ noop_tx] ) . await {
122123 tracing:: error!(
123124 error = ?e,
124125 "Failed to process fallback no-op transaction for stalled nonce"
125126 ) ;
126127 }
127128 } else {
128- tracing:: error!( "Failed to send fallback no-op transaction for stalled nonce" ) ;
129-
129+ tracing:: error!(
130+ "Failed to send fallback no-op transaction for stalled nonce"
131+ ) ;
132+
130133 // Ultimate fallback: check if we should trigger auto-reset
131- let time_since_movement = now. saturating_sub ( current_health. last_nonce_movement_at ) ;
132- if time_since_movement > 5 * 60 * 1000 && submitted_count > 0 { // 5 minutes
134+ let time_since_movement =
135+ now. saturating_sub ( current_health. last_nonce_movement_at ) ;
136+
137+ if ( time_since_movement > ( 5 * 60 * 1000 ) ) && ( submitted_count > 0 ) {
138+ // 5 minutes
133139 tracing:: warn!(
134140 nonce = transaction_counts. preconfirmed,
135141 time_since_movement = time_since_movement,
136142 "EOA appears permanently stuck, scheduling auto-reset"
137143 ) ;
138-
144+
139145 if let Err ( e) = self . store . schedule_manual_reset ( ) . await {
140146 tracing:: error!( error = ?e, "Failed to schedule auto-reset" ) ;
141147 }
@@ -251,7 +257,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
251257 . clean_submitted_transactions (
252258 & successes,
253259 TransactionCounts {
254- latest : transaction_counts. latest . saturating_sub ( 1 ) , // Use latest for replacement detection
260+ latest : transaction_counts. latest . saturating_sub ( 1 ) , // Use latest for replacement detection
255261 preconfirmed : transaction_counts. preconfirmed . saturating_sub ( 1 ) , // Use preconfirmed for confirmation
256262 } ,
257263 self . webhook_queue . clone ( ) ,
@@ -425,14 +431,19 @@ impl<C: Chain> EoaExecutorWorker<C> {
425431 . await ?;
426432
427433 // Send the bumped transaction with retry logic
428- match self . send_tx_envelope_with_retry ( bumped_tx. into ( ) , crate :: eoa:: worker:: error:: SendContext :: InitialBroadcast )
434+ match self
435+ . send_tx_envelope_with_retry (
436+ bumped_tx. into ( ) ,
437+ crate :: eoa:: worker:: error:: SendContext :: InitialBroadcast ,
438+ )
429439 . instrument ( tracing:: info_span!(
430- "send_tx_envelope_with_retry" ,
440+ "send_tx_envelope_with_retry" ,
431441 transaction_id = %newest_transaction_data. transaction_id,
432442 nonce = expected_nonce,
433443 context = "gas_bump"
434444 ) )
435- . await {
445+ . await
446+ {
436447 Ok ( _) => {
437448 tracing:: info!(
438449 transaction_id = ?newest_transaction_data. transaction_id,
0 commit comments