Commit c114952
committed
Wire safeTarget store checks in the fork choice test harness so that
the spec-test runner actually validates safe_target behavior end-to-end.
Today the harness explicitly rejects any fixture carrying a \'safeTarget\'
field with "'\safeTarget\' check not supported", and it has no field at all
for the leanSpec #680 schema (safeTargetSlot, safeTargetRootLabel). The
result is that the safe_target semantics shipped in PR #316 have no
fixture-level coverage: regenerated fixtures are silently parsed without
asserting on the field, and any test using the legacy \'safeTarget\' field
errors out instead of validating.
Changes:
- Add safeTargetSlot and safeTargetRootLabel to StoreChecks, mirroring
the latestJustified* / latestFinalized* pattern.
- Replace the rejection branch with the same label-resolution pattern
used for justified/finalized roots, falling back from safeTarget to
safeTargetRootLabel via the step\'s block registry.
- Add validation blocks for safeTargetSlot (against st.safe_target_slot())
and the resolved root (against st.safe_target()).
- Reorganize StoreChecks into logical groups and drop the now-stale
"Unsupported fields (will error if present)" comment, which was
misleading: only safeTarget actually errored, everything else was
validated.
This change is forward-compatible: no current fixture in
leanSpec/fixtures/consensus/ contains any safeTarget* field, so the new
validation paths are dormant until LEAN_SPEC_COMMIT_HASH is bumped to a
revision that includes leanSpec #680.
Verified with cargo fmt --all, cargo clippy --workspace --all-targets
-- -D warnings, and the forkchoice_spectests harness (47 passing
fixtures unchanged). Pre-existing failures from a stale leanSpec
submodule checkout (1 fork-choice fixture, 34 ssz fixtures) reproduce
identically on main and are unrelated to this change.1 parent 507a35c commit c114952
2 files changed
Lines changed: 53 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
333 | 360 | | |
334 | 361 | | |
335 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | 152 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 153 | | |
156 | 154 | | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| |||
0 commit comments