Skip to content

Commit

Permalink
improve(reporter): log rebalance information for debugging (#1921)
Browse files Browse the repository at this point in the history
Signed-off-by: bennett <[email protected]>
  • Loading branch information
bmzig authored Nov 22, 2024
1 parent d38be08 commit f4043b7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/monitor/Monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ export class Monitor {
);
const enabledChainIds = this.clients.configStoreClient.getChainIdIndicesForBlock(nextBundleMainnetStartBlock);

this.logger.debug({
at: "Monitor#checkSpokePoolRunningBalances",
message: "Mainnet root bundles in scope",
validatedBundles,
outstandingBundle: bundle,
});

const slowFillBlockRange = getWidestPossibleExpectedBlockRange(
enabledChainIds,
this.clients.spokePoolClients,
Expand All @@ -682,6 +689,13 @@ export class Monitor {
: [endBlockNumber + 1, spokeLatestBlockSearched > endBlockNumber ? spokeLatestBlockSearched : endBlockNumber];
});

this.logger.debug({
at: "Monitor#checkSpokePoolRunningBalances",
message: "Block ranges to search",
slowFillBlockRange,
blockRangeTail,
});

// Do all async tasks in parallel. We want to know about the pool rebalances, slow fills in the most recent proposed bundle, refunds
// from the last `n` bundles, pending refunds which have not been made official via a root bundle proposal, and the current balances of
// all the spoke pools.
Expand Down Expand Up @@ -739,6 +753,12 @@ export class Monitor {
});
}

this.logger.debug({
at: "Monitor#checkSpokePoolRunningBalances",
message: "Print pool rebalance leaves",
poolRebalanceRootLeaves: poolRebalanceLeaves,
});

// Calculate the pending refunds.
for (const chainId of chainIds) {
const l2TokenAddresses = monitoredTokenSymbols
Expand Down Expand Up @@ -770,6 +790,13 @@ export class Monitor {
);
pendingRelayerRefunds[chainId][l2Token] = pendingValidatedDeductions.add(nextBundleDeductions);
});

this.logger.debug({
at: "Monitor#checkSpokePoolRunningBalances",
message: "Print refund amounts for chainId",
chainId,
pendingDeductions: pendingRelayerRefunds[chainId],
});
}

// Get the slow fill amounts. Only do this step if there were slow fills in the most recent root bundle.
Expand Down

0 comments on commit f4043b7

Please sign in to comment.