Commit 458802d
feat: add StructContainerTreeView, model Validator as StructContainerType
Add StructContainerTreeView — a tree view for fixed-size containers
that stores the value as a flat Zig struct. Fields are read and written
in O(1) via direct struct access. Dirty fields are tracked with a
StaticBitSet. On commit, only changed fields are spliced into the
merkle tree via setNodesAtDepth. The pool has no special node types —
this is purely a view-level optimization.
- Add StructContainerTreeView with StaticBitSet dirty tracking
- Parameterize FixedContainerType with TreeViewType enum
- StructContainerType selects StructContainerTreeView via the enum
- Model phase0 Validator as StructContainerType
- set() skips write and dirty-marking when value is unchanged
- serializeIntoBytes/toValue read from the struct directly (no commit needed)
- commit has clear ownership phases with correct errdefer cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ce6370e commit 458802d
File tree
7 files changed
+458
-4
lines changed- src
- consensus_types
- ssz
- tree_view
- type
- state_transition/test_utils
7 files changed
+458
-4
lines changed| 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 | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
0 commit comments