ethereum / ethereum/execution-specs
Nodes in trie lib use Bytes as a type for Nibble
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 505
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 116
Description
### Metadata
* **Hardfork**: cancun
### What was wrong?
https://github.com/ethereum/execution-specs/blob/master/src/ethereum/cancun/trie.py#L80-L95
```
@slotted_freezable
@dataclass
class LeafNode:
"""Leaf node in the Merkle Trie"""
rest_of_key: Bytes
value: rlp.Extended
@slotted_freezable
@dataclass
class ExtensionNode:
"""Extension node in the Merkle Trie"""
key_segment: Bytes
subnode: rlp.Extended
```
`rest_of_key` and `key_segment` should be `Nibble` (type to create) instead of `Bytes`, as it's not true that _any bytes_. can be in (see for example `encode_internal_node` where it crashes in `nibble_list_to_compact(node.rest_of_key, True)`
Contributor guide
Assessment
This issue has not been assessed yet.