Commit 4a2fe3e
committed
dgb: wire runtime min-protocol 95%-ratchet into the per-best-share loop (#602 follow-on)
Wires the pure ratchet dgb::ratchet_min_protocol_version (#602) into the node
runtime, the SUT equivalent of oracle p2pool-dgb-scrypt main.py:213-216 +
data.py:857 update_min_protocol_version. On each best-share advance (the three
m_best_share_hash update sites under m_tracker_mutex) NodeImpl::apply_min_protocol_ratchet
samples the work-weighted desired-version tally over the SAME window the 60%
version-switch gate reads (share_check step 2: [CHAIN_LENGTH*9/10, CHAIN_LENGTH]
behind the best share PARENT) and lifts the inbound P2P accept-floor 1400 -> 3500
once the best share VERSION holds >=95% of that work.
The floor moves from the immutable config value to a latching atomic
m_runtime_min_protocol_version (seeded from PoolConfig::MINIMUM_PROTOCOL_VERSION);
handle_version reads it lock-free, the compute thread publishes via store. Adds
the call-site guard the pure ratchet omits: apply_min_protocol_ratchet_decision
enforces oracle main.py:212 (len(shares) > CHAIN_LENGTH) so a fresh node with a
partial/empty window never spuriously locks the floor to 3500 and rejects every
peer -- the pure fn ratchets on an empty window (dict-branch), the wired decision
must not.
KAT dgb_min_protocol_ratchet_test +5 wiring cases (14 total, all green): short-chain
never-lifts (vs pure-fn ratchets on same weights), short-chain empty-window no-lift,
full-window unanimous lifts, full-window below-95 stays cold, already-at-target
short-circuits. Fenced to src/impl/dgb/; c2pool-dgb links clean (incl -DAUX_DOGE=ON).1 parent c72b493 commit 4a2fe3e
4 files changed
Lines changed: 159 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 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 | + | |
| 158 | + | |
| 159 | + | |
131 | 160 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
314 | 319 | | |
315 | 320 | | |
316 | 321 | | |
317 | | - | |
| 322 | + | |
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
| |||
806 | 811 | | |
807 | 812 | | |
808 | 813 | | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
809 | 866 | | |
810 | 867 | | |
811 | 868 | | |
| |||
1465 | 1522 | | |
1466 | 1523 | | |
1467 | 1524 | | |
| 1525 | + | |
1468 | 1526 | | |
1469 | 1527 | | |
1470 | 1528 | | |
| |||
1843 | 1901 | | |
1844 | 1902 | | |
1845 | 1903 | | |
| 1904 | + | |
1846 | 1905 | | |
1847 | 1906 | | |
1848 | 1907 | | |
| |||
2014 | 2073 | | |
2015 | 2074 | | |
2016 | 2075 | | |
| 2076 | + | |
2017 | 2077 | | |
2018 | 2078 | | |
2019 | 2079 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 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 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
0 commit comments