neoneo-go/pkg/core
Roman Khimov a1c4d7ce26 core: do MPT compaction every once in a while
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.
2020-06-04 17:25:57 +03:00
..
block rpc/block: rework the way Block is JSONized 2020-05-14 17:28:14 +03:00
dao dao: optimize storage cache flushing 2020-06-04 17:21:58 +03:00
mempool mempool: gofmt -s 2020-03-17 16:47:51 +03:00
mpt mpt: fix extension node cache invalidation 2020-06-04 17:16:32 +03:00
state core: update MPT during block processing 2020-06-03 13:33:44 +03:00
storage mpt: implement MPT trie 2020-06-01 18:14:19 +03:00
test_data Persist blockchain with leveldb on disk (#48) 2018-03-17 12:53:21 +01:00
transaction transaction: gofmt -s 2020-05-30 15:48:57 +03:00
blockchain.go core: do MPT compaction every once in a while 2020-06-04 17:25:57 +03:00
blockchain_test.go core: add Blockchain event subscription mechanism 2020-05-12 17:41:15 +03:00
blockchainer.go core: update MPT during block processing 2020-06-03 13:33:44 +03:00
doc.go core: add Blockchain event subscription mechanism 2020-05-12 17:41:15 +03:00
gas_price.go cli: make gas parameter to deployment add gas to the base price 2020-03-11 20:34:36 +03:00
gas_price_test.go core: make SpawnVM a method of context 2020-04-08 08:38:45 +03:00
header_hash_list.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
helper_test.go core: ensure we produce correct blocks for tests 2020-05-07 21:46:28 +03:00
interop_neo.go core: implement key recover interops 2020-06-03 14:36:04 +03:00
interop_neo_test.go core: implement key recover interops 2020-06-03 14:36:04 +03:00
interop_system.go dao: restrict GetStorageItems by prefix 2020-05-27 11:40:46 +03:00
interops.go core: implement key recover interops 2020-06-03 14:36:04 +03:00
interops_test.go core: move DAO to a separate package 2020-04-08 08:38:44 +03:00
prometheus.go core: refactor out MemPool 2020-01-16 10:16:24 +03:00
spent_coin.go core: move (un)SpentCoin structs into the state package 2020-03-11 12:22:52 +03:00
storage_find.go vm: make Iterator interface public 2020-05-27 11:40:46 +03:00
util.go config: move config.go out of config/ 2020-03-31 17:55:59 +03:00
util_test.go config: move config.go out of config/ 2020-03-31 17:55:59 +03:00