Commit 974c3dc
committed
dgb: rescope to the reachable readvertise path; label broadcast_share pre-wiring
A caller-side reachability trace shows DGB is not symmetric with btc/bch:
main_dgb.cpp binds no create/mint-share fn, so dgb::NodeImpl::broadcast_share
and notify_local_share have zero callers repo-wide -- DGB never mints a local
share today (#884). DGB's live path into send_shares is readvertise_best_share()
(ROOT-2 re-advert on best-change plus a 10s one-shot timer), which re-pushes
PEER-RECEIVED shares and deliberately bypasses the de-dup set.
Verified independently: set_mint_share_fn / set_create_share_fn / broadcast_share
/ notify_local_share have zero occurrences in main_dgb.cpp; the only
set_mint_share_fn binding in the tree is main_dash.cpp:1854 plus dgb's own
work_source_test. readvertise_best_share is called from node.cpp:1767 and 1774.
BTC (main_btc.cpp:1336 after lk.unlock() at :1323) and BCH
(pool_entrypoint.hpp:564 after lk.unlock() at :562) are both live and unchanged.
Changes:
- dgb: extract the readvertise recording rule into readvertise_and_record() and
wire readvertise_best_share() through it. This is DGB's live reward-critical
marking discipline: m_last_broadcast_to is what a peer disconnect within 10s
converts into m_rejected_share_hashes, and the readvertise walk `continue`s
past rejected hashes permanently. Recording the OFFERED batch would let a
share the F3 gate merely withheld be blamed for someone else's drop and
excluded from every future re-advert -- a propagation loss for the whole
sharechain, since DGB re-advertises peer-received shares.
- dgb: rescope the KATs onto that live path. The gate cases (partition_backable)
and the new DgbReadvertiseRecording cases drive code production executes; the
broadcast_and_mark cases are renamed
DgbBroadcastMarkingPrewired_NotReachedToday so no reader mistakes them for
live protection. Removes the broadcast_share de-dup-walk KAT, which modelled
an unreachable function -- the shape of the LTC #873 miss.
- dgb: label NodeImpl::broadcast_share in source as pre-wiring for #884. The F2
fix stays so the seam is correct when the mint path is bound and so the three
coins remain symmetric, but it protects nothing at runtime today.
- btc/bch: document the ROOT-2 interaction at readvertise_best(). Marking is now
a strict subset of what the pre-fix code marked, so the walk breaks later or
in the same place, never earlier: the re-advert re-pushes a superset of what
it used to. Monotonically better, strictly better for head shares minted while
no peer was connected. It does not fully close ROOT-2 here -- shares already
accepted by another peer stay marked and the walk still breaks, as before.
That needs the ltc/dgb-style de-dup-bypass readvertise; pre-existing, out of
scope. No behaviour change in this commit for btc/bch.
Mutation-verified red on the DGB live path: recording the offered batch instead
of what was written reddens WithheldShareIsNeverBlamedForAPeerDrop; dropping the
empty-send skip reddens PeerThatReceivedNothingIsNotRecorded; deleting the gate
reddens 2 DgbBroadcastGate cases.1 parent e6f3344 commit 974c3dc
5 files changed
Lines changed: 234 additions & 107 deletions
File tree
- src/impl
- bch
- btc
- dgb
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1053 | 1053 | | |
1054 | 1054 | | |
1055 | 1055 | | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1056 | 1070 | | |
1057 | 1071 | | |
1058 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1138 | 1152 | | |
1139 | 1153 | | |
1140 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
| |||
178 | 194 | | |
179 | 195 | | |
180 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
181 | 231 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
839 | 845 | | |
840 | 846 | | |
841 | 847 | | |
| |||
1111 | 1117 | | |
1112 | 1118 | | |
1113 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1114 | 1126 | | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1122 | 1131 | | |
1123 | | - | |
| 1132 | + | |
1124 | 1133 | | |
1125 | 1134 | | |
1126 | 1135 | | |
| |||
0 commit comments