Skip to content

Migrate pool off custom axum router to stratum_apps::MonitoringServer #86

@vnprc

Description

@vnprc

Summary

Hashpool's pool monitoring (roles/pool/src/lib/monitoring.rs) is a bespoke axum router. The SRI reference pool uses stratum_apps::MonitoringServer with Sv2ClientsMonitoring implemented on ChannelManager, which gives it the full REST API, Prometheus metrics, Swagger UI, and snapshot cache for free.

Motivation

Migrating to the standard pattern would:

  • Delete the custom monitoring.rs axum code
  • Simplify hashpool-local steps whenever upstream stratum-apps library features are added (e.g. the network field in GlobalInfo collapses to a one-liner instead of a hand-rolled endpoint)
  • Keep hashpool's monitoring surface in sync with upstream automatically

Blocked on

Mapping hashpool-specific stats (ehash, quotes, per-downstream hashrate) onto the stratum_apps monitoring trait surface. These stats have no equivalent in the SRI reference pool and need a design decision before the migration can proceed.

Related

  • docs/pr/sri-pr-globalinfo-network.md — "Future work" section captures the specific simplification this migration enables for the GlobalInfo.network feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions