Skip to content

Commit

Permalink
refactor(relayer): Defer origin chain limits computation (#1793)
Browse files Browse the repository at this point in the history
If there are no deposits then it doesn't make sense to compute this.
Defer it in order to reduce log noise.
  • Loading branch information
pxrl committed Aug 29, 2024
1 parent cd17c2b commit 710839e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/relayer/Relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,6 @@ export class Relayer {
.flat()
.map(({ deposit }) => deposit);

this.fillLimits = this.computeFillLimits();

this.logger.debug({
at: "Relayer::checkForUnfilledDepositsAndFill",
message: `${allUnfilledDeposits.length} unfilled deposits found.`,
Expand All @@ -727,6 +725,8 @@ export class Relayer {
return txnReceipts;
}

this.fillLimits = this.computeFillLimits();

const lpFees = await this.batchComputeLpFees(allUnfilledDeposits);
await sdkUtils.forEachAsync(Object.entries(unfilledDeposits), async ([chainId, _deposits]) => {
if (_deposits.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/Relayer.BasicFill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ describe("Relayer: Check for Unfilled Deposits and Fill", async function () {
for (const receipts of Object.values(txnReceipts)) {
expect((await receipts).length).to.equal(0);
}
expect(spyLogIncludes(spy, -3, "due to insufficient deposit confirmations.")).to.be.true;
expect(spyLogIncludes(spy, -2, "due to insufficient deposit confirmations.")).to.be.true;
expect(lastSpyLogIncludes(spy, "0 unfilled deposits found.")).to.be.true;
});

Expand Down

0 comments on commit 710839e

Please sign in to comment.