Skip to content

Commit f1ea797

Browse files
Add detailed job lifecycle logging to EOA executor worker (#88)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced job lifecycle monitoring with added timing instrumentation across workflow stages. Improved logging now includes duration metrics and per-stage performance tracking for better execution observability. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a0d76d7 commit f1ea797

File tree

1 file changed

+33
-1
lines changed
  • executors/src/eoa/worker

1 file changed

+33
-1
lines changed

executors/src/eoa/worker/mod.rs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ where
230230
job_duration_seconds = job_duration,
231231
work_remaining = result.is_work_remaining(),
232232
result = ?result,
233-
"EOA executor job completed"
233+
"JOB_LIFECYCLE - EOA executor job completed"
234234
);
235235

236236
let delay = if is_minimal_account {
@@ -305,31 +305,62 @@ impl<C: Chain> EoaExecutorWorker<C> {
305305
&self,
306306
) -> JobResult<EoaExecutorWorkerResult, EoaExecutorWorkerError> {
307307
// 1. CRASH RECOVERY
308+
let start_time = current_timestamp_ms();
308309
let recovered = self
309310
.recover_borrowed_state()
310311
.await
311312
.inspect_err(|e| {
312313
tracing::error!(error = ?e, "Error in recover_borrowed_state");
313314
})
314315
.map_err(|e| e.handle())?;
316+
let duration = calculate_duration_seconds(start_time, current_timestamp_ms());
317+
tracing::info!(
318+
eoa = ?self.eoa,
319+
chain_id = self.chain_id,
320+
worker_id = self.store.worker_id(),
321+
duration_seconds = duration,
322+
recovered_count = recovered,
323+
"JOB_LIFECYCLE - Crash recovery completed"
324+
);
315325

316326
// 2. CONFIRM FLOW
327+
let start_time = current_timestamp_ms();
317328
let confirmations_report = self
318329
.confirm_flow()
319330
.await
320331
.inspect_err(|e| {
321332
tracing::error!(error = ?e, "Error in confirm flow");
322333
})
323334
.map_err(|e| e.handle())?;
335+
let duration = calculate_duration_seconds(start_time, current_timestamp_ms());
336+
tracing::info!(
337+
eoa = ?self.eoa,
338+
chain_id = self.chain_id,
339+
worker_id = self.store.worker_id(),
340+
duration_seconds = duration,
341+
confirmed = confirmations_report.moved_to_success,
342+
failed = confirmations_report.moved_to_pending,
343+
"JOB_LIFECYCLE - Confirm flow completed"
344+
);
324345

325346
// 3. SEND FLOW
347+
let start_time = current_timestamp_ms();
326348
let sent = self
327349
.send_flow()
328350
.await
329351
.inspect_err(|e| {
330352
tracing::error!(error = ?e, "Error in send_flow");
331353
})
332354
.map_err(|e| e.handle())?;
355+
let duration = calculate_duration_seconds(start_time, current_timestamp_ms());
356+
tracing::info!(
357+
eoa = ?self.eoa,
358+
chain_id = self.chain_id,
359+
worker_id = self.store.worker_id(),
360+
duration_seconds = duration,
361+
sent_count = sent,
362+
"JOB_LIFECYCLE - Send flow completed"
363+
);
333364

334365
// 4. CHECK FOR REMAINING WORK
335366
let counts = self
@@ -351,6 +382,7 @@ impl<C: Chain> EoaExecutorWorker<C> {
351382
currently_pending = counts.pending_transactions,
352383
currently_borrowed = counts.borrowed_transactions,
353384
currently_recycled = counts.recycled_nonces,
385+
"JOB_LIFECYCLE - Check for remaining work completed"
354386
);
355387

356388
Ok(EoaExecutorWorkerResult {

0 commit comments

Comments
 (0)