Commit 8d39fad
committed
doge: correct submitblock/submitauxblock reward accounting (#744)
Re-audit (Fable review of the prior revision) showed submitauxblock is NOT a
viable fallback for a PPLNS merged block: DOGE ships multiaddress=true and
rebuild_cached_blocks commits current_work.block_hash to c2pool's self-built
PPLNS block hash, which dogecoind's AuxpowMiner never minted via createauxblock,
so submitauxblock of it is always rejected -- and the daemon's own template pays
its aux address, violating the trustless merged-payout invariant. The viable
DOGE dual-path is full-block submitblock (ARM B) + the independent embedded P2P
relay (ARM A), which master already wires; there is no aux fallback to add.
This revision drops the misguided aux-fallback wiring and instead fixes the
genuine latent reward-accounting bugs it surfaced:
- try_submit_merged_blocks: keep the P2P relay UNCONDITIONAL (fires even when the
local submitblock is rejected -- it is an independent arm that can still land
the block via peers). Documented why submitauxblock is not a valid fallback.
- AuxChainRPC::submit_block: BIP22 -- a submitblock REJECTION is a non-null
string RESULT, not a JSON-RPC error, so the old 'return true unless throw'
mis-recorded a rejected block as WON. Inspect the result: null => accepted,
duplicate/inconclusive => accepted, any other non-null string => rejected.
- AuxChainRPC::submit_aux_block: honor the BOOLEAN result (true=accept,
false=reject) instead of assuming success on no-throw (latent; no run-path
caller today, corrected for safety).
Broadcast/RPC-result path only -- no PoW, share format, aux commitment, or PPLNS
math touched (consensus-neutral). Builds clean (c2pool_merged_mining +
c2pool-ltc).1 parent c4bd8ef commit 8d39fad
1 file changed
Lines changed: 56 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
448 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
449 | 471 | | |
450 | 472 | | |
451 | 473 | | |
| |||
455 | 477 | | |
456 | 478 | | |
457 | 479 | | |
458 | | - | |
459 | | - | |
460 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
461 | 496 | | |
462 | 497 | | |
463 | 498 | | |
| |||
1027 | 1062 | | |
1028 | 1063 | | |
1029 | 1064 | | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1030 | 1080 | | |
1031 | 1081 | | |
1032 | 1082 | | |
| |||
0 commit comments