Commit 9bcdf81
committed
dash: wire the embedded arm so --run can actually take it (#738)
The daemonless embedded template stack (SML/quorum CCbTx, DKG-window
serving, BLS-verified commitments, superblock/credit-pool/payee guards)
is merged and soak-proven, but no released --run invocation could reach
it. Taking the embedded arm needs TWO independent conditions:
(1) the work-source arm gate -- DASHWorkSource only consults the
embedded bundle when `is_testnet_ || embedded_mainnet_`
(work_source.cpp get_work / resource_template_now);
(2) a live coin-state FEED -- NodeCoinState::populated() only flips
when CoinStateMaintainer publishes a tip, and the maintainer +
header chain + 6 ingest legs are constructed ONLY inside
main_dash's `if (coin_p2p)` block.
No single flag satisfied both. --embedded-mainnet armed (1) only, so
the bundle was never fed and populated() stayed false forever;
--coin-p2p-connect/--coin-p2p-discover armed (2) only. On top of that
--embedded-mainnet was absent from --help entirely, so the undocumented
combination was undiscoverable. Net effect: 100% of released --run
templates came off the dashd fallback and the whole daemonless stack
was unreachable scaffolding.
resolve_embedded_arm() (arm_resolution.hpp) makes the decision once, as
one pure function, with a strictly ONE-WAY implication:
embedded opt-in => coin-state feed (new -- this is the wiring)
coin-state feed => embedded opt-in (never -- explicitly not)
So --embedded-mainnet now arms both halves end to end (seed-based
discovery when no peer is pinned), while a transport flag still cannot
move the arm.
REWARD SAFETY (this node class runs a live production mining hotel, and
there is a documented incident where --coin-p2p-connect activated an
unguarded embedded arm on a live node):
* a default --run resolves arm=dashd-fallback, unchanged;
* --coin-p2p-connect alone resolves arm=dashd-fallback, unchanged --
it brings up the transport and nothing else;
* both are pinned by tests, including an exhaustive sweep of the
un-opted-in mainnet argv quadrant;
* verified empirically: normalized run-log diff of the pre-change vs
post-change binary for both invocations differs ONLY by the two
added diagnostic lines.
Also: --embedded-mainnet documented in --help, and a startup line that
names the resolved arm plus the reason, so the arm is field-checkable
instead of inferred.
Tests fold into the existing allowlisted test_dash_stratum_work_source
target (no new add_executable -> no NOT_BUILT sentinel); the allowlist
drift-guard passes.1 parent d7b5013 commit 9bcdf81
3 files changed
Lines changed: 385 additions & 10 deletions
File tree
- src
- c2pool
- impl/dash/coin
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | | - | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
| |||
1148 | 1158 | | |
1149 | 1159 | | |
1150 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1151 | 1188 | | |
1152 | 1189 | | |
1153 | 1190 | | |
| |||
1168 | 1205 | | |
1169 | 1206 | | |
1170 | 1207 | | |
1171 | | - | |
| 1208 | + | |
1172 | 1209 | | |
1173 | 1210 | | |
1174 | 1211 | | |
| |||
1185 | 1222 | | |
1186 | 1223 | | |
1187 | 1224 | | |
1188 | | - | |
| 1225 | + | |
1189 | 1226 | | |
1190 | 1227 | | |
1191 | 1228 | | |
| |||
1272 | 1309 | | |
1273 | 1310 | | |
1274 | 1311 | | |
1275 | | - | |
1276 | | - | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1277 | 1317 | | |
1278 | 1318 | | |
1279 | 1319 | | |
| |||
2403 | 2443 | | |
2404 | 2444 | | |
2405 | 2445 | | |
2406 | | - | |
| 2446 | + | |
2407 | 2447 | | |
2408 | 2448 | | |
2409 | 2449 | | |
| |||
2561 | 2601 | | |
2562 | 2602 | | |
2563 | 2603 | | |
2564 | | - | |
| 2604 | + | |
2565 | 2605 | | |
2566 | 2606 | | |
2567 | 2607 | | |
2568 | 2608 | | |
2569 | 2609 | | |
2570 | 2610 | | |
2571 | | - | |
| 2611 | + | |
2572 | 2612 | | |
2573 | 2613 | | |
2574 | 2614 | | |
| |||
2584 | 2624 | | |
2585 | 2625 | | |
2586 | 2626 | | |
2587 | | - | |
| 2627 | + | |
2588 | 2628 | | |
2589 | 2629 | | |
2590 | 2630 | | |
| |||
2750 | 2790 | | |
2751 | 2791 | | |
2752 | 2792 | | |
2753 | | - | |
| 2793 | + | |
2754 | 2794 | | |
2755 | 2795 | | |
2756 | 2796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
0 commit comments