Commit 5c45e17
fix(ssz): correct JustificationValidators LIMIT formula in rule doc (leanEthereum#728)
The SSZ-patterns rule doc showed `LIMIT = HISTORICAL_ROOTS_LIMIT *
HISTORICAL_ROOTS_LIMIT` for the JustificationValidators example, but
the type stores one bit per (tracked root, registered validator)
pair. The second factor must be the validator registry limit.
The numerical impact is large: the doc value is 64x the correct
value. Because BaseBitlist.LIMIT controls the merkleization depth,
a second-client implementer following the rule doc would compute a
different hash_tree_root for the same state field and fork off
silently the first time they tried to talk to a node built from
this code.
Changes:
- ssz-patterns.md: fix the formula in the example, add an inline
rationale, and define VALIDATOR_REGISTRY_LIMIT alongside
HISTORICAL_ROOTS_LIMIT so the math is self-contained.
- ssz-patterns.md: update the frontmatter path glob and the
architecture diagram to reflect that containers moved to
forks/<fork>/containers/ in the recent refactor.
- state/types.py: expand the one-line docstring on
JustificationValidators to document the layout and the
consensus-critical nature of the LIMIT product.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1056f2b commit 5c45e17
2 files changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
166 | 173 | | |
167 | 174 | | |
0 commit comments