Commit dc9d581
committed
Dash Phase C-PAY: account for DIP-0027 platform reward in MN payment
Live-discovered 2026-05-14 on .41 PAY soak: [MN-PAY] MISMATCH at every
post-MN_RR block with constant diff=-49,787,579 sat. Tracked to block
2,470,904 having three coinbase outputs: 49,787,579 OP_RETURN (platform
credit pool burn) + 83,056,309 MN payee + 44,281,297 miner. Total =
177,125,185 = subsidy(177,022,505) + fees(102,680).
c2pool was using the pre-DIP-0027 formula `expected = block_value × 3/4`
which assumes the MN gets 75% of (subsidy + fees). Real chain (post both
V20 h=1,987,776 AND MN_RR h=2,128,896) burns 9/32 of subsidy at L1 to
mint Platform credit at L2, with the burn coming entirely from the MN's
portion — miner share unchanged.
Mirror dashcore PlatformShare() at masternode/payments.cpp:28-58:
mn_subsidy_share = subsidy × 3/4
platform_reward = mn_subsidy_share × 375/1000 (= 9/32 of subsidy)
mn_payment -= platform_reward
The integer-truncation order matters; 9/32 alone isn't bit-exact.
Three sites updated:
- subsidy.hpp: add DASH_MN_RR_HEIGHT_MAINNET + helper, dashcore order
- main_dash.cpp [MN-PAY] check: subtract platform from expected
- embedded_gbt.hpp: subtract from MN payment + emit OP_RETURN entry
FIRST in m_packed_payments (matches dashcore vout ordering)
The third site is consensus-critical for the future embedded-as-primary
cutover; without it every template c2pool builds would be rejected by
mainnet. Currently [GBT-XCHECK] would mismatch on every post-MN_RR block;
this commit also fixes that.
3 new tests pin the formula bit-exact against block 2,470,904.1 parent c00e87c commit dc9d581
4 files changed
Lines changed: 84 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
77 | 93 | | |
78 | 94 | | |
79 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2779 | 2779 | | |
2780 | 2780 | | |
2781 | 2781 | | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
2782 | 2785 | | |
2783 | 2786 | | |
2784 | | - | |
| 2787 | + | |
2785 | 2788 | | |
2786 | 2789 | | |
2787 | 2790 | | |
2788 | 2791 | | |
2789 | 2792 | | |
2790 | | - | |
| 2793 | + | |
2791 | 2794 | | |
2792 | 2795 | | |
2793 | 2796 | | |
2794 | 2797 | | |
2795 | 2798 | | |
2796 | 2799 | | |
2797 | | - | |
| 2800 | + | |
2798 | 2801 | | |
2799 | 2802 | | |
2800 | 2803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
84 | 85 | | |
85 | 86 | | |
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 | + | |
0 commit comments