Skip to content

improve: only warn on invalid/unrepayable fills on mainnet #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/clients/SpokePoolClient/SpokePoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 and the hub chain is 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",
Expand All @@ -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",
Expand Down