neo-go/pkg/core
Roman Khimov 423c7883b8 core: implement basic GC for value-based storage scheme
The key idea here is that even though we can't ensure MPT code won't make the
node active again we can order the changes made to the persistent store in
such a way that it practically doesn't matter. What happens is:
 * after persist if it's time to collect our garbage we do it synchronously
   right in the same thread working the underlying persistent store directly
 * all the other node code doesn't see much of it, it works with bc.dao or
   layers above it
 * if MPT doesn't find some stale deactivated node in the storage it's OK,
   it'll recreate it in bc.dao
 * if MPT finds it and activates it, it's OK too, bc.dao will store it
 * while GC is being performed nothing else changes the persistent store
 * all subsequent bc.dao persists only happen after the GC is completed which
   means that any changes to the (potentially) deleted nodes have a priority,
   it's OK for GC to delete something that'll be recreated with the next
   persist cycle

Otherwise it's a simple scheme with node status/last active height stored in
the value. Preliminary tests show that it works ~18% worse than the simple
KeepOnlyLatest scheme, but this seems to be the best result so far.

Fixes #2095.
2022-02-11 14:19:54 +03:00
..
block *: store application long along with tx/block 2021-12-09 15:39:26 +03:00
blockchainer core: drop GetStandBy* methods 2022-01-31 23:14:38 +03:00
chaindump services/consensus: drop blockchainer.Blockchainer use 2022-01-14 19:57:16 +03:00
dao core, rpc: use Seek to iterate over NEP* transfers 2022-01-19 20:55:08 +03:00
fee vm: add PACKMAP/PACKSTRUCT, extend UNPACK 2021-11-12 17:19:59 +03:00
interop core: drop GetStandBy* methods 2022-01-31 23:14:38 +03:00
mempool mempool: use capacity parameter to avoid map reallocations 2021-12-01 21:36:25 +03:00
mempoolevent core: move mempool.Event to a separate package 2021-06-01 12:24:28 +03:00
mpt mpt: modify refcounted storage scheme to make GC possible 2022-02-10 21:56:20 +03:00
native Merge pull request #2342 from nspcc-dev/fix-management-contract-callflags 2022-02-01 12:30:53 +03:00
state core, rpc: use Seek to iterate over NEP* transfers 2022-01-19 20:55:08 +03:00
stateroot core: implement basic GC for value-based storage scheme 2022-02-11 14:19:54 +03:00
statesync mpt: modify refcounted storage scheme to make GC possible 2022-02-10 21:56:20 +03:00
storage storage: provide a way to escape from SeekAsync goroutine 2022-02-09 00:22:42 +03:00
test_data nativetest: migrate Oracle contract tests to neotest 2022-01-14 17:56:10 +03:00
transaction transaction: microoptimize Hash() 2021-12-02 14:48:35 +03:00
bench_test.go core, rpc: use Seek to iterate over NEP* transfers 2022-01-19 20:55:08 +03:00
blockchain.go core: implement basic GC for value-based storage scheme 2022-02-11 14:19:54 +03:00
blockchain_test.go core: implement basic GC for value-based storage scheme 2022-02-11 14:19:54 +03:00
doc.go core: add Blockchain event subscription mechanism 2020-05-25 00:27:39 +03:00
helper_test.go rpc/client: remove dependency on examples 2022-01-25 12:41:06 +03:00
interop_system.go Merge pull request #2323 from nspcc-dev/drop-blockchainer 2022-01-14 20:47:26 +03:00
interop_system_test.go nativetest: migrate Management contract tests to neotest 2022-01-14 17:56:04 +03:00
interops.go interop: implement System.Runtime.GetRandom 2021-07-15 16:00:01 +03:00
interops_test.go core: remove conflicting transactions wrt MaxTraceableBlocks 2021-08-18 13:31:47 +03:00
native_contract_test.go nativetest: migrate Management contract tests to neotest 2022-01-14 17:56:04 +03:00
native_designate_test.go nativetest: migrate Designation contract tests to neotest 2022-01-14 16:47:31 +03:00
native_management_test.go nativetest: migrate Management contract tests to neotest 2022-01-14 17:56:04 +03:00
native_neo_test.go nativetest: migrate NEO contract tests to neotest 2022-01-14 17:56:10 +03:00
native_policy_test.go nativetest: migrate Policy contract tests to neotest 2022-01-14 16:34:33 +03:00
notary_test.go network: decouple it from blockchainer.Blockchainer 2022-01-14 19:57:16 +03:00
oracle_test.go Merge pull request #2323 from nspcc-dev/drop-blockchainer 2022-01-14 20:47:26 +03:00
prometheus.go stateroot: move state-root related logic to core/stateroot 2021-03-09 13:48:29 +03:00
stateroot_test.go core: shrink blockchainer.StateRoot further, leave simple RO methods 2022-01-14 19:57:16 +03:00
statesync_test.go core: allow early Seek stop 2022-01-19 20:54:35 +03:00
util.go core: drop GetStandBy* methods 2022-01-31 23:14:38 +03:00
util_test.go core/block: add Nonce field to header 2021-07-15 15:58:49 +03:00