Commit graph

7590 commits

Author SHA1 Message Date
Anna Shaleva
ec6fc54bc6 *: use nativehashes package where possible
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
2d3d52e3d0 native: add nativehashes package
Similar to nativenames, instantiate once and then reuse everywhere.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
82993dab2b core: extend error message for contract state check
It will give us a clue on what's wrong with contract states if something
unexpected happen.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
5c75ee13d0 config, native: introduce Cockatrice hard-fork
With all associated native API changes ported from
https://github.com/neo-project/neo/pull/2925 and
https://github.com/neo-project/neo/pull/3154.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
3a2e301267 native: make HF-specific MD cache less lazy
Initialize all necessary HF-specific contract descriptors once during
contract construction.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
d74dc368e0 core: unexport generic native contract methods and events
External users should use HF-specific methods and events.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:54 +03:00
Anna Shaleva
73c742a466 native: emit Deploy/Update notifications on native deploy/update
Ported as a part of https://github.com/neo-project/neo/pull/2942.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:26:53 +03:00
Anna Shaleva
d62fad1268 native: implement HF-based update
A part of #3213.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-25 13:16:42 +03:00
Roman Khimov
83fdcc8568
Merge pull request #3412 from NeoGoBros/fix-seq-points-after-shorten-jump 2024-04-18 14:24:07 +03:00
Slava0135
9b688a9ee9 compiler: reevaluate debug sequence points after shortening jumps
Signed-off-by: Slava0135 <super.novalskiy_0135@inbox.ru>
2024-04-16 10:37:06 +03:00
Roman Khimov
1786136a23
Merge pull request #3405 from nspcc-dev/dynamic-hash
cli: allow dynamic contract hash for contract bindings
2024-04-15 13:16:13 +03:00
Anna Shaleva
d3993ad54c
Merge pull request #3408 from nspcc-dev/hex-string-pub
crypto: add StringCompressed() for PublicKey
2024-04-15 12:31:18 +03:00
Anna Shaleva
db37101e34
Merge pull request #3413 from nspcc-dev/up-dbft
go.mod: import official dbft 0.2.0
2024-04-15 10:41:08 +03:00
Roman Khimov
567f9f9c6e go.mod: import official dbft 0.2.0
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-04-14 22:14:24 +03:00
Roman Khimov
fb4a4f074f
Merge pull request #3411 from nspcc-dev/improve-statediff-dumper
scripts: add contract ID/prefix parsing to state dump comparator
2024-04-11 21:23:36 +03:00
Anna Shaleva
97a19df6f0 scripts: add contract ID/prefix parsing to state dump comparator
I had this code locally for some time, let it be public.

The example output for key diff:
```
file BlockStorage_0/dump-block-0.json: block 0: key mismatch:
	Key: /////wz////4
	Contract ID: -1
	Item key (base64): DP////g=
	Item key (hex): 0cfffffff8
	Item key (bytes): [12 255 255 255 248]
vs
	Key: /////wz////5
	Contract ID: -1
	Item key (base64): DP////k=
	Item key (hex): 0cfffffff9
	Item key (bytes): [12 255 255 255 249]
```

The example output for state diff:
```
file BlockStorage_0/dump-block-0.json: block 0: state mismatch for key /////wz////4:
	Contract ID: -1
	Item key (base64): DP////g=
	Item key (hex): 0cfffffff8
	Item key (bytes): [12 255 255 255 248]
	Diff: Added vs Removed
```

