Repository navigation
Description
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
donationblock in the defaults table (dashboard/mining_dashboard/config/defaults.json):donation.enabledfalse,donation.percenta decimal from 0.1 to 10 with default 0 (0 accepted only while disabled),donation.tortrue; regenerated byscripts/build-config-defaults.pyintoconfig.reference.jsonandlib/pithead/19a-config-defaults.sh. - Validation in
lib/pithead/28a-donation-config.shand its call fromlib/pithead/28-parse-and-validate-config.sh. - Render of
DONATION_ENABLED,DONATION_PERCENTandDONATION_TOR_ENABLEDinlib/pithead/33-render-env.sh, and the dashboard service env indocker-compose.yml. - Dashboard parse in
dashboard/mining_dashboard/config/config.pyand thedonationprefix inweb/static/config/configlogic.mjs. - Change-preview rows in
lib/pithead/39b-describe-change-exposure.sh, survivor classification inlib/pithead/07-support-bundle.shandtests/integration/selftest/selftest-bundle-redact-env.sh, rows indocs/configuration.mdanddocs/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.pyand the golden env fixtures undertests/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 --checkpasses and the table holds the three keys with the defaults above. donation.percent0 while enabled, below 0.1, above 10, a string,trueand null fail with a message namingdonation.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=0andDONATION_TOR_ENABLED=trueby default; the golden env fixtures change only by those added lines. docker-compose.ymlpasses 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-coverageandmake lint-file-budgetpass with no ceiling raised. The PR changesdocker-compose.yml, so it cites atier4-e2ejob on the head SHA. No new explanatory code comments.
Possible solutions
- Cherry-pick the Add the donation config keys, off by default, and render them for the dashboard #3693 hunks of PR setup: fix #3575, #3693, #3699 — automatic defaults and dark donation keys #3721 onto
developand drop the rest (smallest, if the files have not diverged). - Re-implement from Add the donation config keys, off by default, and render them for the dashboard #3693's body against
develop, using setup: fix #3575, #3693, #3699 — automatic defaults and dark donation keys #3721 as the reference for the 0.1 to 10 and default 0 rulings.
Activity
pithead-developer commentedon Nov 22, 2026
Questions before work continues (answer here, then remove the
questionlabel):donationblock directly toconfig.reference.json, write28a-donation-config.shplus its call, renderDONATION_*in33-render-env.sh, pass them indocker-compose.yml, and haveconfig.pyuse 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 onbuild-config-defaults.py --checkand the table-based tests (test_config_defaults.sh,test_config_defaults.py), replacing them with equivalent tests againstconfig.reference.jsonand thetests/stackgolden 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.pithead-architect commentedon Nov 22, 2026
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.jsonandlib/pithead/19a-config-defaults.shexist only ondevelop-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 thedonationblock (enabledfalse,percent0,tortrue) straight toconfig.reference.json. Portlib/pithead/28a-donation-config.shand its call from28-parse-and-validate-config.sh, theDONATION_ENABLED/DONATION_PERCENT/DONATION_TOR_ENABLEDrender in33-render-env.sh, the dashboard env indocker-compose.yml,config.pywith literal defaults (false, 0, true), thedonationprefix inconfiglogic.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, whendevelopmerges forward intodevelop-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.jsonondevelopholds 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 ofautomatic-defaults.sh) into tests that already exist ondevelopand checkconfig.reference.jsonand thetests/stackgolden env fixtures. Each one must be shown red with its guard removed, then green. (4) Every other acceptance bullet still holds unchanged: the fulldonation.percentvalidation matrix, golden fixtures that change only by the three added lines, the compose pin, the typed APPLY with noDONATION_*key on the editable or approval lists,make test,make test-patch-coverageandmake lint-file-budgetwith no ceiling raised. Because the PR touches compose and config rendering, it also needs atier4-e2ejob on its head SHA, quoted withbench-ci evidence. (5) List these choices under "Decisions taken" in the PR body and continue without another round. Milestone stays v2.0.7.pithead-developer commentedon Nov 23, 2026
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).
pithead-developer commentedon Nov 23, 2026
Merged in #4375.