@@ -8,8 +8,8 @@ use crate::{
8
8
eoa:: {
9
9
EoaExecutorStore ,
10
10
store:: {
11
- CleanupReport , ConfirmedTransaction , ReplacedTransaction , SubmittedTransactionDehydrated ,
12
- TransactionStoreError ,
11
+ CleanupReport , ConfirmedTransaction , ReplacedTransaction ,
12
+ SubmittedTransactionDehydrated , TransactionStoreError ,
13
13
} ,
14
14
worker:: {
15
15
EoaExecutorWorker ,
@@ -49,9 +49,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
49
49
50
50
if self . store . is_manual_reset_scheduled ( ) . await ? {
51
51
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 ?;
55
53
}
56
54
57
55
let cached_transaction_count = match self . store . get_cached_transaction_count ( ) . await {
@@ -111,31 +109,39 @@ impl<C: Chain> EoaExecutorWorker<C> {
111
109
error = ?e,
112
110
"Failed to attempt gas bump for stalled nonce, trying fallback"
113
111
) ;
114
-
112
+
115
113
// Fallback: try to send a no-op transaction
116
114
tracing:: info!(
117
115
nonce = transaction_counts. preconfirmed,
118
116
"Gas bump failed, attempting no-op transaction as fallback"
119
117
) ;
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
+ {
121
122
if let Err ( e) = self . store . process_noop_transactions ( & [ noop_tx] ) . await {
122
123
tracing:: error!(
123
124
error = ?e,
124
125
"Failed to process fallback no-op transaction for stalled nonce"
125
126
) ;
126
127
}
127
128
} 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
+
130
133
// 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
133
139
tracing:: warn!(
134
140
nonce = transaction_counts. preconfirmed,
135
141
time_since_movement = time_since_movement,
136
142
"EOA appears permanently stuck, scheduling auto-reset"
137
143
) ;
138
-
144
+
139
145
if let Err ( e) = self . store . schedule_manual_reset ( ) . await {
140
146
tracing:: error!( error = ?e, "Failed to schedule auto-reset" ) ;
141
147
}
@@ -251,7 +257,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
251
257
. clean_submitted_transactions (
252
258
& successes,
253
259
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
255
261
preconfirmed : transaction_counts. preconfirmed . saturating_sub ( 1 ) , // Use preconfirmed for confirmation
256
262
} ,
257
263
self . webhook_queue . clone ( ) ,
@@ -425,14 +431,19 @@ impl<C: Chain> EoaExecutorWorker<C> {
425
431
. await ?;
426
432
427
433
// 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
+ )
429
439
. instrument ( tracing:: info_span!(
430
- "send_tx_envelope_with_retry" ,
440
+ "send_tx_envelope_with_retry" ,
431
441
transaction_id = %newest_transaction_data. transaction_id,
432
442
nonce = expected_nonce,
433
443
context = "gas_bump"
434
444
) )
435
- . await {
445
+ . await
446
+ {
436
447
Ok ( _) => {
437
448
tracing:: info!(
438
449
transaction_id = ?newest_transaction_data. transaction_id,
0 commit comments