Skip to content

Commit 0ae88cc

Browse files
committed
fix(rebalancer): skip private key enforcement in monitor-only mode
1 parent c252fa2 commit 0ae88cc

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

typescript/rebalancer/src/service.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,24 +196,26 @@ async function main(): Promise<void> {
196196
}
197197

198198
// Fail fast if config references protocol-specific inventory signer but key is missing
199-
for (const protocol of Object.values(ProtocolType)) {
200-
if (
201-
rebalancerConfig.inventorySigners?.[protocol] &&
202-
!inventoryPrivateKeys[protocol]
203-
) {
204-
const envKey = `HYP_INVENTORY_KEY_${protocol.toUpperCase()}`;
205-
const hint =
206-
protocol === ProtocolType.Ethereum
207-
? `${envKey} (or fallback HYP_INVENTORY_KEY)`
208-
: envKey;
209-
logger.error(
210-
{
211-
inventorySigner:
212-
rebalancerConfig.inventorySigners[protocol]?.address,
213-
},
214-
`Config specifies inventorySigners.${protocol} but ${hint} is not set.`,
215-
);
216-
process.exit(1);
199+
if (!monitorOnly) {
200+
for (const protocol of Object.values(ProtocolType)) {
201+
if (
202+
rebalancerConfig.inventorySigners?.[protocol] &&
203+
!inventoryPrivateKeys[protocol]
204+
) {
205+
const envKey = `HYP_INVENTORY_KEY_${protocol.toUpperCase()}`;
206+
const hint =
207+
protocol === ProtocolType.Ethereum
208+
? `${envKey} (or fallback HYP_INVENTORY_KEY)`
209+
: envKey;
210+
logger.error(
211+
{
212+
inventorySigner:
213+
rebalancerConfig.inventorySigners[protocol]?.address,
214+
},
215+
`Config specifies inventorySigners.${protocol} but ${hint} is not set.`,
216+
);
217+
process.exit(1);
218+
}
217219
}
218220
}
219221

0 commit comments

Comments
 (0)