Commit d70d1bb
refactor: drop from __future__ import annotations in Pydantic-defining files (leanEthereum#759)
CLAUDE.md rule R1 bans the lazy-annotations import in files that
define Pydantic Container or SSZModel classes; lazy-string
annotations break Pydantic's forward-reference resolution. Six
audit-flagged files still carried it.
state/types.py needed a small adjustment after the drop: three
classmethod-like helpers on JustifiedSlots returned the class by
name (-> JustifiedSlots). Without future annotations the bare name
is undefined at signature evaluation, so they switch to typing.Self
which reads cleaner anyway for self-referential factories.
R2 (Store = LstarStore alias) is intentionally left alone. The
alias is the public generic name that lets subspecs (sync, api,
node, ...) reference "the current fork's Store" without importing
forks.lstar.*. Removing it would couple subspecs to the concrete
fork, defeating the multi-fork architecture (leanEthereum#686).
R3 (QUIC random peer-id anti-pattern) needs real libp2p TLS
extension parsing and belongs in its own PR.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6513aba commit d70d1bb
6 files changed
Lines changed: 4 additions & 14 deletions
File tree
- src/lean_spec
- forks/lstar/containers
- attestation
- block
- state
- subspecs/xmss
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
0 commit comments