The example output for value diff:
```
block 0: value mismatch for key /////wj1Y+pAvCg9TQ4FxI6jBbPyoHNA7w==:
	Contract ID: -1
	Item key (base64): CPVj6kC8KD1NDgXEjqMFs/Kgc0Dv
	Item key (hex): 08f563ea40bc283d4d0e05c48ea305b3f2a07340ef
	Item key (bytes): [8 245 99 234 64 188 40 61 77 14 5 196 142 163 5 179 242 160 115 64 239]
	Diff: QAUhAfshACgU9WPqQLwoPU0OBcSO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AAIQEgIQEjIAFBBSgMZ2V0Q29tbWl0dGVlQAAhASAhASogAUEFKA5nZXRHYXNQZXJCbG9ja0AAIQERIQExIAFBBSgWZ2V0TmV4dEJsb2NrVmFsaWRhdG9yc0AAIQEgIQE4IAFBBSgQZ2V0UmVnaXN0ZXJQcmljZUAAIQERIQE/IAFBBSgRcmVnaXN0ZXJDYW5kaWRhdGVAAUECKAZwdWJrZXkhARYhARAhAUYgAEEFKA5zZXRHYXNQZXJCbG9ja0ABQQIoC2dhc1BlckJsb2NrIQERIQL/ACEBTSAAQQUoEHNldFJlZ2lzdGVyUHJpY2VAAUECKA1yZWdpc3RlclByaWNlIQERIQL/ACEBVCAAQQUoBnN5bWJvbEAAIQETIQFbIAFBBSgLdG90YWxTdXBwbHlAACEBESEBYiABQQUoCHRyYW5zZmVyQARBAigEZnJvbSEBFEECKAJ0byEBFEECKAZhbW91bnQhARFBAigEZGF0YSEAIQEQIQFpIABBBSgMdW5jbGFpbWVkR2FzQAJBAigHYWNjb3VudCEBFEECKANlbmQhAREhAREhAXAgAUEFKBN1bnJlZ2lzdGVyQ2FuZGlkYXRlQAFBAigGcHVia2V5IQEWIQEQIQF3IABBBSgEdm90ZUACQQIoB2FjY291bnQhARRBAigGdm90ZVRvIQEWIQEQIQF+IABABEECKAhUcmFuc2ZlckADQQIoBGZyb20hARRBAigCdG8hARRBAigGYW1vdW50IQERQQIoFUNhbmRpZGF0ZVN0YXRlQ2hhbmdlZEADQQIoBnB1YmtleSEBFkECKApyZWdpc3RlcmVkIQEQQQIoBXZvdGVzIQERQQIoBFZvdGVABEECKAdhY2NvdW50IQEUQQIoBGZyb20hARZBAigCdG8hARZBAigGYW1vdW50IQERQQIoEENvbW1pdHRlZUNoYW5nZWRAAkECKANvbGQhASBBAigDbmV3IQEgQAFBAgAAQAAoBG51bGw=
```

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-11 19:27:57 +03:00
Ekaterina Pavlova
c5dbecb754 smartcontract: support dynamic contract hash for bindings
Allow dynamic contract hash for contract bindings.

Close #3007

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-11 16:02:31 +03:00
Ekaterina Pavlova
fc79d38ad2 crypto: adjust NewPublicKeyFromString's comment
Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-11 15:24:47 +03:00
Ekaterina Pavlova
ae3515e819 crypto: add StringCompressed() for PublicKey
Add StringCompressed to get a string representation of the key in
compressed form.

Close #3263

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-11 15:24:46 +03:00
Roman Khimov
8913542f93
Merge pull request #3410 from nspcc-dev/fix-cli-desc 2024-04-10 23:21:20 +03:00
Anna Shaleva
69bcd4b7d9 cli: unify commands description
Always put blank line in the end of the command description.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-10 19:21:40 +03:00
Anna Shaleva
51537dfd29
Merge pull request #3404 from stevvns/neotest-options
neotest: add options to customize test chain
2024-04-10 10:17:40 +03:00
Anna Shaleva
ee1ee56f97
Merge pull request #3409 from nspcc-dev/update-codecov
workflows: update CodeCov action, use token for upload
2024-04-09 14:56:34 +03:00
Roman Khimov
8c1d061446 workflows: update CodeCov action, use token for upload
It fails now without a token.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-04-09 13:39:11 +03:00
Anna Shaleva
a28e5b24b2
Merge pull request #3406 from nspcc-dev/error-message
native: adjust error message for ExecFeeFactor and StoragePrice
2024-04-09 10:59:03 +03:00
stevvns
7aa5983543 neotest: add options to customize test chain
Close #3403

