mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 23:25:22 +00:00
423c7883b8
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. |
||
---|---|---|
.. | ||
block | ||
blockchainer | ||
chaindump | ||
dao | ||
fee | ||
interop | ||
mempool | ||
mempoolevent | ||
mpt | ||
native | ||
state | ||
stateroot | ||
statesync | ||
storage | ||
test_data | ||
transaction | ||
bench_test.go | ||
blockchain.go | ||
blockchain_test.go | ||
doc.go | ||
helper_test.go | ||
interop_system.go | ||
interop_system_test.go | ||
interops.go | ||
interops_test.go | ||
native_contract_test.go | ||
native_designate_test.go | ||
native_management_test.go | ||
native_neo_test.go | ||
native_policy_test.go | ||
notary_test.go | ||
oracle_test.go | ||
prometheus.go | ||
stateroot_test.go | ||
statesync_test.go | ||
util.go | ||
util_test.go |