diff --git a/src/relayer/Relayer.ts b/src/relayer/Relayer.ts index fe0198e37..ec9880764 100644 --- a/src/relayer/Relayer.ts +++ b/src/relayer/Relayer.ts @@ -324,6 +324,19 @@ export class Relayer { return ignoreDeposit(); } + // Skip deposits that contain invalid fills from the same relayer. This prevents potential corrupted data from + // making the same relayer fill a deposit multiple times. + if (!acceptInvalidFills && invalidFills.some((fill) => fill.relayer === this.relayerAddress)) { + this.logger.error({ + at: "Relayer::filterDeposit", + message: "๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Skipping deposit with invalid fills from the same relayer", + deposit, + invalidFills, + destinationChainId, + }); + return ignoreDeposit(); + } + const { minConfirmations } = minDepositConfirmations[originChainId].find(({ usdThreshold }) => usdThreshold.gte(fillAmountUsd) ); @@ -364,19 +377,6 @@ export class Relayer { return false; } - // Skip deposits that contain invalid fills from the same relayer. This prevents potential corrupted data from - // making the same relayer fill a deposit multiple times. - if (!acceptInvalidFills && invalidFills.some((fill) => fill.relayer === this.relayerAddress)) { - this.logger.error({ - at: "Relayer::filterDeposit", - message: "๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Skipping deposit with invalid fills from the same relayer", - deposit, - invalidFills, - destinationChainId, - }); - return false; - } - // We query the relayer API to get the deposit limits for different token and origin combinations. // The relayer should *not* be filling deposits that the HubPool doesn't have liquidity for otherwise the relayer's // refund will be stuck for potentially 7 days. Note: Filter for supported tokens first, since the relayer only