Problem:
```
--- FAIL: TestDumpDB (0.08s)
--- FAIL: TestDumpDB/too_low_chain
testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestDumpDB_too_low_chain357310492\001\chains\privnet\000001.log: The process cannot access the file because it is being used by another process.
```
Solution:
Release resources occupied by the chain even on non-error command exit.
Problem:
```
--- FAIL: TestMakeDirForFile_HappyPath (0.01s)
testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMakeDirForFile_HappyPath402638411\001\testDir\testFile.test: The process cannot access the file because it is being used by another process.
--- FAIL: TestMakeDirForFile_Negative (0.01s)
testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMakeDirForFile_Negative672737582\001\testFile.test: The process cannot access the file because it is being used by another process.
FAIL
```
Solution:
Release resources occupied by os.Create.
Problem:
```
--- FAIL: TestMemCachedPersist (0.07s)
--- FAIL: TestMemCachedPersist/BoltDBStore (0.07s)
testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMemCachedPersist_BoltDBStore294966711\001\test_bolt_db: The process cannot access the file because it is being used by another process.
```
Solution:
Release the resources occupied by the DB.
Problem:
```
--- FAIL: TestHandleLoggingParams (0.02s)
--- FAIL: TestHandleLoggingParams/default (0.00s)
server_test.go:51:
Error Trace: server_test.go:51
Error: Received unexpected error:
couldn't open sink "C:\\Users\\Anna\\AppData\\Local\\Temp\\TestHandleLoggingParams226652490\\001/file.log": no sink found for scheme "c"
Test: TestHandleLoggingParams/default
--- FAIL: TestHandleLoggingParams/debug (0.00s)
server_test.go:64:
Error Trace: server_test.go:64
Error: Received unexpected error:
couldn't open sink "C:\\Users\\Anna\\AppData\\Local\\Temp\\TestHandleLoggingParams226652490\\001/file.log": no sink found for scheme "c"
Test: TestHandleLoggingParams/debug
```
Solution:
Currently no solution is implemented, but we can use relative paths instead of absolute.
We use 2 prefixes for storing items because of state synchronization.
This commit allows to parametrize dao with the default prefix.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
It doesn't trigger the problem fixed in the previous commit because here
CreateTxFromScript is used with pre-calculated GAS value from InvokeFunction
and thus it's not performing invocation. Still, it's a nice test extension.
Copying just the scope doesn't work for CustomContracts, CustomGroups and
Rules because they all contain additional metadata. Thanks @mialbu for
reporting this.
b9be892bf9 has made Persist asynchronous which
is very effective in allowing the system to continue processing
blocks/transactions while flushing things to disk. It at the same time is very
dangerous in that if the disk is slow and it takes much time to flush KV set
(more than persisting interval), there might be even bigger new KV set in
MemCachedStore by the time it finishes. Even if the system immediately starts
to flush this new data set it (being bigger) can take more time than the
previous one. And while doing so a new data set will appear in memory,
potentially again bigger than this.
So we can easily end up with the system going out of control, consuming more
and more memory and taking more and more time to persist a single set of
data. To avoid this we need to detect such condition and just wait for Persist
to really finish its job and release the resources.
N3 contracts require method and array of arguments to function correctly, but
CreateFunctionInvocationScript can produce scripts that won't work correctly
if one is to pass anything but a single array parameter to it. This doesn't
make much sense, so we can always expect there to be an array of parameters in
the third positional invokefunction argument (the same way C# node does).
Everywhere it matters (and that's callExFromNative() now) it's incremented
already, so when we're doing Call() at the same time (and it's done to invoke
`_initialize` method) we're effectively double-incrementing it.
Standards are NEP-11 and NEP-17, not NEP11, not NEP17, not anything
else. Variable/function names of course can use whatever fits, but documents
and comments should be consistent wrt this.