Signed-off-by: stevvns <stevvns@yandex.com>
2024-04-09 09:18:36 +04:00
Ekaterina Pavlova
fcbfc3b807 native: adjust error message for ExecFeeFactor and StoragePrice
Close #3311

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-09 01:51:03 +03:00
Roman Khimov
cf49e8c4c8
Merge pull request #3401 from fyfyrchik/compiler-named-return-defaults
compiler: Initialize named returns to default values
2024-04-05 15:25:11 +03:00
Evgenii Stratonikov
78cefca5c9 compiler: Initialize named returns to default values
Make them behave as locals. We must initialize them at the start
because the default value could also be used inside the function body.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
2024-04-04 18:00:26 +03:00
Anna Shaleva
f2bb4d455b
Merge pull request #3389 from nspcc-dev/import-wallet-error
cli: improve wallet read related errors
2024-04-04 14:10:47 +03:00
Roman Khimov
f553f77d20
Merge pull request #3400 from nspcc-dev/fix-TestServerStartAndShutdown
network: take care of TestServerStartAndShutdown
2024-04-04 13:56:22 +03:00
Ekaterina Pavlova
700a550973 cli: improve wallet unmarshalling error
Made errors more user-friendly.
```
./bin/neo-go wallet import --wif qweqweqweqwe -w wallet1.json
failed to read wallet: open wallet: open wallet.json: no such file or
directory

touch wallet.json

./bin/neo-go wallet import --wif qweqweqweqwe -w wallet.json
failed to read wallet: unmarshal wallet: EOF
```

Close #3134

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-04 13:46:54 +03:00
Anna Shaleva
f84f072a29 network: take care of TestServerStartAndShutdown
We don't have a reliable way to know when transports are started since
their start is being performed in a separate goroutine:

927dbb6dc4/pkg/network/server.go (L297-L299)

And transports start is not connected with main server routine, thus,
just wait for some time for the transports goroutine to be started.

Also wait for the peer to be properly registered.

Close #3399.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-04 13:29:47 +03:00
Roman Khimov
927dbb6dc4
Merge pull request #3398 from nspcc-dev/enforce-testws-close 2024-04-04 13:12:38 +03:00
Anna Shaleva
e5c919f701 rpcsrv: enforce WS connection close on test cleanup
Do not wait until wsReader routine gracefully finishes its work before
WS connection close. Instead, firstly close the connection, and after
that wait for proper wsReader exit.

It's a harsh way, but I don't have any other options to try, because
wsReader routine hangs on `ws.ReadMessage()` operation for more than
ReadDeadline (more than 5 seconds) during test cleanup which results in
the test timeout.

Close #3378.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-04 12:03:06 +03:00
Roman Khimov
22af33a14e
Merge pull request #3397 from nspcc-dev/fix-TestWSClient_SubscriptionsCompat 2024-04-04 12:02:20 +03:00
Anna Shaleva
ef3ec190d0 rpcsrv: allow one-block slippage in TestWSClient_SubscriptionsCompat
Close #2956. The failure reason is similar to the one described in #3396
for TestNotary: Blockchain's notificationDispatcher is listening to
block events from storeBlock via separate channel. By the moment single
block addition is finished, notification may or may not be properly
handled by notificationDispatcher, especially given the fact that our
runners are slow. As a result, assert.Eventually with 1-second awaiting
period may fail. This issue is solved by adding one more block, because
the second AddBlock finishes only when it sends block addition event to
notificationDispatcher loop, which means that the previous event was
handled.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-04 11:02:15 +03:00
Anna Shaleva
b1a986fba8
Merge pull request #3386 from nspcc-dev/getversion
rpcsrv: add SessionEnabled, MaxIteratorResultItems to `getversion`
2024-04-04 10:38:09 +03:00
Roman Khimov
f6901806a8
Merge pull request #3396 from nspcc-dev/fix-TestNotary
services: allow some slippage in TestNotary
2024-04-03 23:26:00 +03:00
Ekaterina Pavlova
686c77aeea rpcsrv: add SessionEnabled, MaxIteratorResultItems to getversion
Extend getversion RPC response with RPC server settings (SessionEnabled,
MaxIteratorResultItems).Port neo-project/neo-modules#878.

