neoneo-go/pkg
Anna Shaleva 4809cdf0b0 consensus: fix panic during verifyBlock
Issue: panic during mixed 4-nodes consensus setup:
```
2021-03-18T12:01:50.715Z	INFO	skip change view	{"nc": 0, "nf": 3}
2021-03-18T12:01:52.786Z	INFO	received ChangeView	{"validator": 0, "reason": "Timeout", "new view": 1}
2021-03-18T12:01:53.602Z	INFO	received ChangeView	{"validator": 2, "reason": "Timeout", "new view": 1}
2021-03-18T12:01:56.736Z	INFO	received ChangeView	{"validator": 1, "reason": "Timeout", "new view": 1}
2021-03-18T12:01:56.736Z	INFO	changing dbft view	{"height": 3, "view": 1, "index": 3, "role": "Backup"}
2021-03-18T12:02:01.758Z	INFO	received PrepareRequest	{"validator": 2, "tx": 0}
panic: interface conversion: block.Block is nil, not *consensus.neoBlock

goroutine 315 [running]:
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).verifyBlock(0xc000419540, 0x0, 0x0, 0x4)
	github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:427 +0x1306
github.com/nspcc-dev/dbft.(*DBFT).createAndCheckBlock(0xc0001f8840, 0x13f0002)
	github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:373 +0x27e
github.com/nspcc-dev/dbft.(*DBFT).onPrepareRequest(0xc0001f8840, 0x13f4378, 0xc0003b8500)
	github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:329 +0xdf1
github.com/nspcc-dev/dbft.(*DBFT).OnReceive(0xc0001f8840, 0x13f4378, 0xc0003b8500)
	github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:247 +0xe25
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).eventLoop(0xc000419540)
	github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:297 +0x79d
created by github.com/nspcc-dev/neo-go/pkg/consensus.(*service).Start
	github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:249 +0xa5
```

So (*service).verifyBlock is unable to work with nil block.
2021-03-18 18:20:33 +03:00
..
compiler core: remove System.Contract.IsStandard 2021-03-16 16:59:23 +03:00
config Merge pull request #1832 from nspcc-dev/consensus/microfixes 2021-03-16 18:11:33 +03:00
consensus consensus: fix panic during verifyBlock 2021-03-18 18:20:33 +03:00
core core: fix transaction hashes 2021-03-18 17:57:54 +03:00
crypto core: fix transaction hashes 2021-03-18 17:57:54 +03:00
encoding encoding: panic on nil slice 2021-03-09 12:11:26 +03:00
interop core: remove System.Contract.IsStandard 2021-03-16 16:59:23 +03:00
io *: upgrade tests to use T.Cleanup() 2021-03-01 17:08:00 +03:00
network consensus: store ProtocolConfiguration in consensus config 2021-03-15 16:58:27 +03:00
rpc core: fix transaction hashes 2021-03-18 17:57:54 +03:00
services oracle/neofs: change result types 2021-03-15 10:54:08 +03:00
smartcontract core: fix transaction hashes 2021-03-18 17:57:54 +03:00
util native/vm: add script check for deployed contracts 2021-02-09 22:31:26 +03:00
vm emit: allow to emit big.Int 2021-03-11 10:12:30 +03:00
wallet core: refactor Neo.Crypto.CheckMultisigWithECDsaSecpr1 2021-03-10 21:46:05 +03:00