From a8f61e088007931bd908c3b781942b16fbf3e3c3 Mon Sep 17 00:00:00 2001 From: nicholaspai Date: Wed, 5 Feb 2025 20:44:46 -0500 Subject: [PATCH] cannot request slow fills in exclusivity window --- src/relayer/Relayer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/relayer/Relayer.ts b/src/relayer/Relayer.ts index 2aebde012..fb42af480 100644 --- a/src/relayer/Relayer.ts +++ b/src/relayer/Relayer.ts @@ -181,6 +181,11 @@ export class Relayer { message: "Completed relayer maintenance.", }); } + + fillIsExclusive(deposit: Deposit): boolean { + const currentTime = this.clients.spokePoolClients[deposit.destinationChainId].getCurrentTime(); + return deposit.exclusivityDeadline >= currentTime; + } /** * @description For a given deposit, apply relayer-specific filtering to determine whether it should be filled. @@ -291,7 +296,7 @@ export class Relayer { return false; } - if (deposit.exclusivityDeadline >= currentTime && getAddress(deposit.exclusiveRelayer) !== this.relayerAddress) { + if (this.fillIsExclusive(deposit) && getAddress(deposit.exclusiveRelayer) !== this.relayerAddress) { return false; } @@ -631,7 +636,7 @@ export class Relayer { // If depositor is on the slow deposit list, then send a zero fill to initiate a slow relay and return early. if (slowDepositors?.includes(depositor)) { - if (fillStatus === FillStatus.Unfilled) { + if (fillStatus === FillStatus.Unfilled && !this.fillIsExclusive(deposit)) { this.logger.debug({ at: "Relayer::evaluateFill", message: "Initiating slow fill for grey listed depositor",