Close #3276

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-03 22:42:14 +03:00
Anna Shaleva
89ef26164c
Merge pull request #3384 from nspcc-dev/TestWSClientsLimit
rpcsrv: fix TestWSClientsLimit
2024-04-03 20:01:18 +03:00
Anna Shaleva
4c288720cd services: allow some slippage in TestNotary
1. Allow 1-block slippage for multisignature request block generation to
   ensure that PostPersist for fb's NVB-th block is properly finished.
2. Allow 1-block slippage before sent request checks to ensure that
   PostPersist for NVB fb's NVB-th block was finished and all
   stale mains were properly marked by Notary service.

Overall, this commits ports the approach of #3390 to the whole test.

Close #3366.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-03 18:44:23 +03:00
Ekaterina Pavlova
f8c2d269fe rpcsrv: increase timeout in TestWSClientsLimit
Still not fast enough for connections to be alive for the default case
of 64+1 connections. Some of them are start to die after 5 seconds of
test:
```
2024-04-03T14:06:22.5504034Z === RUN   TestWSClientsLimit
2024-04-03T14:06:22.5504142Z === RUN   TestWSClientsLimit/default
2024-04-03T14:06:22.5504868Z     logger.go:146: 2024-04-03T14:04:30.637Z
	INFO	initial gas supply is not set or wrong, setting default
	value	{"InitialGASSupply": "52000000"}
2024-04-03T14:06:22.5505730Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	P2PNotaryRequestPayloadPool size is not set or wrong,
setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
2024-04-03T14:06:22.5506373Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxBlockSize is not set or wrong, setting default
value	{"MaxBlockSize": 262144}
2024-04-03T14:06:22.5507094Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxBlockSystemFee is not set or wrong, setting default
 value	{"MaxBlockSystemFee": 900000000000}
2024-04-03T14:06:22.5507843Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxTransactionsPerBlock is not set or wrong, using
default value	{"MaxTransactionsPerBlock": 512}
2024-04-03T14:06:22.5508644Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxValidUntilBlockIncrement is not set or wrong, using
 default value	{"MaxValidUntilBlockIncrement": 5760}
2024-04-03T14:06:22.5509114Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	no storage version found! creating genesis block
2024-04-03T14:06:22.5509788Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	ExtensiblePoolSize is not set or wrong, using default
value	{"ExtensiblePoolSize": 20}
2024-04-03T14:06:22.5510476Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	SessionPoolSize is not set or wrong, setting default
value	{"SessionPoolSize": 20}
2024-04-03T14:06:22.5511258Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxIteratorResultItems is not set or wrong, setting
default value	{"MaxIteratorResultItems": 100}
2024-04-03T14:06:22.5511951Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxFindResultItems is not set or wrong, setting
default value	{"MaxFindResultItems": 100}
2024-04-03T14:06:22.5512598Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxNEP11Tokens is not set or wrong, setting default
value	{"MaxNEP11Tokens": 100}
2024-04-03T14:06:22.5513316Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxRequestBodyBytes is not set or wong, setting
default value	{"MaxRequestBodyBytes": 5242880}
2024-04-03T14:06:22.5514060Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxRequestHeaderBytes is not set or wong, setting
default value	{"MaxRequestHeaderBytes": 1048576}
2024-04-03T14:06:22.5514755Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	MaxWebSocketClients is not set or wrong, setting
default value	{"MaxWebSocketClients": 64}
2024-04-03T14:06:22.5515215Z     logger.go:146: 2024-04-03T14:04:30
.637Z	INFO	starting rpc-server	{"endpoint": "127.0.0.1:0"}
2024-04-03T14:06:22.5515874Z     logger.go:146: 2024-04-03T14:04:31
.200Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5516442Z     logger.go:146: 2024-04-03T14:04:31
.200Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5516973Z     logger.go:146: 2024-04-03T14:04:31
.226Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5517502Z     logger.go:146: 2024-04-03T14:04:31
.388Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5518027Z     logger.go:146: 2024-04-03T14:04:31
.398Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5518551Z     logger.go:146: 2024-04-03T14:04:31
.420Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5519082Z     logger.go:146: 2024-04-03T14:04:31
.577Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5519606Z     logger.go:146: 2024-04-03T14:04:31
.587Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5520133Z     logger.go:146: 2024-04-03T14:04:31
.624Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5520850Z     logger.go:146: 2024-04-03T14:04:31
.780Z	INFO	persisted to disk	{"blocks": 0, "keys": 127,
"headerHeight": 0, "blockHeight": 0, "took": "121.8µs"}
2024-04-03T14:06:22.5521398Z     logger.go:146: 2024-04-03T14:04:31
.780Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5521925Z     logger.go:146: 2024-04-03T14:04:31
.812Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5522452Z     logger.go:146: 2024-04-03T14:04:31
.969Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5522975Z     logger.go:146: 2024-04-03T14:04:32
.016Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5523507Z     logger.go:146: 2024-04-03T14:04:32
.172Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5524033Z     logger.go:146: 2024-04-03T14:04:32
.219Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5524555Z     logger.go:146: 2024-04-03T14:04:32
.273Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5525081Z     logger.go:146: 2024-04-03T14:04:32
.376Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5525604Z     logger.go:146: 2024-04-03T14:04:32
.423Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5526131Z     logger.go:146: 2024-04-03T14:04:32
.563Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5526691Z     logger.go:146: 2024-04-03T14:04:32
.627Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5527254Z     logger.go:146: 2024-04-03T14:04:32
.767Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5527777Z     logger.go:146: 2024-04-03T14:04:32
.830Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5528304Z     logger.go:146: 2024-04-03T14:04:32
.955Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5528824Z     logger.go:146: 2024-04-03T14:04:33
.033Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5529352Z     logger.go:146: 2024-04-03T14:04:33
.158Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5529871Z     logger.go:146: 2024-04-03T14:04:33
.237Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5530395Z     logger.go:146: 2024-04-03T14:04:33
.322Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5530921Z     logger.go:146: 2024-04-03T14:04:33
.348Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5531472Z     logger.go:146: 2024-04-03T14:04:33
.444Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5532031Z     logger.go:146: 2024-04-03T14:04:33
.535Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5532555Z     logger.go:146: 2024-04-03T14:04:33
.645Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5533084Z     logger.go:146: 2024-04-03T14:04:33
.724Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5533604Z     logger.go:146: 2024-04-03T14:04:33
.848Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5534132Z     logger.go:146: 2024-04-03T14:04:33
.926Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5534662Z     logger.go:146: 2024-04-03T14:04:34
.036Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5535190Z     logger.go:146: 2024-04-03T14:04:34
.130Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5535712Z     logger.go:146: 2024-04-03T14:04:34
.224Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5536231Z     logger.go:146: 2024-04-03T14:04:34
.318Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5536758Z     logger.go:146: 2024-04-03T14:04:34
.413Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5537277Z     logger.go:146: 2024-04-03T14:04:34
.423Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5537805Z     logger.go:146: 2024-04-03T14:04:34
.423Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5538329Z     logger.go:146: 2024-04-03T14:04:34
.523Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5538855Z     logger.go:146: 2024-04-03T14:04:34
.602Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5539382Z     logger.go:146: 2024-04-03T14:04:34
.612Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5539908Z     logger.go:146: 2024-04-03T14:04:34
.712Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5540431Z     logger.go:146: 2024-04-03T14:04:34
.805Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5540956Z     logger.go:146: 2024-04-03T14:04:34
.915Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5541515Z     logger.go:146: 2024-04-03T14:04:34
.993Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5542070Z     logger.go:146: 2024-04-03T14:04:35
.118Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5542599Z     logger.go:146: 2024-04-03T14:04:35
.181Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5543125Z     logger.go:146: 2024-04-03T14:04:35
.307Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5543650Z     logger.go:146: 2024-04-03T14:04:35
.385Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5544169Z     logger.go:146: 2024-04-03T14:04:35
.426Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5544695Z     logger.go:146: 2024-04-03T14:04:35
.510Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5545262Z     logger.go:146: 2024-04-03T14:04:35
.589Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5545839Z     logger.go:146: 2024-04-03T14:04:35
.698Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5546421Z     logger.go:146: 2024-04-03T14:04:35
.777Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5547045Z     logger.go:146: 2024-04-03T14:04:35
.902Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5547593Z     logger.go:146: 2024-04-03T14:04:35
.980Z	DEBUG	processing rpc request	{"method": "getversion",
"params": "[]"}
2024-04-03T14:06:22.5551421Z     subscription_test.go:620:
2024-04-03T14:06:22.5551977Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:620
2024-04-03T14:06:22.5552611Z
C:/hostedtoolcache/windows/go/1.22.1/x64/src/runtime/asm_amd64.s:1695
2024-04-03T14:06:22.5552821Z         	Error:      	Received
unexpected error:
2024-04-03T14:06:22.5553328Z         	            	read tcp 127.0
.0.1:51969->127.0.0.1:51909: i/o timeout
2024-04-03T14:06:22.5553535Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5553676Z     subscription_test.go:620:
2024-04-03T14:06:22.5554223Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:620
2024-04-03T14:06:22.5554831Z
C:/hostedtoolcache/windows/go/1.22.1/x64/src/runtime/asm_amd64.s:1695
2024-04-03T14:06:22.5555036Z         	Error:      	Received
unexpected error:
2024-04-03T14:06:22.5555521Z         	            	read tcp 127.0
.0.1:51970->127.0.0.1:51909: i/o timeout
2024-04-03T14:06:22.5555723Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5555860Z     subscription_test.go:620:
2024-04-03T14:06:22.5556336Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:620
2024-04-03T14:06:22.5556953Z
C:/hostedtoolcache/windows/go/1.22.1/x64/src/runtime/asm_amd64.s:1695
2024-04-03T14:06:22.5557160Z         	Error:      	Received
unexpected error:
2024-04-03T14:06:22.5557636Z         	            	read tcp 127.0
.0.1:51973->127.0.0.1:51909: i/o timeout
2024-04-03T14:06:22.5557831Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5557967Z     subscription_test.go:620:
2024-04-03T14:06:22.5558437Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:620
2024-04-03T14:06:22.5559028Z
C:/hostedtoolcache/windows/go/1.22.1/x64/src/runtime/asm_amd64.s:1695
2024-04-03T14:06:22.5559229Z         	Error:      	Received
unexpected error:
2024-04-03T14:06:22.5559696Z         	            	read tcp 127.0
.0.1:51971->127.0.0.1:51909: i/o timeout
2024-04-03T14:06:22.5559891Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5560024Z     subscription_test.go:620:
2024-04-03T14:06:22.5560490Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:620
2024-04-03T14:06:22.5561142Z
C:/hostedtoolcache/windows/go/1.22.1/x64/src/runtime/asm_amd64.s:1695
2024-04-03T14:06:22.5561371Z         	Error:      	Received
unexpected error:
2024-04-03T14:06:22.5561849Z         	            	read tcp 127.0
.0.1:51972->127.0.0.1:51909: i/o timeout
2024-04-03T14:06:22.5562043Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5562179Z     subscription_test.go:630:
2024-04-03T14:06:22.5562638Z         	Error Trace:
D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:630
2024-04-03T14:06:22.5562879Z         	Error:      	An error is
expected but got nil.
2024-04-03T14:06:22.5563073Z         	Test:
TestWSClientsLimit/default
2024-04-03T14:06:22.5563361Z         	Messages:   	The connection
 beyond the limit should fail
2024-04-03T14:06:22.5563886Z     logger.go:146: 2024-04-03T14:04:36
.481Z	INFO	shutting down RPC server	{"endpoint": "127.0.0
.1:51908"}
```

