neo-go/pkg
Ekaterina Pavlova 119ca27994 blockfetcher: fix block enqueue logic
Previously, the `blockQueuer` routine, which enqueues blocks into
`bQueue`, could be blocked on enqueing newer blocks if older blocks
downloading is delayed by NeoFS.

The `blocksCh` channel, acting as a queue ordered by download speed,
conflicted with the BQueue requirement for strict sequential enqueuing
(expecting an exact range of blocks), resulting in a deadlock that
stalled the process.

Before with default config settings:
```
2024-11-27T17:12:19.348+0300	INFO	persisted to disk	{"blocks":
 0, "keys": 116, "headerHeight": 0, "blockHeight": 0, "took": "15
 .509083ms"}
2024-11-27T17:19:39.574+0300	INFO	persisted to disk	{"blocks":
 16, "keys": 11107, "headerHeight": 216768, "blockHeight": 216768,
 "took": "62.762041ms"}
```
Average block persistence speed: 492.40 block/s
Average blocks number for each persist log: 584.28

After:

```
2024-11-27T17:29:03.362+0300	INFO	persisted to disk	{"blocks":
 0, "keys": 116, "headerHeight": 0, "blockHeight": 0, "took": "19
 .485084ms"}
2024-11-27T17:34:58.527+0300	INFO	persisted to disk	{"blocks":
 16, "keys": 11109, "headerHeight": 216770, "blockHeight": 216769,
 "took": "52.43925ms"}
```
Average block persistence speed: 610.33 block/s
Average blocks number for each persist log: 752.61

Close #3699

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:50 +03:00
..
compiler *: fix some dupword warnings 2024-11-13 20:57:10 +03:00
config services: add new service for fetching blocks from NeoFS 2024-09-11 08:50:31 +04:00
consensus *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
core Merge pull request #3704 from nspcc-dev/interop-md-fixes 2024-11-26 17:03:31 +03:00
crypto *: improve for loop syntax 2024-08-30 21:45:18 +03:00
encoding *: improve for loop syntax 2024-08-30 21:45:18 +03:00
interop interop: fix linter issues 2024-10-11 12:41:06 +03:00
io io: no need to do ValueOf() again, it's known 2024-11-15 22:29:06 +03:00
neorpc ws: allow filtering notification by parameters 2024-11-26 00:26:04 +03:00
neotest neotest: sort coverage blocks within a test scope 2024-10-16 16:03:46 +03:00
network network: discard bFetcherQueue earlier 2024-11-29 13:37:50 +03:00
rpcclient ws: allow filtering notification by parameters 2024-11-26 00:26:04 +03:00
services blockfetcher: fix block enqueue logic 2024-11-29 13:37:50 +03:00
smartcontract manifest: support NEP-24 2024-11-20 14:45:28 +03:00
util *: improve for loop syntax 2024-08-30 21:45:18 +03:00
vm vm: fix PACKMAP operation 2024-11-19 13:49:53 +03:00
wallet *: use slices.Index/slices.Contains where appropriate 2024-08-27 08:24:52 +03:00