Skip to content

[PR #34] NearLiquidation bucket dead code while adapter returns binary HF sentinel (blocks #98) #104

@obchain

Description

@obchain

PR: #34 (feat/09-health-scanner)
File: crates/charon-scanner/src/scanner.rs, classify() method
Depends on: issue #98 (binary health factor in Venus adapter)

Problem: Venus adapter (PR #33) returns HF=0 for position with shortfall>0, HF=2e18 for liquidity>0. Default thresholds: liquidatable=1.0e18, near_liq=1.05e18.

With those values: HF=0 < 1.0e18 → Liquidatable; HF=2e18 >= 1.05e18 → Healthy. NearLiquidation band [1.0e18, 1.05e18) unreachable until #98 ships real ratio.

scanner.rs contains no compile-time note, no debug_assert, no TODO referencing dependency. PR merges silently with a bucket that never populates in production, making "3-bucket" claim in PR title misleading. Downstream consumers (pre-signed tx layer) keying on near_liquidation() receive empty vec every block with no signal that feature is non-functional.

Fix: Add prominent doc comment on classify() and debug_assert or tracing::warn! at startup if adapter's known HF sentinel values (0 and 2e18) detected, indicating binary-HF dependency unresolved. Block merge until #98 closed, or mark this PR as skeleton pending #98.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p1-coreCore MVP scopetype:featureNew capability or deliverable

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions