Evgenii Stratonikov
0ffffb93d7
mpt: implement reference counting
2020-11-18 12:16:05 +03:00
Evgenii Stratonikov
f3abbf34e3
mpt: fill cached fields when getting node from store
...
Node which has been got from store shouldn't be flushed again.
2020-11-11 13:22:53 +03:00
Roman Khimov
f77c239296
mpt: fix extension node cache invalidation
...
It should always be invalidated if something changes in the `next` (below the
extension node).
2020-06-04 17:16:32 +03:00
Roman Khimov
029fecbb71
mpt: don't flush nodes already present in the DB
...
It's just a waste of time.
2020-06-03 00:37:30 +03:00
Roman Khimov
1b6aee42d5
mpt: restructure nodes a bit, implement serialization and hash cache
...
It drastically reduces the number of allocations and hash calculations.
2020-06-03 00:37:21 +03:00
Evgenii Stratonikov
103c45850a
mpt: implement (*Trie).Collapse()
...
Because trie size is rather big, it can't be stored in memory.
Thus some form of caching should also be implemented. To avoid
marshaling/unmarshaling of items which are close to root and are used
very frequenly we can save them across the persists.
This commit implements pruning items at the specified depth,
replacing them by hash nodes.
2020-06-01 18:15:13 +03:00
Evgenii Stratonikov
861a1638e8
mpt: implement MPT trie
...
MPT is a trie with a branching factor = 16, i.e. it consists of sequences in
16-element alphabet.
2020-06-01 18:14:19 +03:00