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>
`Any` type with nil/null value is treated as a parameter filter that allows
any notification value. Not more than 16 filter parameters are allowed.
Closes#3624.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Technically, we can always buildHFSpecificMD() if contract is active, but we
just optimize the build out in some cases. switch slightly obfuscates this
and requires having the call in two branches.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
These conditions are about filtering methods out. A method is excluded if its
ActiveFrom is strictly higher than the current HF, since if it's the same then
it should be present. Otherwise contract is broken at the height of this
particular HF.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
It's just not possible to use maps in invokers/actors without this. And maps
have too many combinations to try pushing them into a type switch, that's
where reflection kicks in and solves it easily.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Pros:
* less code
* handles more types
Cons:
* slow
This code is not likely to be on the hot path and it is exactly the one used
by actors for making calls of various kinds. Supporting more types is more
important here than raw speed.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
We're popping an item (array) off the stack, OK, it triggers refs.Remove() for
it. Then we're pushing an inner item to the stack, OK, it triggers refs.Add()
for this element. Why are we removing it afterwards? Looks like something went
wrong in 324107b31e (and https://github.com/nspcc-dev/neo-go/pull/1670)
since a simple test shows zero counter after POPITEM and -1 after popping the
only item left on the stack.
Signed-off-by: Roman Khimov <roman@nspcc.ru>