a1c4d7ce26
We need to compact our in-memory MPT from time to time, otherwise it quickly fills up all available memory. This raises two obvious quesions --- when to do that and to what level do that. As for 'when', I think it's quite easy to use our regular persistence interval as an anchor (and it also frees up some memory), but we can't do that in the persistence routine itself because of synchronization issues (adding some synchronization primitives would add some cost that I'd also like to avoid), so do it indirectly by comparing persisted and current height in `storeBlock`. Choosing proper level is another problem, but if we're to roughly estimate one full branch node to use 1K of memory (usually it's way less than that) then we can easily store 1K of these nodes and that gives us a depth of 10 for our trie. |
||
---|---|---|
.. | ||
compiler | ||
config | ||
consensus | ||
core | ||
crypto | ||
encoding | ||
internal | ||
interop | ||
io | ||
network | ||
rpc | ||
smartcontract | ||
util | ||
vm | ||
wallet |