Ekaterina Pavlova
718ff9aa0a
blockfetcher: add check on IndexFileSize of index files
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:50 +03:00
Ekaterina Pavlova
14c980a685
network: refactor return value from NeoFSBlockFetcher service
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:50 +03:00
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
Ekaterina Pavlova
c1ce6904c4
network: discard bFetcherQueue earlier
...
Discard `bFetcherQueue` to avoid persisting
new blocks during termination before service Shutdown.
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:50 +03:00
Ekaterina Pavlova
df05cd2858
blockfetcher: change shutdown logic
...
Move the `isActive` check earlier to enable faster shutdown and prevent
the service from hanging.
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:50 +03:00
Ekaterina Pavlova
8216f538c3
blockfetcher: check container and network Magic
...
Close #3644
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:37:11 +03:00
Ekaterina Pavlova
92ff8409a9
blockfetcher: add retry for GET and SEARCH operations
...
Close #3564
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-29 13:34:40 +03:00
Ekaterina Pavlova
9fa07d8d6d
blockfetcher: fix invalid wallet
test
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-28 16:14:25 +03:00
Ekaterina Pavlova
c321eed8ee
blockfetcher: use pool for GET and SEARCH operations
...
Use NeoFS storage nodes pool during blocks fetching to spread the load.
Close #3568
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-28 16:14:25 +03:00
Ekaterina Pavlova
04516e7d26
neofs: add pool support for NeoFS operations
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-28 16:13:36 +03:00
Anna Shaleva
e89f9fe2a4
Merge pull request #3704 from nspcc-dev/interop-md-fixes
...
Native contract manifest build fixes
2024-11-26 17:03:31 +03:00
Anna Shaleva
f98169a762
Merge pull request #3689 from nspcc-dev/feat/filter-events-by-parameters
...
ws: allow filtering notification by parameters
2024-11-26 10:12:40 +03:00
Pavel Karpy
97bd73b38c
rpcsrv/tests: simplify tests with parsed test contract hash
...
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2024-11-26 00:26:06 +03:00
Pavel Karpy
0ba16fe580
ws: allow filtering notification by parameters
...
`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>
2024-11-26 00:26:04 +03:00
Roman Khimov
9e7fd5180a
interop: slightly rephrase BuildHFSpecificMD logic
...
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>
2024-11-25 14:45:26 +03:00
Roman Khimov
6b6878706a
interop: fix ActiveFrom comparison when building HF-specific MD
...
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>
2024-11-25 14:45:20 +03:00
Anna Shaleva
171e01be3c
Merge pull request #3691 from nspcc-dev/uploader-eq-search
...
upload-bin, NeoFSBlockFetcher: migrate to SEARCH with strict equality comparator
2024-11-25 13:43:12 +03:00
Ekaterina Pavlova
43609dd984
*: migrate to SEARCH with strict equality comparator
...
Close #3670
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-25 13:19:35 +03:00
Anna Shaleva
3d3f3f67e6
Merge pull request #3697 from nspcc-dev/logs-for-cash
...
core: fix restoring chain with `StateRootInHeader = true`
2024-11-25 12:52:11 +03:00
Roman Khimov
ff15e39363
Merge pull request #3695 from nspcc-dev/add-unwrap-errnull
...
unwrap: add ErrNull to handle Null returned, fix #2795
2024-11-22 14:19:46 +03:00
Ekaterina Pavlova
85c3b96f82
core: fix restoring chain with StateRootInHeader = true
...
Close #3597
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-22 13:33:50 +03:00
Roman Khimov
3d00a19383
unwrap: add ErrNull to handle Null returned, fix #2795
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-21 13:23:32 +03:00
Anna Shaleva
40dda9f524
*: extend basic testing chain documentation
...
Save some time for developers who are not familiar with RPC server
unit-test structure.
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-11-20 18:06:13 +03:00
Ekaterina Pavlova
b63c7aad73
rpcsrv: add NEP24 test
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-20 14:45:28 +03:00
Ekaterina Pavlova
8e99ff65e1
rpcsrv: update testdata/testblocks.acc
...
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-20 14:45:28 +03:00
Ekaterina Pavlova
b2bd8e4a0a
manifest: support NEP-24
...
Close #3451
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-20 14:45:28 +03:00
Ekaterina Pavlova
54e3708566
manifest: add Required
field to Standard
...
`Required` contains standards that are required for this standard.
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-20 14:45:28 +03:00
Roman Khimov
aba781c2de
waiter: remove compat code for block-based waiting
...
A part of #3454 for 0.107.0 release.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-19 22:23:00 +03:00
Roman Khimov
aeee733479
neorpc: remove deprecated error codes (as scheduled)
...
A part of #3454 .
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-19 21:47:27 +03:00
Roman Khimov
632092b2cd
network: drop deprecated serv_node_version metric
...
A part of #3454 .
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-19 21:43:08 +03:00
Roman Khimov
125f757988
state: drop compatibility code for NEOBalance
...
A part of #3454 .
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-19 21:40:01 +03:00
Roman Khimov
7683f4366d
result: drop obsolete unmarshaling code
...
A part of #3454 .
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-19 21:35:50 +03:00
Ekaterina Pavlova
9082c6ea1a
vm: fix PACKMAP operation
...
Close #3613
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-19 13:49:53 +03:00
Anna Shaleva
176593b31f
Merge pull request #3687 from nspcc-dev/extend-smartcontract-conversions
...
Extend smartcontract type conversions
2024-11-18 17:21:22 +03:00
Roman Khimov
db2956f1af
smartcontract: add support for maps in NewParameterFromValue
...
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>
2024-11-18 15:20:39 +03:00
Roman Khimov
22c6ab4de9
smartcontract: process slices via reflection in NewParameterFromValue
...
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>
2024-11-18 15:20:39 +03:00
Roman Khimov
270f0d2d7a
vm: fix incorrect refcounting in POPITEM
...
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>
2024-11-16 18:03:25 +03:00
Roman Khimov
a123b75fd9
io: no need to do ValueOf() again, it's known
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 22:29:06 +03:00
Roman Khimov
895a0ae624
Merge pull request #3677 from ixje/expose-slots
...
vm: make slots public
2024-11-15 13:16:48 +03:00
ixje
7ec0c1155c
vm: expose Context slots, hide Set/ClearRefs on Slot, deprecate Dump*Slot methods
...
Signed-off-by: ixje <erik@coz.io>
2024-11-15 11:05:42 +01:00
Roman Khimov
9cc16d73f2
core: a bit better field explanations for header/transaction
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 11:27:21 +03:00
Roman Khimov
933d522b82
block: explain protocol extensions better
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 11:27:21 +03:00
Roman Khimov
ccbb198a5b
core: document trimmed transactions better
...
Eventually we can drop them, but they were present for a long long time.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 11:27:21 +03:00
Roman Khimov
bbec25de43
block: document hash caching better
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 11:27:21 +03:00
Roman Khimov
7af2ab92d2
transaction: specify hash/size behavior better
...
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-15 11:27:21 +03:00
Ekaterina Pavlova
71a89c230a
*: remove range usage from smartcontracts
...
Reverting a part of 1b83dc2
, because ranging over integers is not
supported by smart contract compiler, ref. #3525 .
Close #3671
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-14 16:57:39 +03:00
Anna Shaleva
3ec06f316e
Merge pull request #3674 from ixje/remove-breakpoint
...
vm: add RemoveBreakPoint support
2024-11-14 12:42:57 +03:00
ixje
d8ea4103c7
cli: add delete and list break point commands
...
Close #3673
Signed-off-by: ixje <erik@coz.io>
2024-11-14 09:52:25 +01:00
Roman Khimov
8b12b3ac64
*: fix some dupword warnings
...
Duplicate words in comments.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-11-13 20:57:10 +03:00
Ekaterina Pavlova
0afd9ac0bb
rpcsrv: align default error code with C# implementation
...
We had 400, 405 and 500 in getHTTPCodeForError, but none is explicitly
set in C#.
1. **405 code** (unknown method, `neorpc.MethodNotFoundCode`). The
resulting HTTP code returned by C# server is 200 OK:
```
anna@kiwi:~/Documents/GitProjects/bane-labs/go-ethereum$ curl -v -d '{
"jsonrpc": "2.0", "id": 1, "method": "unknown-method", "params": [] }'
http://seed1t5.neo.org:20332 | json_pp
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0* Trying 34.133.235.69:20332...
* Connected to seed1t5.neo.org (34.133.235.69) port 20332 (#0 )
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0> POST / HTTP/1.1
> Host: seed1t5.neo.org:20332
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Length: 71
> Content-Type: application/x-www-form-urlencoded
>
} [71 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Tue, 12 Nov 2024 13:45:51 GMT
< Server: Kestrel
< Transfer-Encoding: chunked
<
{ [461 bytes data]
100 520 0 449 100 71 729 115 --:--:-- --:--:-- --:--:--
844
* Connection #0 to host seed1t5.neo.org left intact
{
"error" : {
"code" : -32601,
"data" : " at Neo.Plugins.Result.True_Or(Boolean result,
RpcError err)\n at Neo.Plugins.RpcServer.ProcessRequestAsync
(HttpContext context, JObject request)",
"message" : "Method not found - The method 'unknown-method'
doesn't exists. - at Neo.Plugins.Result.True_Or(Boolean result,
RpcError err)\n at Neo.Plugins.RpcServer.ProcessRequestAsync
(HttpContext context, JObject request)"
},
"id" : 1,
"jsonrpc" : "2.0"
}
```
2. **400 code** (malformed request, `neorpc.BadRequestCode`). The
resulting HTTP code returned by C# server is 200 OK:
```
anna@kiwi:~/Documents/GitProjects/bane-labs/go-ethereum$ curl -v -d '{
"jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["]
}' http://seed1t5.neo.org:20332 | json_pp
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0* Trying 34.133.235.69:20332...
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0* Connected to seed1t5.neo.org (34.133.235.69) port 20332 (#0 )
> POST / HTTP/1.1
> Host: seed1t5.neo.org:20332
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Length: 75
> Content-Type: application/x-www-form-urlencoded
>
} [75 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Tue, 12 Nov 2024 13:50:12 GMT
< Server: Kestrel
< Transfer-Encoding: chunked
<
{ [86 bytes data]
100 150 0 75 100 75 84 84 --:--:-- --:--:-- --:--:--
169
* Connection #0 to host seed1t5.neo.org left intact
{
"error" : {
"code" : -32700,
"message" : "Bad request"
},
"id" : null,
"jsonrpc" : "2.0"
}
```
3. **500 code** (internal server error, `neorpc
.InternalServerErrorCode`). It's difficult to reproduce this error on
real network for C# server, but the resulting code is expected to be the
same, 200 OK.
Close #3586
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-11-12 17:08:01 +03:00