block / block/proto-fleet

Group miner counts inconsistent and group dashboards show metrics for empty groups (soft-deleted miners suspected)

Open
#651 0 comments 0 reactions 0 assignees View on GitHub
bug server
Dominant language
Go
Stars
55
Forks
16
Avg merge
1d 22h
Merged PRs (30d)
87

Description

## Summary

Group miner counts are inconsistent across the UI, and group dashboards render performance metrics even when the group page reports 0 miners. A likely suspect is soft-deleted miners still being included in some queries (counts, telemetry aggregation) but excluded from others.

## Observed behavior

**1. Miner counts for groups can be wrong**

- The Groups list page shows `newwww` with **1013 miners**, and `big group` / `new group` with **999 miners** each.
- Opening the `newwww` group page shows **Miners: 0**, with 0% across Healthy / Needs Attention / Offline / Sleeping.
- These two surfaces disagree, so at least one of them is counting incorrectly. The suspicion is that soft-deleted miners are still counted in the groups list aggregation (or in group membership) while the group detail page filters them out.

**2. Group dashboard shows metrics with no miners in the group**

On the same `newwww` group page that reports 0 miners:

- Hashrate: 152.4 PH/S (chart shows a step up mid-range and a flat line after)
- Temperature: 0.0 °C – 100.0 °C range header, chart around 63 °C
- Avg efficiency: 54.6 J/TH
- Total power: 3,397.1 kW

If the group truly has no (live) miners, the performance section should be empty. If the group does have miners, the count header is wrong. Either way the two halves of the page contradict each other, which again points at inconsistent filtering (e.g. telemetry aggregation joining on group membership without excluding soft-deleted miners, while the count/health summary does exclude them).

## Expected behavior

- Groups list and group detail page report the same miner count.
- Soft-deleted miners are consistently excluded from counts, health summaries, and telemetry aggregations.
- A group with 0 miners shows empty/em-dash performance metrics, not stale aggregates.

## Areas to check

- Group miner count queries used by the groups list vs. the group detail summary (soft-delete filter parity).
- Group telemetry aggregation paths (hashrate/temperature/efficiency/power), including the raw and hourly aggregation queries, for missing soft-delete or membership filters.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the groups list and group detail summary queries, then compare their soft-delete and membership filters. Inspect the raw and hourly group telemetry aggregation paths for the same filter parity; done means both surfaces agree on live miner counts and a group with zero miners shows empty performance metrics.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, data, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.