Commit 0b7d33e
refactor(ssz): depend on the released SSZ specification (#1205)
The SSZ specification was extracted into its own repository and released as
eth-ssz-specs 0.1.0. leanSpec now imports it instead of carrying a copy.
Deleted: the nine-module vendored package, the merkleization module, their
mirrored unit tests, and the two consensus vector modules whose cases the
upstream release ships verbatim (merkleization boundaries and the decode-failure
smoke test). The generic cases in the basic-types vectors go the same way; the
field-element and attestation-subnet cases stay, since upstream cannot express
them.
Kept, in a new module for the shapes the SSZ package leaves to the protocol:
- The struct base, frozen and camelCase. Fork choice keeps one state per block
root and hands it to every branch below, so a writable state would let one
branch rewrite history for its siblings. The SSZ shapes are mutable, so each
leanSpec base restates the freeze. The key casing is what cross-client test
vectors carry.
- The byte widths, declared against the SSZ byte vector, as the consensus specs
declare theirs. The 32-byte one is the root type itself: a separate vector of
that width would be its sibling, and SSZ refuses equality between siblings, so
every check of a stored root against a computed one would raise.
Two behaviors needed porting rather than renaming:
- The KoalaBear field element now rides on the 32-bit unsigned integer. That is
what packs eight elements to a leaf; a type outside the unsigned integers
takes a leaf each, and every XMSS key, signature and registry root would move.
A test pins the packing.
- The sequence decoder builds its result past validation, so the validator
registry stopped meeting its position rule on the wire. A registry read off
the wire is re-checked, which keeps two clients from disagreeing on whether a
malformed registry is valid.
Every consensus byte is unchanged: the serialized payloads and Merkle roots in
all surviving vectors are identical to what the vendored code produced. The one
JSON difference is that a bare field element now renders as a decimal string,
the way every other integer already did, instead of a Python repr.
Co-authored-by: Thomas Coratger <thomas.coratger@ethereum.org>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 0588c2d commit 0b7d33e
171 files changed
Lines changed: 564 additions & 9059 deletions
File tree
- .claude
- agents
- rules
- skills
- audit
- test
- packages/testing/src/consensus_testing
- pytest_plugins
- test_fixtures
- test_types
- src/lean_spec
- cli
- node
- api
- chain
- networking
- client
- event_source
- enr
- gossipsub
- reqresp
- transport/identity
- storage
- sync
- validator
- spec
- crypto
- xmss
- forks
- lstar
- containers
- ssz
- tests
- consensus
- lstar
- fork_choice
- ssz
- state_transition
- verify_proofs
- verify_signatures
- interop/helpers
- node
- api
- chain
- networking
- client
- event_source
- enr
- reqresp
- service
- storage
- sync
- validator
- spec
- crypto
- xmss
- ssz
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | | - | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments