Skip to content

Commit 436b1f4

Browse files
authored
Update health timestamps in EoaExecutorWorker and ResetNoncesTransaction (#70)
- 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.
1 parent 15e488f commit 436b1f4

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

executors/src/eoa/store/atomic.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ impl SafeRedisTransaction for ResetNoncesTransaction<'_> {
716716
if health.nonce_resets.len() > 5 {
717717
health.nonce_resets.drain(0..health.nonce_resets.len() - 5);
718718
}
719+
// Update nonce movement timestamp since we're resetting to a new chain nonce
720+
health.last_nonce_movement_at = now;
721+
health.last_confirmation_at = now;
719722
Some(serde_json::to_string(&health)?)
720723
} else {
721724
None

executors/src/eoa/worker/confirm.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,23 @@ impl<C: Chain> EoaExecutorWorker<C> {
262262
)
263263
.await?;
264264

265+
// If we confirmed any transactions, update the health timestamp even if latest hasn't caught up yet
266+
// This handles the case where flashblocks preconfirmed is ahead of latest
267+
if !successes.is_empty() {
268+
// Update health timestamp to reflect nonce movement from confirmations
269+
if let Ok(mut health) = self.get_eoa_health().await {
270+
let now = EoaExecutorStore::now();
271+
health.last_nonce_movement_at = now;
272+
health.last_confirmation_at = now;
273+
if let Err(e) = self.store.update_health_data(&health).await {
274+
tracing::warn!(
275+
error = ?e,
276+
"Failed to update health timestamp after confirming transactions"
277+
);
278+
}
279+
}
280+
}
281+
265282
Ok(report)
266283
}
267284

0 commit comments

Comments
 (0)