Skip to content

Commit

Permalink
improve(relayer): Persistently ignore expired deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Feb 24, 2025
1 parent 6038b8b commit ab8013d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/relayer/Relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit ab8013d

Please sign in to comment.