From 6826352c2511752a5d6fca8a0e0e83ba23e6dead Mon Sep 17 00:00:00 2001 From: Jess Date: Fri, 28 Aug 2026 21:31:38 +0100 Subject: [PATCH] Add polling progress logging for large-range reconciliation (#629) Log the reconciled ledger window at the start of each run and report per-contract synchronization progress (on-chain vs indexed counts and missing events) only when data is present, so large synchronization operations are observable without log noise or exposing secrets. --- .../services/indexing-reconciliation-engine.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/listener/src/services/indexing-reconciliation-engine.ts b/listener/src/services/indexing-reconciliation-engine.ts index 4548e355..b76d4d08 100644 --- a/listener/src/services/indexing-reconciliation-engine.ts +++ b/listener/src/services/indexing-reconciliation-engine.ts @@ -272,6 +272,11 @@ export class IndexingReconciliationEngine { const startLedger = Math.max(1, tip - this.lookbackLedgers); const endLedger = tip; + logger.info('Indexing reconciliation run started', { + window: { startLedger, endLedger }, + contracts: this.contractAddresses.length, + }); + for (const contractAddress of this.contractAddresses) { await this.checkContract(contractAddress, startLedger, endLedger); } @@ -311,6 +316,17 @@ export class IndexingReconciliationEngine { }); const gaps = detectIndexingGaps(onChain, indexed); + + if (onChain.length > 0 || indexed.length > 0) { + logger.info('Reconciliation contract progress', { + contractAddress, + window: { startLedger, endLedger }, + onChainCount: onChain.length, + indexedCount: indexed.length, + missingEvents: gaps.missingEvents.length, + }); + } + if (gaps.missingEvents.length === 0) { return; }