Skip to content

Forward-port the donation config keys (#3693) to develop #4309

Done

Description

@pithead-architect

What's the problem

Part of #2476. Owner ruling, 2026-11-20: "we can dark release it ahead so we can spot issues in logs before making a proper ui for it". The donation backend is therefore planned for v2.0.7 and v2.0.8 on develop. Its first piece, the donation config keys (#3693), was closed by PR #3721, which merged only into develop-v2.1.0. develop has no donation block, so every backend child binds to config names that do not exist there.

Port to develop the part of PR #3721 that covers #3693, and nothing else of that PR (the automatic-defaults and pool-tier work stays out):

  • The donation block in the defaults table (dashboard/mining_dashboard/config/defaults.json): donation.enabled false, donation.percent a decimal from 0.1 to 10 with default 0 (0 accepted only while disabled), donation.tor true; regenerated by scripts/build-config-defaults.py into config.reference.json and lib/pithead/19a-config-defaults.sh.
  • Validation in lib/pithead/28a-donation-config.sh and its call from lib/pithead/28-parse-and-validate-config.sh.
  • Render of DONATION_ENABLED, DONATION_PERCENT and DONATION_TOR_ENABLED in lib/pithead/33-render-env.sh, and the dashboard service env in docker-compose.yml.
  • Dashboard parse in dashboard/mining_dashboard/config/config.py and the donation prefix in web/static/config/configlogic.mjs.
  • Change-preview rows in lib/pithead/39b-describe-change-exposure.sh, survivor classification in lib/pithead/07-support-bundle.sh and tests/integration/selftest/selftest-bundle-redact-env.sh, rows in docs/configuration.md and docs/donation.md.
  • The tests that pin them: tests/stack/config/automatic-defaults.sh (donation rows), tests/stack/standalone/test_config_defaults.sh, tests/stack/standalone/test_compose.sh, tests/stack/control/control-sensitive-preview.sh, dashboard/tests/web/test_config_defaults.py, dashboard/tests/service/test_control_service.py and the golden env fixtures under tests/stack/fixtures/config-2.0.0/.
  • The typed APPLY gate stays as ruled: DONATION_* is on neither the dashboard-editable nor the approval key list.

What it impacts

Every donation backend issue on develop: #3694, #3695, #3697, #3702 and #3703 are blocked by this one. Existing installs: additive only, off by default, no key rewritten. The config editor gains the three fields and the support bundle shows the three values.

How I found it

Grooming on 2026-11-20 after the owner ruling above. #3693 shows closed, its milestone is v2.1.0, and PR #3721 merged into develop-v2.1.0 on 2026-11-10; the forward-port is not recorded anywhere else. Unknown: whether #3721's later hunks on the same files (automatic defaults, #3575) make a clean cherry-pick impossible; the port may need to be hand-extracted.

How important is it

High for the donation lane: nothing else in it can start on develop until this lands. Low risk: additive and off by default.

Acceptance criteria

  • On develop, python3 scripts/build-config-defaults.py --check passes and the table holds the three keys with the defaults above.
  • donation.percent 0 while enabled, below 0.1, above 10, a string, true and null fail with a message naming donation.percent; 0.1, 0.25, 2.5 and 1 to 10 pass; 0 passes only while disabled.
  • Every setup path renders DONATION_ENABLED=false, DONATION_PERCENT=0 and DONATION_TOR_ENABLED=true by default; the golden env fixtures change only by those added lines.
  • docker-compose.yml passes the three values to the dashboard and a compose test pins them; the dashboard config exposes them.
  • Enabling donation needs the typed APPLY, and no DONATION_* key is on the editable or approval lists.
  • make test, make test-patch-coverage and make lint-file-budget pass with no ceiling raised. The PR changes docker-compose.yml, so it cites a tier4-e2e job on the head SHA. No new explanatory code comments.

Possible solutions

Activity

  1. added this to the v2.0.7 milestone on Nov 20, 2026
  2. added
    enhancement
    dashboard
    setup
    on Nov 20, 2026
  3. pithead-developer commented on Nov 22, 2026

    @pithead-developer
    Contributor

    Questions before work continues (answer here, then remove the question label):

    1. The defaults-table machinery (Unify setup defaults while preserving existing configurations #3589/Add coordinated privacy profiles and Tor-only inbound peering #3632 hunks) is absent from develop, so should I port the donation keys without it? Default: yes. Add the donation block directly to config.reference.json, write 28a-donation-config.sh plus its call, render DONATION_* in 33-render-env.sh, pass them in docker-compose.yml, and have config.py use literal defaults (false, 0, true). Also port the 39b/07/selftest/configlogic.mjs/docs hunks and tests. Reason: porting Unify setup defaults while preserving existing configurations #3589 and Add coordinated privacy profiles and Tor-only inbound peering #3632 is a much larger change that the issue explicitly excludes, and it would pull in the automatic-defaults work. 2) If yes to 1, may I drop the acceptance bullet on build-config-defaults.py --check and the table-based tests (test_config_defaults.sh, test_config_defaults.py), replacing them with equivalent tests against config.reference.json and the tests/stack golden fixtures? Default: yes, since the script does not exist on develop. 3) Or should the defaults-table infra be forward-ported first as its own issue, with this one blocked on it? Default: no, because it delays the donation lane the owner wants dark-released in v2.0.7/v2.0.8 and the table is not needed for the three keys to work.
  4. added
    question
    on Nov 22, 2026
  5. pithead-architect commented on Nov 22, 2026

    @pithead-architect
    Author

    Ruling: Take defaults 1 and 2, decline 3. The table code is not on develop: scripts/build-config-defaults.py, dashboard/mining_dashboard/config/defaults.json and lib/pithead/19a-config-defaults.sh exist only on develop-v2.1.0, where #3589 and #3632 merged as v2.1.0 work. This issue keeps the automatic-defaults work out, so porting the table here would break the issue's own scope. Do this, in order: (1) Add the donation block (enabled false, percent 0, tor true) straight to config.reference.json. Port lib/pithead/28a-donation-config.sh and its call from 28-parse-and-validate-config.sh, the DONATION_ENABLED/DONATION_PERCENT/DONATION_TOR_ENABLED render in 33-render-env.sh, the dashboard env in docker-compose.yml, config.py with literal defaults (false, 0, true), the donation prefix in configlogic.mjs, and the 39b, 07, selftest-redact and docs hunks. (2) Keep the key names, env names, file names and validation messages exactly as they are in PR #3721. Then, when develop merges forward into develop-v2.1.0, the conflict resolves by taking the v2.1.0 side and no second spelling appears. (3) Acceptance bullet 1 becomes: "config.reference.json on develop holds the three keys with the defaults above, and a test pins them." Put the table-based checks (test_config_defaults.sh, test_config_defaults.py, the donation rows of automatic-defaults.sh) into tests that already exist on develop and check config.reference.json and the tests/stack golden env fixtures. Each one must be shown red with its guard removed, then green. (4) Every other acceptance bullet still holds unchanged: the full donation.percent validation matrix, golden fixtures that change only by the three added lines, the compose pin, the typed APPLY with no DONATION_* key on the editable or approval lists, make test, make test-patch-coverage and make lint-file-budget with no ceiling raised. Because the PR touches compose and config rendering, it also needs a tier4-e2e job on its head SHA, quoted with bench-ci evidence. (5) List these choices under "Decisions taken" in the PR body and continue without another round. Milestone stays v2.0.7.

  6. removed
    question
    on Nov 22, 2026
  7. pithead-developer commented on Nov 23, 2026

    @pithead-developer
    Contributor

    Waiting on a transient release_hold condition, not on another issue. tier4-e2e 1057@6ca95ffcda5a474a5bdd01dc187b349efd802f8e cancelled by client request: operator: owner cleared bench-ci to prioritize the 2.0.4 release gate; resubmit after the gate. The runner re-checks it (first at 2026-11-23T08:36Z, then every 240 minutes until the release e2e queue drains).

  8. pithead-developer commented on Nov 23, 2026

    @pithead-developer
    Contributor

    Merged in #4375.

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

    dashboardenhancementsetup

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions