Commit ee53428
committed
fix: ensure Binary Trie dumps all nodes for proper reconstruction
Binary Trie state reconstruction was failing with "missing trie node" errors
when processing execution spec tests. The issue occurred because only leaf
nodes were being dumped via DumpBinTrieLeaves, while intermediate nodes
were missing.
The fundamental difference between tree structures:
- Verkle Trees: 256-ary trees, shallow (2-3 levels deep)
- Binary Tries: Binary trees, very deep (up to 248 levels)
When dumping state in Binary Trie mode, the code was only calling
DumpBinTrieLeaves which exports leaf nodes to the Pre.BT field. However,
Binary Tries require ALL nodes (intermediate + leaves) for reconstruction
due to their deep structure.
Modified transition.go to call DumpToCollector for both Verkle and Binary
Trie modes. This ensures:
1. All nodes (intermediate + leaves) are available in pre.Pre
2. Leaf nodes are still separately collected in pre.BT field
3. Binary Trie reconstruction has complete tree structure
Execution Spec Tests Status (28 total tests):
✅ Passing (23 tests - 82% success rate):
1. test_contract_creation.py: ✅ 12 tests - ALL PASSING
- All contract creation scenarios now work correctly
- Previously failed due to missing intermediate nodes
2. test_contract_codechunking.py: ✅ 11 tests PASSING
- Code chunking operations work with full node tree
3. test_transfer.py: ✅ PASSING
- Value transfer operations work correctly
1 parent 62e5f47 commit ee53428
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
0 commit comments