From 5634000b05cb0015939531a44c1e49605bc0c6da Mon Sep 17 00:00:00 2001 From: bennett Date: Mon, 7 Apr 2025 12:10:11 -0500 Subject: [PATCH 1/2] improve: only warn on invalid/unrepayable fills on mainnet Signed-off-by: bennett --- src/clients/SpokePoolClient/SpokePoolClient.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clients/SpokePoolClient/SpokePoolClient.ts b/src/clients/SpokePoolClient/SpokePoolClient.ts index 1a316bd4a..9c0fc7201 100644 --- a/src/clients/SpokePoolClient/SpokePoolClient.ts +++ b/src/clients/SpokePoolClient/SpokePoolClient.ts @@ -24,7 +24,7 @@ import { spreadEvent, spreadEventWithBlockNumber, } from "../../utils/EventUtils"; -import { ZERO_ADDRESS } from "../../constants"; +import { ZERO_ADDRESS, CHAIN_IDs } from "../../constants"; import { Deposit, DepositWithBlock, @@ -405,8 +405,10 @@ export abstract class SpokePoolClient extends BaseAbstractClient { } return newInvalidFill; }); + // Log invalid and unrepayable fills as warns iff the hub pool client is defined for mainnet. + const logLevel = this.hubPoolClient?.chainId === CHAIN_IDs.MAINNET ? "warn" : "debug"; if (invalidFillsForDeposit.length > 0) { - this.logger.warn({ + this.logger[logLevel]({ at: "SpokePoolClient", chainId: this.chainId, message: "Invalid fills found matching deposit ID", @@ -417,7 +419,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient { } const unrepayableFillsForDeposit = unrepayableFills.filter((x) => x.depositId.eq(deposit.depositId)); if (unrepayableFillsForDeposit.length > 0) { - this.logger.warn({ + this.logger[logLevel]({ at: "SpokePoolClient", chainId: this.chainId, message: "Unrepayable fills found where we need to switch repayment address and or chain", From 924016d4d84d488282a2eb5e09b494ad7a33dd52 Mon Sep 17 00:00:00 2001 From: bennett Date: Mon, 7 Apr 2025 12:12:42 -0500 Subject: [PATCH 2/2] comment Signed-off-by: bennett --- src/clients/SpokePoolClient/SpokePoolClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clients/SpokePoolClient/SpokePoolClient.ts b/src/clients/SpokePoolClient/SpokePoolClient.ts index 9c0fc7201..10044ef68 100644 --- a/src/clients/SpokePoolClient/SpokePoolClient.ts +++ b/src/clients/SpokePoolClient/SpokePoolClient.ts @@ -405,7 +405,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient { } return newInvalidFill; }); - // Log invalid and unrepayable fills as warns iff the hub pool client is defined for mainnet. + // Log invalid and unrepayable fills as warns iff the hub pool client is defined and the hub chain is mainnet. const logLevel = this.hubPoolClient?.chainId === CHAIN_IDs.MAINNET ? "warn" : "debug"; if (invalidFillsForDeposit.length > 0) { this.logger[logLevel]({