Commit f524643
committed
dgb: M3 §7b wire DigiShield next-target into HeaderChain ingest gate
validate_and_append now enforces the DigiShield-computed next target on the
VALIDATE_SCRYPT path: the declared Scrypt target must EQUAL the next-target
computed over the Scrypt-only retarget window ending at the current tip
(assembled before the header is appended), the nBits-style consensus rule.
A configured HeaderChain(DigiShieldParams, window) arms the gate; a default-
constructed chain leaves target_timespan 0 so digishield_next_target() returns
the 0 sentinel and the gate is a no-op (existing retarget/work-accounting
tests run unconstrained, unchanged). A rejected header never mutates the chain
(size + cumulative work preserved).
+1 ingest-gate test vector (window 1, deterministic 7/8 next-target): wrong
target REJECTED with chain unchanged, exact target VALIDATED_SCRYPT crediting
work, continuity header bypasses the gate. Added INTO header_chain_test (no new
gtest target -> #143 NOT_BUILT trap avoided). 13/13 PASS, build EXIT=0.1 parent 587d9f1 commit f524643
2 files changed
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
| |||
171 | 182 | | |
172 | 183 | | |
173 | 184 | | |
| 185 | + | |
174 | 186 | | |
175 | 187 | | |
176 | 188 | | |
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
180 | 207 | | |
181 | 208 | | |
182 | 209 | | |
| 210 | + | |
183 | 211 | | |
184 | 212 | | |
185 | 213 | | |
| |||
237 | 265 | | |
238 | 266 | | |
239 | 267 | | |
| 268 | + | |
| 269 | + | |
240 | 270 | | |
241 | 271 | | |
242 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 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 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
0 commit comments