From 1b2d9768be5b6c653cc1476fbc49bf649db67ec4 Mon Sep 17 00:00:00 2001 From: Prithvish Baidya Date: Fri, 10 Oct 2025 01:15:58 +0530 Subject: [PATCH] Update health timestamps in EoaExecutorWorker and ResetNoncesTransaction - Added logic to update health timestamps for nonce movement and confirmations in both the EoaExecutorWorker and ResetNoncesTransaction implementations. - Ensured health data reflects the latest nonce movement even when confirmations are ahead of the latest state. --- executors/src/eoa/store/atomic.rs | 3 +++ executors/src/eoa/worker/confirm.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/executors/src/eoa/store/atomic.rs b/executors/src/eoa/store/atomic.rs index d68726a..3f94c11 100644 --- a/executors/src/eoa/store/atomic.rs +++ b/executors/src/eoa/store/atomic.rs @@ -716,6 +716,9 @@ impl SafeRedisTransaction for ResetNoncesTransaction<'_> { if health.nonce_resets.len() > 5 { health.nonce_resets.drain(0..health.nonce_resets.len() - 5); } + // Update nonce movement timestamp since we're resetting to a new chain nonce + health.last_nonce_movement_at = now; + health.last_confirmation_at = now; Some(serde_json::to_string(&health)?) } else { None diff --git a/executors/src/eoa/worker/confirm.rs b/executors/src/eoa/worker/confirm.rs index 09ea467..a0c547d 100644 --- a/executors/src/eoa/worker/confirm.rs +++ b/executors/src/eoa/worker/confirm.rs @@ -262,6 +262,23 @@ impl EoaExecutorWorker { ) .await?; + // If we confirmed any transactions, update the health timestamp even if latest hasn't caught up yet + // This handles the case where flashblocks preconfirmed is ahead of latest + if !successes.is_empty() { + // Update health timestamp to reflect nonce movement from confirmations + if let Ok(mut health) = self.get_eoa_health().await { + let now = EoaExecutorStore::now(); + health.last_nonce_movement_at = now; + health.last_confirmation_at = now; + if let Err(e) = self.store.update_health_data(&health).await { + tracing::warn!( + error = ?e, + "Failed to update health timestamp after confirming transactions" + ); + } + } + } + Ok(report) }