neo-go/pkg/core
Roman Khimov 92e3474f6e core: take an addblock lock on exit
Prevent this:

2021-08-12T15:24:00.750+0300    INFO    shutting down service   {"service": "Prometheus", "endpoint": ":2112"}
2021-08-12T15:24:00.752+0300    INFO    shutting down service   {"service": "Pprof", "endpoint": ":2113"}
2021-08-12T15:24:00.868+0300    INFO    blockchain persist completed    {"persistedBlocks": 14, "persistedKeys": 3145, "headerHeight": 7806078, "blockHeight": 7794173, "took": "652.243264ms"}
2021-08-12T15:24:00.974+0300    INFO    blockchain persist completed    {"persistedBlocks": 1, "persistedKeys": 259, "headerHeight": 7806078, "blockHeight": 7794174, "took": "221.955904ms"}
panic: assignment to entry in nil map

goroutine 132 [running]:
github.com/nspcc-dev/neo-go/pkg/core/storage.(*MemoryStore).drop(...)
        github.com/nspcc-dev/neo-go/pkg/core/storage/memory_store.go:71
github.com/nspcc-dev/neo-go/pkg/core/storage.(*MemoryStore).Delete(0xc0002889c0, 0xc022642060, 0x21, 0x30, 0x21, 0xc022642060)
        github.com/nspcc-dev/neo-go/pkg/core/storage/memory_store.go:79 +0x9c
github.com/nspcc-dev/neo-go/pkg/core/mpt.(*Trie).updateRefCount(0xc00029cd50, 0x70945b6e05b4ce98, 0xb058a7450d307de5, 0x660ef5aff9146084, 0x1293434e970256e5, 0xc000000001)
        github.com/nspcc-dev/neo-go/pkg/core/mpt/trie.go:410 +0x257
github.com/nspcc-dev/neo-go/pkg/core/mpt.(*Trie).Flush(0xc00029cd50)
        github.com/nspcc-dev/neo-go/pkg/core/mpt/trie.go:370 +0x23a
github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).storeBlock(0xc0002c6000, 0xc022476500, 0x0, 0xd6b100)
        github.com/nspcc-dev/neo-go/pkg/core/blockchain.go:869 +0x3ac5
github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).AddBlock(0xc0002c6000, 0xc022476500, 0x0, 0x0)
        github.com/nspcc-dev/neo-go/pkg/core/blockchain.go:446 +0xeb
github.com/nspcc-dev/neo-go/pkg/network.(*blockQueue).run(0xc0001e1ad0)
        github.com/nspcc-dev/neo-go/pkg/network/blockqueue.go:48 +0x168
created by github.com/nspcc-dev/neo-go/pkg/network.(*Server).Start
        github.com/nspcc-dev/neo-go/pkg/network/server.go:183 +0x25d

Which then leads to broken DB.
2021-08-12 16:49:29 +03:00
..
block rpc/block: rework the way Block is JSONized 2020-05-14 17:28:14 +03:00
cache cache: prevent TestRelayCache_Add failures 2020-06-26 12:42:12 +03:00
dao dao: don't treat zero stateroot as valid during MPT init 2021-04-19 12:39:43 +03:00
mempool core: fix bug with mempool.verifiedMap 2020-12-16 14:14:09 +03:00
mpt mpt: implement reference counting 2020-11-18 12:16:05 +03:00
state state: reject too big transfers, fix #1900 2021-04-12 12:14:33 +03:00
storage storage: fix Get for BoltDB, fix #1482 2020-10-13 19:21:57 +03:00
test_data Persist blockchain with leveldb on disk (#48) 2018-03-17 12:53:21 +01:00
transaction transaction: always JSONize all contract fields for Publish tx 2021-02-18 17:28:19 +03:00
blockchain.go core: take an addblock lock on exit 2021-08-12 16:49:29 +03:00
blockchain_test.go core: turn off GAS generation at 8M height 2021-08-04 17:00:13 +03:00
blockchainer.go rpc: fix getblocksystemfee call 2021-02-15 17:58:39 +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: save NEP5 transfer notify index 2020-08-03 10:58:23 +03:00
interop_neo.go config: allow configuring free gas depending on height 2020-09-08 18:52:53 +03:00
interop_neo_test.go core: fix key recovery interops return value 2020-06-10 19:20:57 +03:00
interop_system.go dao: restrict GetStorageItems by prefix 2020-05-27 11:40:46 +03:00
interops.go core: provide key recovery interops only if neox is enabled 2020-06-24 12:37:27 +03:00
interops_test.go core: move DAO to a separate package 2020-04-08 08:38:44 +03:00
prometheus.go core: add state height to prometheus metrics 2020-06-24 14:47:08 +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