Repository navigation
Description
What's the problem
The dashboard has no store for system events that carry a label and a severity. The events table (ts, type, detail, no id) is a chart-marker store held in memory and sent in chart.events, so it cannot hold entries that are updated later and should not grow with non-chart rows.
What it impacts
First piece of the Event log (#4431). The episodes child, the read endpoint child, #4433, #4434, #4435 and #3735 all write to or read from this store.
How I found it
Split from #4432, which read develop-v2.1.0 at bfd061f: storage_schema.py (the events table), service/storage_service.py:309 (add_event), config/config.py:535 (HISTORY_RETENTION_SEC, 30 days). No new reading was done for this split.
How important is it
Medium; it is the foundation the other Event log pieces wait on. Size M.
Acceptance criteria
- A new
event_logtable, separate fromevents, with columns id, ts, end_ts, count, kind, subject, label, severity (info, warning or error) and text. - Producers call one helper,
record_event(kind, subject, label, severity, text_template, slots). - Entry text comes only from fixed sentence templates. Payout text may state the chain and the amount.
- A test feeds each forbidden kind of value through
record_eventand asserts none appears in the stored text:- a wallet or onion address, view key, password or token;
- a transaction id, IP address, user name or rig hostname;
- a raw exception class name, raw config key or URL.
-
add_eventkeeps feeding the chart unchanged; a test asserts thechart.eventspayload is the same before and after. - At most one new row per (kind, subject) per minute; a second call inside the minute increments
counton the existing row. - Retention is 30 days (
HISTORY_RETENTION_SEC) or 5,000 rows, whichever comes first, oldest first. A test inserts 20,000 events in one minute, then asserts at most 5,000 rows and that the last hour's error entries are still present. - No existing table's rows are copied into
event_log. -
make test,make test-patch-coverageandmake lint-file-budgetpass.
Possible solutions
- A new table plus a helper in the storage service (recommended in Event log: durable store and read endpoint with labels, severity and error episodes #4432).
- Not chosen there: extending
events, which has no id and is loaded into the chart payload.
Parent requirement: #4432
Worker brief: Parent pithead#4432 (tracker pithead#4431). The PR targets develop-v2.1.0.
Build only the write side: schema, record_event, the template table, the per-minute limit and retention. No episodes and no HTTP route (sibling children), and no UI. Leave end_ts and count usable by the episodes child.
Templates are the privacy boundary. Slots must be typed or allow-listed so a caller cannot pass free text through. Write the forbidden-value test first.
"A second call inside the minute increments count" is the product owner's reading of the parent's rate limit. If #4432 or its comments say otherwise, follow the issue and say so in the PR.
Proof tier: unit tests under make test with the suite's fake clock. No bench job is needed, because nothing on a box changes until a producer calls the helper.
Watch the file-budget lint; put the new code in its own module if the storage service is near its limit.
Activity
pithead-developer commentedon Nov 26, 2026
Waiting on a transient bench_outage condition, not on another issue. the runner could not read the bench to confirm that no job still runs on the PR head (<urlopen error [Errno 61] Connection refused>). The runner re-checks it (first at 2026-11-26T23:33Z, at most 5 times).
pithead-developer commentedon Nov 29, 2026
Blocked on #4502. PR #4541 is blocked on pithead#4502, the operator's forward merge into develop-v2.1.0. The only failing required check at head 1b926fd is Build image (dashboard); adversarial-review is also red. The libzstd1 CVE behind the Build image failure (#4537) was fixed by #4604 on develop, but that fix is not an ancestor of origin/develop-v2.1.0. The base is 0 commits ahead of this branch, so there is nothing to merge in yet. This PR changes no image input, and I will not add a .trivyignore entry. Finished and unchanged: the event_log store, 47 unit tests, and a clean verifier and security-reviewer pass. Every other check is green and no bench job applies (dashboard-logic row). I posted this explanation on the PR. Once #4502 lands the fix on the base, merge the base in without rebasing, push, and re-check.
The runner resumes this issue when that one closes.