neoneo-go/pkg
Anna Shaleva 9b364aa7ee network: do not allow to request invalid block count
The problem is in peer disconnection due to invalid GetBlockByIndex
payload (the logs are from some patched neo-go version):
```
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.490Z        INFO        new peer connected        {"addr": "10.78.69.115:50846", "peerCount": 3}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.490Z        WARN        peer disconnected        {"addr": "10.78.69.115:50846", "error": "invalid block count", "peerCount": 2}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.490Z        INFO        started protocol        {"addr": "10.78.69.115:50846", "userAgent": "/NEO-GO:1.0.0/", "startHeight": 0, "id": 1339571820}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.491Z        INFO        new peer connected        {"addr": "10.78.69.115:50856", "peerCount": 3}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.492Z        WARN        peer disconnected        {"addr": "10.78.69.115:50856", "error": "invalid block count", "peerCount": 2}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.492Z        INFO        started protocol        {"addr": "10.78.69.115:50856", "userAgent": "/NEO-GO:1.0.0/", "startHeight": 0, "id": 1339571820}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.492Z        INFO        new peer connected        {"addr": "10.78.69.115:50858", "peerCount": 3}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.493Z        INFO        started protocol        {"addr": "10.78.69.115:50858", "userAgent": "/NEO-GO:1.0.0/", "startHeight": 0, "id": 1339571820}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.493Z        WARN        peer disconnected        {"addr": "10.78.69.115:50858", "error": "invalid block count", "peerCount": 2}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.494Z        INFO        new peer connected        {"addr": "10.78.69.115:50874", "peerCount": 3}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.494Z        INFO        started protocol        {"addr": "10.78.69.115:50874", "userAgent": "/NEO-GO:1.0.0/", "startHeight": 0, "id": 1339571820}
дек 15 16:02:39 glagoli neo-go[928530]: 2022-12-15T16:02:39.494Z        WARN        peer disconnected        {"addr": "10.78.69.115:50874", "error": "invalid block count", "peerCount": 2}
```

GetBlockByIndex payload can't be decoded, and the only possible cause
is zero (or <-1, but it's probably not the case) block count requested.

Error is improved as far.
2022-12-28 13:04:56 +03:00
..
compiler *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
config config: fix the default P2P ping settings 2022-12-07 21:29:40 +03:00
consensus config: add a special Blockchain type to configure Blockchain 2022-12-07 17:35:53 +03:00
core native: simplify code somewhat, get Metadata() only once 2022-12-16 23:48:04 +03:00
crypto *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
encoding fixedn: add a test for empty string 2022-08-19 21:52:43 +03:00
interop interop: add getContractByID and getContractHashes to management 2022-12-02 10:54:45 +03:00
io *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
neorpc result: drop Version (un)marshaler, we only need it for Protocol 2022-11-10 17:51:02 +03:00
neotest config: replace VerifyBlocks with SkipBlockVerification 2022-12-07 17:35:56 +03:00
network network: do not allow to request invalid block count 2022-12-28 13:04:56 +03:00
rpcclient rpcclient: fix filtered naive subscriptions receiver 2022-12-07 16:56:16 +03:00
services Merge pull request #2842 from nspcc-dev/stringer 2022-12-13 22:12:18 +07:00
smartcontract Merge pull request #2828 from nspcc-dev/rpcwrapper-structures 2022-12-06 21:40:16 +07:00
util slice: add Clean microfunction 2022-09-02 14:44:32 +03:00
vm vm: adjust stale comment 2022-12-07 17:30:02 +03:00
wallet Merge pull request #2725 from nspcc-dev/move-cli-tests 2022-10-06 13:43:39 +07:00