Commit 94f54b1
refactor(ssz): collapse identical hash_tree_root leaf handlers (leanEthereum#1037)
* refactor(ssz): collapse identical hash_tree_root leaf handlers
Four singledispatch handlers for hash_tree_root had byte-identical
bodies: the ones for unsigned integers, booleans, field elements, and
fixed-size byte vectors all merkleized the packed encoded bytes.
Collapse them into one handler registered against all four base types
with stacked explicit registrations. Dispatch precedence is unchanged:
the fixed byte-vector base is a subclass of the bytes builtin, so its
instances still resolve to the new handler while plain bytes,
bytearray, and memoryview keep their distinct handlers. The byte-list,
bitvector, bitlist, vector, list, and container handlers are untouched
because their bodies differ.
Verified with just check (lint, format, types, spell, mdformat) and
uv run fill --fork=lstar --clean -n auto: 539 vectors pass and the
cross-seed determinism check is green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(vulture): sync whitelist with collapsed hash_tree_root handler
Collapsing the four identical leaf handlers into one left the whitelist
naming the four removed functions and not the new one, so vulture flagged
the new singledispatch handler as unused. Replace the four stale entries
with the single new handler name.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e85dae7 commit 94f54b1
2 files changed
Lines changed: 8 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
223 | 218 | | |
224 | 219 | | |
225 | 220 | | |
| |||
228 | 223 | | |
229 | 224 | | |
230 | 225 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | 226 | | |
237 | 227 | | |
238 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
21 | 19 | | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
0 commit comments