Skip to content

Commit 873c4c6

Browse files
committed
feat: add ignore list
1 parent 86ed0dd commit 873c4c6

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/config/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const envConfigMapping: Record<keyof ConfigSchema, string | string[]> = {
1212
deployPartialLiquidatorContracts: "DEPLOY_PARTIAL_LIQUIDATOR",
1313
deployBatchLiquidatorContracts: "DEPLOY_BATCH_LIQUIDATOR",
1414
ethProviderRpcs: "JSON_RPC_PROVIDERS",
15+
ignoreAccounts: "IGNORE_ACCOUNTS",
1516
logsPageSize: "LOGS_PAGE_SIZE",
1617
hfThreshold: "HF_TRESHOLD",
1718
restakingWorkaround: "RESTAKING_WORKAROUND",

src/config/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export const ConfigSchema = PartialV300ConfigSchema.extend({
4848
* Port to expose some vital signals and metrics
4949
*/
5050
port: z.coerce.number().default(4000),
51+
/**
52+
* Only check these accounts during local debug session
53+
*/
54+
ignoreAccounts: stringArrayLike.optional().pipe(z.array(Address).optional()),
5155
/**
5256
* Only check these accounts during local debug session
5357
*/

src/services/scanner/Scanner.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ export class Scanner {
159159
`filtered out ${before - accounts.length} restaking accounts`,
160160
);
161161
}
162+
if (this.config.ignoreAccounts) {
163+
const before = accounts.length;
164+
const ignoreAccounts = new Set(
165+
this.config.ignoreAccounts?.map(a => a.toLowerCase()),
166+
);
167+
accounts = accounts.filter(
168+
ca => !ignoreAccounts.has(ca.addr.toLowerCase()),
169+
);
170+
this.log.debug(
171+
`filtered out ${before - accounts.length} ignored accounts`,
172+
);
173+
}
162174
const time = Math.round((new Date().getTime() - start) / 1000);
163175
this.log.debug(
164176
`${accounts.length} accounts to liquidate${blockS}, time: ${time}s`,

0 commit comments

Comments
 (0)