Close #3379

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-03 18:03:55 +03:00
Ekaterina Pavlova
698bdc7eea rpcsrv: fix TestWSClientsLimit
Made connections in parallel to check the limit and attempt to make one
more connection beyond the limit. Only "default" test case is failing,
because default number of connections is 64 (quite large for slow
runners). The failure reason is:
* given ~1 second for [dealing + request] per connection (time is taken
from the test log)
* by the moment 65-th connection is reached, some connections from the
start of the test have died due to inactivity (this process literally
takes 1 minute)

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-04-03 18:03:55 +03:00
Roman Khimov
0280ceefe6
Merge pull request #3395 from nspcc-dev/fix-awaitabletxtest
cli: ensure all outcomes are handled in TestAwaitUtilCancelTx
2024-04-03 17:55:35 +03:00
Anna Shaleva
b6a9c64c55 cli: ensure all outcomes are handled in TestAwaitUtilCancelTx
Close #3365.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-03 16:40:11 +03:00
Roman Khimov
be1b97d04e
Merge pull request #3392 from nspcc-dev/adjust-deadlines
*: adjust WS connection RW deadlines
2024-04-03 14:50:14 +03:00
Anna Shaleva
29deba45ca services: refactor test WS reader
1. Replace isFinished atomic variable with a channel, no functional changes
   here, just use more common way as all our services do.

