neoneo-go/pkg/consensus
Roman Khimov 4d2ecab16f consensus: fix nonce handling
It was broken somewhere between 2f490a3403 and
85ce207f40 leading to panic on watch only node:

2021-07-21T16:21:39.201+0200    INFO    received Commit {"validator": 3}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xbcc59e]

goroutine 486 [running]:
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).newBlockFromContext(0xc0001629a0, 0xc000308000, 0xc0010fa000, 0x2cb417800)
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:664 +0xbe
github.com/nspcc-dev/dbft.(*Context).MakeHeader(...)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/context.go:270
github.com/nspcc-dev/dbft.(*DBFT).onCommit(0xc000308000, 0x138c998, 0xc000115110)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:487 +0x575
github.com/nspcc-dev/dbft.(*DBFT).OnReceive(0xc000308000, 0x138c998, 0xc000115110)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:251 +0xef5
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).eventLoop(0xc0001629a0)
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:312 +0x7d6
created by github.com/nspcc-dev/neo-go/pkg/consensus.(*service).Start
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:262 +0xdc

In fact, nonce is correctly provided by dbft library (since Legacy), we just
need to use it here.
2021-07-21 19:06:19 +03:00
..
testdata wallet: rename isdefault to isDefault 2021-05-14 10:31:31 +03:00
block.go consensus: fix nonce handling 2021-07-21 19:06:19 +03:00
block_test.go block: drop Network from the Header 2021-03-26 13:45:18 +03:00
cache.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
cache_test.go consensus: refactor payloads structure 2021-01-22 10:38:32 +03:00
change_view.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
change_view_test.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
commit.go *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
commit_test.go pkg: move internal/ package to the root directory 2020-11-24 16:39:56 +03:00
consensus.go consensus: fix nonce handling 2021-07-21 19:06:19 +03:00
consensus_test.go config: add InitialGASSupply, fix #2073 2021-07-20 16:59:54 +03:00
crypto.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
crypto_test.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
payload.go *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
payload_test.go payload: drop Network from Extensible 2021-03-26 13:45:18 +03:00
prepare_request.go consensus: add Nonce to PrepareRequest 2021-07-15 16:00:02 +03:00
prepare_request_test.go consensus: remove nonce from PrepareRequest 2021-03-18 21:32:43 +03:00
prepare_response.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
prepare_response_test.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
recovery_message.go payload: drop Network from Extensible 2021-03-26 13:45:18 +03:00
recovery_message_test.go *: remove dead code 2021-05-12 18:13:14 +03:00
recovery_request.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
recovery_request_test.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00