Commit 57109ce
authored
* dgb(#82): faithful as_block FRAMING half — share->block reassembly
Port the FRAMING half of p2pool data.py Share.as_block into
src/impl/dgb/coin/block_assembly.hpp: reconstruct the full block header
merkle_root from the gentx hash walked up the share merkle_link (the
SmallBlockHeader stored on a share omits merkle_root), then frame the
block txs as [gentx] ++ other_txs (coinbase at index 0) and serialize
through the live BlockType codec NodeRPC::submit_block already uses, so
the reconstructed block round-trips and a daemon accepts it byte-for-byte.
gentx bytes + known_txs lookup stay INJECTED (the gentx-byte build that
hits coinbase-byte adjudication is the next reconstructor slice); this
pins the framing + merkle_root math now. dgb_block_assembly_test: 5 KATs
(empty-branch root==gentx_hash, index-bit side select, coinbase-first
round-trip, coinbase-only) registered in BOTH test/CMakeLists.txt and the
build.yml --target allowlist. Per-coin isolation: src/impl/dgb/ only;
p2pool-merged-v36 surface: none.
* dgb(#82): assert won-block witness predicate (is_segwit_activated gate)
Add two KATs to block_assembly_test proving the won-block witness shape is
governed by whether the gentx carries a witness (i.e. is_segwit_activated at
gentx-build time), not by an unconditional witness branch in the framer:
* SegwitGentxEmitsWitnessBlock: a gentx carrying the BIP141 coinbase witness
reserved value => TX_WITH_WITNESS block (strictly larger than legacy, marker
emitted, reserved value round-trips). DGB SEGWIT_ACTIVATION_VERSION=35.
* LegacyGentxEmitsLegacyBlock: a no-witness gentx => legacy block, no
marker/flag, byte-stable re-serialization (the BCH is_segwit_activated()==0
shape the companion bch test asserts).
block_assembly.hpp: correct the wire-encoding comment from unconditional
(TX_WITH_WITNESS) to the conditional TX_WITH_WITNESS(m_txs) Bitcoin-Core codec.
src/impl/dgb/ only; no p2pool-merged-v36 surface; same dgb_block_assembly_test
target already in test/CMakeLists.txt + both build.yml allowlists.
---------
Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
1 parent d0a23d5 commit 57109ce
4 files changed
Lines changed: 433 additions & 2 deletions
File tree
- .github/workflows
- src/impl/dgb
- coin
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
20 | 35 | | |
21 | 36 | | |
22 | 37 | | |
| |||
0 commit comments