Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(reporter): log rebalance information for debugging #1921

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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