PR: #34 (feat/09-health-scanner)
File: crates/charon-scanner/src/scanner.rs, crates/charon-cli/src/main.rs
Problem: PRD step 9 specifies HOT bucket scanned every block, WARM every N blocks, COLD every M blocks via separate tokio tasks or tokio::select! on multiple interval timers.
What PR delivers: HealthScanner is a pure synchronous classifier struct, no async runtime component. upsert() called once per block inside existing BlockListener loop in main.rs; all three buckets fed from a single full get_positions() on every block. No per-bucket interval, no tokio task split, no block-count gating for WARM/COLD.
Impact: Central architectural feature of PRD — differential scan cadence to reduce RPC load for low-risk positions — is missing. COLD positions generate as many RPC calls as HOT, negating purpose of 3-bucket design. Not future work; it is the stated deliverable of this step.
Fix: Introduce ScanScheduler holding three tokio::interval handles (hot=1 block, warm=N blocks, cold=M blocks). Drive each from tokio::select! loop. Each arm calls upsert() only with positions in corresponding bucket, fetched from adapter for that subset of borrowers.
PR: #34 (feat/09-health-scanner)
File: crates/charon-scanner/src/scanner.rs, crates/charon-cli/src/main.rs
Problem: PRD step 9 specifies HOT bucket scanned every block, WARM every N blocks, COLD every M blocks via separate tokio tasks or
tokio::select!on multiple interval timers.What PR delivers:
HealthScanneris a pure synchronous classifier struct, no async runtime component.upsert()called once per block inside existing BlockListener loop in main.rs; all three buckets fed from a single fullget_positions()on every block. No per-bucket interval, no tokio task split, no block-count gating for WARM/COLD.Impact: Central architectural feature of PRD — differential scan cadence to reduce RPC load for low-risk positions — is missing. COLD positions generate as many RPC calls as HOT, negating purpose of 3-bucket design. Not future work; it is the stated deliverable of this step.
Fix: Introduce
ScanSchedulerholding threetokio::intervalhandles (hot=1 block, warm=N blocks, cold=M blocks). Drive each fromtokio::select!loop. Each arm callsupsert()only with positions in corresponding bucket, fetched from adapter for that subset of borrowers.