Skip to content

Commit 6a41959

Browse files
authored
log error and re-add noop flow (#55)
* re-add no-ops * log send errors
1 parent 3683591 commit 6a41959

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

executors/src/eoa/worker/confirm.rs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,41 @@ impl<C: Chain> EoaExecutorWorker<C> {
109109
bumped_nonce = transaction_counts.preconfirmed,
110110
preconfirmed_nonce = transaction_counts.preconfirmed,
111111
latest_nonce = transaction_counts.latest,
112-
"Failed to attempt gas bump for stalled nonce. Scheduling nonce reset"
112+
"Failed to attempt gas bump for stalled nonce. Attempting no-op transaction as fallback"
113113
);
114114

115-
if let Err(e) = self.store.schedule_manual_reset().await {
116-
tracing::error!(error = ?e, "Failed to schedule auto-reset");
115+
// Try sending a no-op transaction as fallback
116+
match self
117+
.send_noop_transaction(transaction_counts.preconfirmed)
118+
.await
119+
{
120+
Ok(noop_tx) => {
121+
// Process the no-op transaction
122+
if let Err(e) =
123+
self.store.process_noop_transactions(&[noop_tx]).await
124+
{
125+
tracing::error!(
126+
error = ?e,
127+
bumped_nonce = transaction_counts.preconfirmed,
128+
preconfirmed_nonce = transaction_counts.preconfirmed,
129+
latest_nonce = transaction_counts.latest,
130+
"Failed to process fallback no-op transaction for stalled nonce, but sending transactions was successful"
131+
);
132+
}
133+
}
134+
Err(e) => {
135+
tracing::error!(
136+
error = ?e,
137+
bumped_nonce = transaction_counts.preconfirmed,
138+
preconfirmed_nonce = transaction_counts.preconfirmed,
139+
latest_nonce = transaction_counts.latest,
140+
"Failed to send fallback no-op transaction for stalled nonce. Scheduling auto-reset if EOA is stuck"
141+
);
142+
143+
if let Err(e) = self.store.schedule_manual_reset().await {
144+
tracing::error!(error = ?e, "Failed to schedule auto-reset");
145+
}
146+
}
117147
}
118148
}
119149
}

executors/src/eoa/worker/send.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
use alloy::providers::Provider;
1+
use alloy::{consensus::Transaction, providers::Provider};
22
use engine_core::{chain::Chain, error::AlloyRpcErrorToEngineError};
33

44
use crate::eoa::{
5-
store::{BorrowedTransaction, PendingTransaction, SubmissionResult},
5+
EoaExecutorStore,
6+
store::{BorrowedTransaction, PendingTransaction, SubmissionResult, SubmissionResultType},
67
worker::{
8+
EoaExecutorWorker,
79
error::{
8-
is_retryable_preparation_error, should_update_balance_threshold, EoaExecutorWorkerError, SendContext
9-
}, EoaExecutorWorker
10-
}, EoaExecutorStore,
10+
EoaExecutorWorkerError, SendContext, is_retryable_preparation_error,
11+
should_update_balance_threshold,
12+
},
13+
},
1114
};
1215

1316
const HEALTH_CHECK_INTERVAL_MS: u64 = 60 * 5 * 1000; // 5 minutes in milliseconds
@@ -391,12 +394,24 @@ impl<C: Chain> EoaExecutorWorker<C> {
391394
.into_iter()
392395
.zip(cleaned_results.into_iter())
393396
.map(|(send_result, borrowed_tx)| {
394-
SubmissionResult::from_send_result(
397+
let result = SubmissionResult::from_send_result(
395398
&borrowed_tx,
396399
send_result,
397400
SendContext::InitialBroadcast,
398401
&self.chain,
399-
)
402+
);
403+
404+
match &result.result {
405+
SubmissionResultType::Success => result,
406+
SubmissionResultType::Nack(e) => {
407+
tracing::error!(error = ?e, transaction_id = borrowed_tx.transaction_id, nonce = borrowed_tx.data.signed_transaction.nonce(), "Transaction nack error during send");
408+
result
409+
}
410+
SubmissionResultType::Fail(e) => {
411+
tracing::error!(error = ?e, transaction_id = borrowed_tx.transaction_id, nonce = borrowed_tx.data.signed_transaction.nonce(), "Transaction failed during send");
412+
result
413+
}
414+
}
400415
})
401416
.collect();
402417

0 commit comments

Comments
 (0)