Skip to content

Donation: Activity entries and an attention item when the project endpoint stays down #3735

Open

Description

@pithead-developer

What's the problem

Part of #2476. Owner priority (2026-10-27): build the opt-in donation feature now, shipping dark. The lean Overview carries "Activity, the newest 10 entries of one list of mining events, settings changes with results, and sign-ins" and an attention list that links to the place that fixes each item (#3566 section C and rule A6). Nothing in the donation work feeds either, and two events matter to an operator:

  • A change to the donation setting. Settings changes already reach the durable audit table: the control log is mirrored into audit_events by service/data_audit.py:147 and service/mining_store.py:108-165, and the poll loop calls it at service/data_service.py:181-186. What is missing is a plain-words label, so the entry does not read as a raw key such as donation.enabled. A donation switched on or off is the kind of change an operator wants to see even if a compromised dashboard made it (the owner has an open decision on a stronger alert; this issue builds the Activity entry only).
  • The endpoint stopping. The controller will record a fallback and endpoint_down_since (End a project slice early and restore the P2Pool route when the endpoint or dashboard fails #3704, Record donation slices and serve a donation block on the state API #3697), but nothing writes an event or raises an attention item when the endpoint has been unreachable for a long time.

Build, in a new module under service/donation/ plus the Overview components:

  • Activity labels: "Project donation turned on at 2 percent", "Project donation turned off", "Project donation changed from 2 to 5 percent", derived from the audit entries for the donation.* keys.
  • Two events written through StateManager.add_event (service/storage_service.py:309) when the status enters and leaves fallback: "Project donation paused: the endpoint is not accepting connections" and "Project donation resumed".
  • An attention item when endpoint_down_since is older than 24 hours: "Project donation has been paused for more than a day because the endpoint is unreachable", linking to the settings section (Donation: settings section in Advanced › Earnings with status, cost and where it goes #3733). It clears on recovery and when the donation is turned off.

What it impacts

The Overview page's Activity list and attention list, for operators with the donation on. With the feature off or unavailable nothing is written and nothing is shown.

How I found it

Read-only scan of origin/develop-v2.1.0 at 02852bd on 2026-10-27 from the paths above and #3566 section C. Nothing was executed. Unknown: how #2515 builds the attention list and the Activity list (not merged), so the label and item are specified by text and trigger, and the backend part by function; whether the existing audit entry carries the old and new percentage for the "changed from 2 to 5" sentence (if not, the sentence says only "changed to 5 percent").

How important is it

Low-medium. It makes the setting's changes and failure visible; the UI half is blocked on the Overview page.

Acceptance criteria

  • Backend tests (dashboard/tests/service/donation/): each donation.* audit entry maps to its sentence; unrelated keys are unchanged; entering and leaving fallback writes exactly one event each; no event is written when the feature is off.
  • A test with a fake clock shows the attention item appears at 24 hours of endpoint_down_since and not before, and clears on recovery and on disable.
  • Frontend tests with fixtures render the three Activity sentences and the attention item with its deep link to the settings section.
  • A Playwright check at 375 px and desktop for the attention item and one Activity row.
  • docs/dashboard.md Overview section mentions the entries; no old-UI file is edited; no explanatory code comments.
  • make test, make test-frontend, make test-patch-coverage (90 % of changed lines) and make lint-file-budget pass.

Possible solutions

  • Map the audit entries to sentences in a small backend module and let the Overview render the strings (recommended: one source of wording).
  • Map in the frontend only: no backend change, and every client that reads the audit rows needs the same table.
  • Also send a Telegram message on every change: a new notification event with its own toggle across the config, render and gate lists; left to the owner's open decision.

Part of #2476. Depends on #3697, #3704, #3733 and on #2515.

Activity

  1. added this to the v2.1.0 milestone on Oct 27, 2026
  2. added
    enhancement
    dashboard
    on Oct 27, 2026
  3. added
    blocked
    on Oct 27, 2026
  4. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #2515.
    Blocked on #3697.
    Blocked on #3704.
    Blocked on #3733.

    Dependency marker for the dashboard. The native blocked-by links on this issue already name these open blockers, and the tick removes blocked when every one of them closes.

  5. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Release regroom (owner request, 2026-11-27): moved from v2.1.0 to v2.1.3. Donation UI follows the dark-released backend (2.0.7/2.0.8) and the Advanced pages; second UI chunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockeddashboardenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions