Change anonymous func arg for `Iterate`
methods of Storages to `PeerTrustsHandler`
type for implementing corresponding
interface.
Implement missing `Iterate` method for
daughter Storage.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Alphabet nodes synchronize list of alphabet keys from main chain
`NeoFSAlphabet` role once per epoch. This can lead to a wrong behavior in
single chain deployment (`without_mainnet` config parameter). Alphabet node
in single chain environment will try to get NeoFSAlphabet role from main
chain client, but it'll get result from side chain instead. Side chain
stores list of all inner ring nodes in this role. Therefore it is possible
that alphabet nodes will try to appoint inner ring nodes as alphabet nodes,
which is not correct.
Fix incorrect behavior with disabling of synchronization of alphabet keys in
sidechain-only mode.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Allocate capacity instead of length of the slice to write the object payload
range since each chunk is written through `append`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation node's Object Get/Head/GetRange V2 service
handlers created a new request for each RPC. Now original requests are
re-signed according to API specification. Logical handler abstracts from
this version-dependent logic through `RequestForwarder` callback.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation node's Object Search V2 service handler created a
new request for each RPC. Now original requests are re-signed according to
API specification. Logical handler abstracts from this version-dependent
logic through `RequestForwarder` callback.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Control service turns storage node to online and offline modes. We can't
reuse `cfgNetmap.reBootstrapEnabled` because it represents configuration
value while control service manages state in runtime.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Evicting from cache requires closing blobovnicza which
in turn needs to lock `activeMtx`. This lock is not needed on
every addition, but our LRU library doesn't return evicted keys.
In future we may consider switching to other implementation.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Eigen trust block timer ticks to start new round of
eigen trust calculations. Every epoch this timer
recalculates duration and starts again.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Neo node can return integers values where []byte is expected.
To cover such cases, try to parse integers in `BytesFromStackItem`.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Add `addContainerAsyncNotificationHandler`
func that passed handler to container's
worker pool similar to how it is done in
reputation handlers.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Add handler closure over worker pool
in the event package.
Add `addNewEpochAsyncNotificationHandler`
function that uses that closure. Pass
the reputation report handler to worker
pool via using that function.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Add worker pools to Netmap and Container
config structures. Add its initialization
that depends on environmental variables(
sync/async; worker pool size).
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This function already reused in different storage engine parts
so it makes sense to keep it in separate package.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Different SplitInfo parts may be stored in different shards. Storage
engine must not stop at first SplitInfoError and should make
best effort to complete SplitInfo structure if needed.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
There were no unit tests of storage engine. This commit
adds first test to reproduce missing link ID in split info
at `engine.Head(raw)` request.
Engine tests uses some constructors from metabase tests,
so it is better to locate such functions in common
package at local_object_storage.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Add checking if returned error contains
"already on chain" substring. Do not
consider that behavior to be erroneous.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
If non-"HALT" `State` occurs after
calling `InvokeFunction` NeoGo client
method, add `FaultException` information
to returning error. Add returning state
check to `NotaryInvoke` method of the
morph/client.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
if `shutdown.offline.enabled` config option set to true, then
send netmap.UpdateState(offline) tx at the shutdown. This config
option is not set by default.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>