Skip to content

[scanner] info! emitted on every matched oracle update — log flood and missing Prometheus counter #233

@obchain

Description

@obchain

Refs #46

PR: feat/21-mempool-monitor
File: crates/charon-scanner/src/mempool.rs
Function: MempoolMonitor::run_once

Problem

On every pending tx that matches the oracle filter, the code emits:

info!(
    %hash,
    asset = %update.asset,
    selector = %format_selector(update.selector),
    price = ?update.new_price,
    "venus oracle update seen in mempool"
);

The Venus ResilientOracle is updated by keeper bots on a per-heartbeat cadence for all active markets. On BSC with ~3 s block time and multiple tracked assets this will emit multiple info! lines per block during normal operation. At production borrower-list scale, logs will be dominated by this message.

Additionally, there is no Prometheus counter (e.g. oracle_updates_seen_total{selector="0x..."}) emitted for observability. The project uses Prometheus on :9091 for all operational metrics.

Required fix

Downgrade the match log to debug!. Add a Prometheus counter oracle_updates_seen_total with a selector label, incremented on each match. This aligns with the observability pattern in charon-scanner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions