From f4043b785c6b6e461493093433fee41539ea1a27 Mon Sep 17 00:00:00 2001 From: bmzig <57361391+bmzig@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:14:43 -0600 Subject: [PATCH] improve(reporter): log rebalance information for debugging (#1921) Signed-off-by: bennett --- src/monitor/Monitor.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/monitor/Monitor.ts b/src/monitor/Monitor.ts index 34ab55801..9bee157a5 100644 --- a/src/monitor/Monitor.ts +++ b/src/monitor/Monitor.ts @@ -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, @@ -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. @@ -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 @@ -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.