Skip to content

Commit

Permalink
fix: some more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Apr 27, 2024
1 parent b2060fb commit de86568
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/optimistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ export interface OptimisticResult {
duration?: number;

callsHuman?: string[];
error?: string;
hfBefore?: number;
}
2 changes: 2 additions & 0 deletions src/services/liquidate/AbstractLiquidatorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default abstract class AbstractLiquidatorService
creditManager: ca.creditManager,
borrower: ca.borrower,
account: ca.addr,
hfBefore: ca.healthFactor,
gasUsed: 0,
calls: [],
isError: true,
Expand Down Expand Up @@ -167,6 +168,7 @@ export default abstract class AbstractLiquidatorService
} catch (e: any) {
if (e.code === utils.Logger.errors.UNPREDICTABLE_GAS_LIMIT) {
this.log.error(`failed to estimate gas: ${e.reason}`);
optimisticResult.error = e.reason;
} else {
this.log.debug(`failed to esitmate gas: ${e.code} ${Object.keys(e)}`);
}
Expand Down
4 changes: 4 additions & 0 deletions src/services/scan/ScanServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export class ScanServiceV3 extends AbstractScanService {
);
accounts = accounts.sort((a, b) => a.healthFactor - b.healthFactor);
if (config.restakingWorkaround) {
const before = accounts.length;
accounts = this.#filterRestakingAccounts(accounts);
this.log.debug(
`filtered out ${before - accounts.length} restaking accounts`,
);
}
this.log.debug(
`${accounts.length} v3 accounts to liquidate${blockS}: ${accounts.map(a => `${a.addr} [${a.healthFactor}]`).join(",")}`,
Expand Down

0 comments on commit de86568

Please sign in to comment.