Repository navigation
Description
What's the problem
There is no single read path for system events. Payouts, shares, blocks, raffle wins and settings changes each live in their own table. On develop-v2.1.0, build_mining_activity (dashboard/mining_dashboard/web/views/overview_views.py:72) merges some of them, for Overview only. The Event log view and the Overview Activity list need one endpoint that returns stored events and those existing rows together, each exactly once.
What it impacts
#4435 (Event log view) and the Overview switch child read this endpoint. History from before the upgrade shows up only if the existing tables are merged at read time.
How I found it
Split from #4432; the endpoint contract and merge rules are its acceptance criteria. No new reading was done for this split.
How important is it
Medium; every reader of the Event log waits on it. Size M.
Acceptance criteria
-
GET /api/eventsacceptsrange(day, week, month or all), one or morelabelparameters and an optionalseverityof error, and returns{entries, counts}.rangeis the only time control, with no from/to. - At most 500 entries, newest first, each with id, ts, end_ts, count, label, severity and text.
countshas one figure per label for the selected range. - Existing rows appear through a read merge, with the same fixed templates, and are not copied into
event_log:payouts: one entry per saved payout, "Payout received: XMR reached your wallet" (or XTM), label Payouts;sharesandblocks: label Shares and blocks;raffle_wins: label XvB;audit_events: label Settings, in plain words with no raw keys.
- One saved payout gives exactly one entry; a test proves it.
- Legacy
hashrate_lossandhashrate_recoveredrows fromeventsare shown under the System label at read time. - Settings entries are returned only where and to whom
/api/auditis available today; a test covers both cases. - The forbidden-value test from the store child is repeated against the response body.
- Endpoint tests cover each label, several labels at once, the error filter, each range, an empty result and the 500 cap.
-
docs/dashboard.mddocuments the endpoint and the labels. -
make test,make test-patch-coverageandmake lint-file-budgetpass.
Possible solutions
- A read merge over
event_logand the existing tables (recommended in Event log: durable store and read endpoint with labels, severity and error episodes #4432), so nothing is written twice. - Do the merge and the cap in the storage layer so the route stays thin.
Parent requirement: #4432
Worker brief: Parent pithead#4432. Starts after the event_log store child merges. It does not need the episodes child: end_ts and count are plain columns. The PR targets develop-v2.1.0.
Build the route and the read merge only. Do not change the Overview page (sibling child) and do not build the Event log view (pithead#4435).
Reuse the store child's templates for merged rows, so the text is identical wherever an entry comes from.
The audit gate must mirror /api/audit exactly: find that route's check and call the same function; do not re-implement it.
Ids for merged rows must be stable and must not collide with event_log ids (for example, prefix by source).
Compute counts over the whole selected range, not just the 500 returned.
Proof tier: route tests under make test. No bench job.
Activity
pithead-developer commentedon Nov 26, 2026
Blocked on #4508. Blocked on pithead#4508 (Event log store: event_log table, record_event helper, fixed templates and retention), whose PR #4541 is open and mergeable against develop-v2.1.0 but not yet merged. This issue's worker brief says it "Starts after the event_log store child merges" and must "Reuse the store child's templates for merged rows": the GET /api/events read path queries the event_log table (id, ts, end_ts, count, label, severity, text) and re-emits the store child's fixed templates verbatim, and none of that exists on develop-v2.1.0 yet (rg finds no event_log or record_event anywhere in the dashboard code). Writing the route now would import a table and templates that only exist on PR #4541's unmerged branch, so nothing here can be implemented or tested at the current base. Finished so far: full read of the issue, brief, parent #4432 and siblings; confirmed #4541 is the only store implementation in flight, no /api/events route exists, and no prior branch/PR for #4510 needs resuming. Unblocks when #4541 merges (or the work otherwise lands on develop-v2.1.0) and #4508 closes — the runner should resume this session then; #4508 itself is currently parked on a transient bench_outage condition, not on another issue. Nothing was edited or pushed; the claim branch is untouched at origin/develop-v2.1.0.
The runner resumes this issue when that one closes.