From ab8013d33604e243d0bad3138903e712424b62a8 Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:55:54 +0000 Subject: [PATCH] improve(relayer): Persistently ignore expired deposits --- src/relayer/Relayer.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/relayer/Relayer.ts b/src/relayer/Relayer.ts index 7d91e6fc7..a107456e5 100644 --- a/src/relayer/Relayer.ts +++ b/src/relayer/Relayer.ts @@ -337,6 +337,12 @@ export class Relayer { return ignoreDeposit(); } + // It would be preferable to use host time since it's more reliably up-to-date, but this creates issues in test. + const currentTime = spokePoolClients[destinationChainId].getCurrentTime(); + if (deposit.fillDeadline <= currentTime) { + return ignoreDeposit(); + } + const { minConfirmations } = minDepositConfirmations[originChainId].find(({ usdThreshold }) => usdThreshold.gte(fillAmountUsd) ) ?? { minConfirmations: 100_000 }; @@ -367,12 +373,6 @@ export class Relayer { return false; } - // It would be preferable to use host time since it's more reliably up-to-date, but this creates issues in test. - const currentTime = spokePoolClients[destinationChainId].getCurrentTime(); - if (deposit.fillDeadline <= currentTime) { - return false; - } - if (this.fillIsExclusive(deposit) && getAddress(deposit.exclusiveRelayer) !== this.relayerAddress) { return false; }