2. Do not check erors from SetReadDeadline and ReadMessage on exit. It
   seems to be not quite right because connection is not closed by this
   moment, and thus, these error checks are racy.
3. Add read timeout for the message reader. It is needed because some
   tests may leave message unread in the end which results in hanging
   test cleanup.
4. Add drain loop to message reader in order not to block WS reader on
   sending message.

Ref. https://github.com/nspcc-dev/neo-go/pull/3392#issuecomment-2031590403.
It's clear that TestBadSubUnsub is hanging on test cleanup, in
particular, on attempt to wait for wsRead routine to exit. The only
place where wsRead routine may hang is sending to msgCh in case if
receiver is not going to read from this channel:
```
2024-04-02T08:14:51.4957621Z goroutine 14329 [chan receive]:
2024-04-02T08:14:51.4958010Z github.com/nspcc-dev/neo-go/pkg/services/rpcsrv.initCleanServerAndWSClient.func1()
2024-04-02T08:14:51.4958344Z 	D:/a/neo-go/neo-go/pkg/services/rpcsrv/subscription_test.go:80 +0x71
2024-04-02T08:14:51.4958457Z testing.(*common).Cleanup.func1()
2024-04-02T08:14:51.4958757Z 	C:/hostedtoolcache/windows/go/1.22.1/x64/src/testing/testing.go:1175 +0x17a
2024-04-02T08:14:51.4958903Z testing.(*common).runCleanup(0xc002cf5860, 0x0)
2024-04-02T08:14:51.4959193Z 	C:/hostedtoolcache/windows/go/1.22.1/x64/src/testing/testing.go:1353 +0x262
2024-04-02T08:14:51.4959291Z testing.tRunner.func2()
2024-04-02T08:14:51.4959566Z 	C:/hostedtoolcache/windows/go/1.22.1/x64/src/testing/testing.go:1683 +0x51
2024-04-02T08:14:51.4959695Z testing.tRunner(0xc002cf5860, 0x141687410)
2024-04-02T08:14:51.4959976Z 	C:/hostedtoolcache/windows/go/1.22.1/x64/src/testing/testing.go:1695 +0x25e
2024-04-02T08:14:51.4960115Z created by testing.(*T).Run in goroutine 1
2024-04-02T08:14:51.4960385Z 	C:/hostedtoolcache/windows/go/1.22.1/x64/src/testing/testing.go:1742 +0x826
```

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-04-03 12:56:07 +03:00
Anna Shaleva
c81ed22698
Merge pull request #3394 from nspcc-dev/better-notary-actor
rpcclient: make default Notary actor options customizable
2024-04-03 11:02:24 +03:00
Anna Shaleva
c5ba53986f
Merge pull request #3385 from nspcc-dev/findstorage
rpcsrv: fix findstorage if a contract state is not found
2024-04-03 11:00:55 +03:00