Commit graph

5984 commits

Author SHA1 Message Date
Roman Khimov
9987afea4c storage: move DB configuration into a package on its own
Lightweight thing to import anywhere, pkg/config should not be dependent on
Level/Bolt/anything else.
2022-07-08 23:30:30 +03:00
Roman Khimov
dc59dc991b config: move metrics.Config into config.BasicService
Config package should be as lightweight as possible and now it depends on the
whole metrics package just to get one structure from it.
2022-07-08 23:30:30 +03:00
Roman Khimov
fab8dfb9f8 vm: move State type into a package of its own
It's used a lot in other places that need it, but don't need whole VM at the
same time.
2022-07-08 18:34:52 +03:00
Roman Khimov
4333ad4949 result: drop NewBlock/NewHeader/LedgerAux
Client's don't care about any of these.
2022-07-08 18:32:31 +03:00
Roman Khimov
04fc737e2e rpc: drop NewTransactionOutputRaw, move it server-side 2022-07-08 18:30:01 +03:00
Roman Khimov
aa338b7960
Merge pull request #2585 from nspcc-dev/move-rpc-code
Move request-related RPC code
2022-07-08 18:25:50 +03:00
Roman Khimov
9462ed71d8 rpc: drop useless RawParams type
It doesn't add anything useful to regular Go types and actually native types
are always better to use in the Client. Especially given that this type is
not used by any code outside of the Client itself.
2022-07-08 17:56:20 +03:00
Roman Khimov
113cb0fac3 rpc: rename RawParams to Params in Raw, add comments
We've got parameters here and usually we name them Raw when they're
represented by json.RawMessage which is not the case here, so make it a bit
more friendly (the type itself is only used in client internals, so rename is
not a huge problem).
2022-07-08 17:38:56 +03:00
Roman Khimov
9aecfb7c94 rpc/client: correct ID unmarshaling in wsclient
We always use uint64 IDs in the client, so we should parse them as such and
not just ints that then are casted to uint64.
2022-07-08 17:38:56 +03:00
Roman Khimov
adab83496c rpc: move Request, Params and related code server-side
It's absolutely irrelevant for the client and request/response packages should
only contain code that is useful on both sides of the conversation. It's OK
for client tests to reuse this code, but the package is used by external
developers and they shouldn't be bothered with it. Nothing changed
functionally here except WSClient simplification. Fixes #2236.
2022-07-08 17:38:53 +03:00
Roman Khimov
bbeef6ec24
Merge pull request #2555 from nspcc-dev/rpc/sessions
rpc: implement iterator sessions
2022-07-08 17:29:19 +03:00
Anna Shaleva
0117581e5c rpc: add implementation note about iterator sessions 2022-07-08 17:16:29 +03:00
Anna Shaleva
ef114d6274 rpc: fail invoke.Result unmarshalling on stack unmarshalling error 2022-07-08 17:05:18 +03:00
Anna Shaleva
445cca114a rpc: restrict the amount of concurrently running iterator sessions 2022-07-08 17:05:18 +03:00
Anna Shaleva
8f73ce08c8 rpc: move session maintenance related code out of the result.Invoke
It's server who should be responsible for iterator ID creation and
iterator registration.
2022-07-08 17:05:18 +03:00
Anna Shaleva
4581cc386b rpc: restrict max number of iterator items for createIteratorUnwrapperScript 2022-07-08 17:05:18 +03:00
Anna Shaleva
9bdd8151af rpc: restrict (*Client).TraverseIterator with single RPC call
Do not unwrap the whole set of iterator values even on demand.
2022-07-08 17:05:18 +03:00
Anna Shaleva
fad061f3d9 rpc: extend iterator-related client functionality
Create a set of functions that are able to work with both session-based
iterators, default unpacked iterators and client-side unpacked
iterators.
2022-07-08 17:05:18 +03:00
Anna Shaleva
47ffc1f3e8 rpc: restrict default SessionExpirationTime 2022-07-08 17:05:18 +03:00
Anna Shaleva
b5d39a3ffd rpc: add configuration extension for MPT-backed iterator sessions
Add ability to switch between current blockchain storage and MPT-backed
storage for iterator traversing process. It may be useful because
iterator implementation traverses underlying backed storage (BoltDB,
LevelDB) inside DB's Seek which is blocking operation for BoltDB:
```
Opening a read transaction and a write transaction in the same goroutine
can cause the writer to deadlock because the database periodically needs
to re-mmap itself as it grows and it cannot do that while a read transaction
is open.

If a long running read transaction (for example, a snapshot transaction)
is needed, you might want to set DB.InitialMmapSize to a large enough
value to avoid potential blocking of write transaction.
```

So during bbolt re-mmaping, standard blockchain DB operations (i.e. persist)
can be blocked until iterator resourses release. The described behaviour
is tested and confirmed on four-nodes privnet with BoltDB and
`SessionExpirationTime` set to be 180 seconds. After new iterator session
is added to the server, the subsequent persist took ~5m21s, see the log
record `2022-06-17T18:58:21.563+0300`:

```
anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ ./bin/neo-go node -p
2022-06-17T18:52:21.535+0300	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
2022-06-17T18:52:21.535+0300	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
2022-06-17T18:52:21.535+0300	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
2022-06-17T18:52:21.535+0300	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
2022-06-17T18:52:21.535+0300	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 5760}
2022-06-17T18:52:21.535+0300	INFO	Hardforks are not set, using default value
2022-06-17T18:52:21.543+0300	INFO	no storage version found! creating genesis block
2022-06-17T18:52:21.546+0300	INFO	ExtensiblePoolSize is not set or wrong, using default value	{"ExtensiblePoolSize": 20}
2022-06-17T18:52:21.546+0300	INFO	service is running	{"service": "Prometheus", "endpoint": ":2112"}
2022-06-17T18:52:21.547+0300	INFO	starting rpc-server	{"endpoint": ":20331"}
2022-06-17T18:52:21.547+0300	INFO	rpc-server iterator sessions are enabled
2022-06-17T18:52:21.547+0300	INFO	service hasn't started since it's disabled	{"service": "Pprof"}
2022-06-17T18:52:21.547+0300	INFO	node started	{"blockHeight": 0, "headerHeight": 0}

    _   ____________        __________
   / | / / ____/ __ \      / ____/ __ \
  /  |/ / __/ / / / /_____/ / __/ / / /
 / /|  / /___/ /_/ /_____/ /_/ / /_/ /
/_/ |_/_____/\____/      \____/\____/

/NEO-GO:0.99.1-pre-53-g7ccb646e/

2022-06-17T18:52:21.548+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 1}
2022-06-17T18:52:21.550+0300	INFO	started protocol	{"addr": "127.0.0.1:20336", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 65, "id": 1475228436}
2022-06-17T18:52:22.575+0300	INFO	persisted to disk	{"blocks": 65, "keys": 1410, "headerHeight": 65, "blockHeight": 65, "took": "28.193409ms"}
2022-06-17T18:52:24.548+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 2}
2022-06-17T18:52:24.548+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 3}
2022-06-17T18:52:24.548+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 4}
2022-06-17T18:52:24.549+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 5}
2022-06-17T18:52:24.549+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 6}
2022-06-17T18:52:24.549+0300	INFO	started protocol	{"addr": "127.0.0.1:20333", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 65, "id": 3444438498}
2022-06-17T18:52:24.549+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 7}
2022-06-17T18:52:24.549+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 8}
2022-06-17T18:52:24.550+0300	INFO	node reached synchronized state, starting services
2022-06-17T18:52:24.550+0300	INFO	started protocol	{"addr": "127.0.0.1:20334", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 65, "id": 2435677826}
2022-06-17T18:52:24.550+0300	INFO	starting state validation service
2022-06-17T18:52:24.550+0300	INFO	RPC server already started
2022-06-17T18:52:24.550+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 9}
2022-06-17T18:52:24.550+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 10}
2022-06-17T18:52:24.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 9}
2022-06-17T18:52:24.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 8}
2022-06-17T18:52:24.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 7}
2022-06-17T18:52:24.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "unexpected empty payload: CMDVersion", "peerCount": 6}
2022-06-17T18:52:24.550+0300	INFO	started protocol	{"addr": "127.0.0.1:20335", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 65, "id": 970555896}
2022-06-17T18:52:24.551+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 7}
2022-06-17T18:52:24.551+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "unexpected empty payload: CMDVersion", "peerCount": 6}
2022-06-17T18:52:24.551+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "unexpected empty payload: CMDVersion", "peerCount": 5}
2022-06-17T18:52:24.551+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 4}
2022-06-17T18:52:29.564+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 66, "blockHeight": 66, "took": "12.51808ms"}
2022-06-17T18:52:44.558+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 67, "blockHeight": 67, "took": "1.563137ms"}
2022-06-17T18:55:21.549+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "ping/pong timeout", "peerCount": 3}
2022-06-17T18:55:21.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "ping/pong timeout", "peerCount": 2}
2022-06-17T18:55:21.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "ping/pong timeout", "peerCount": 1}
2022-06-17T18:55:21.550+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "ping/pong timeout", "peerCount": 0}
2022-06-17T18:55:21.553+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 1}
2022-06-17T18:55:21.554+0300	INFO	started protocol	{"addr": "127.0.0.1:20335", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 77, "id": 970555896}
2022-06-17T18:55:24.554+0300	INFO	new peer connected	{"addr": "172.200.0.4:20333", "peerCount": 2}
2022-06-17T18:55:24.555+0300	INFO	new peer connected	{"addr": "172.200.0.3:20334", "peerCount": 3}
2022-06-17T18:55:24.555+0300	INFO	new peer connected	{"addr": "10.78.13.84:59876", "peerCount": 4}
2022-06-17T18:55:24.555+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 5}
2022-06-17T18:55:24.556+0300	INFO	new peer connected	{"addr": "172.200.0.254:20332", "peerCount": 6}
2022-06-17T18:55:24.556+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 7}
2022-06-17T18:55:24.556+0300	INFO	started protocol	{"addr": "172.200.0.4:20333", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 76, "id": 3444438498}
2022-06-17T18:55:24.556+0300	INFO	new peer connected	{"addr": "172.200.0.1:20335", "peerCount": 8}
2022-06-17T18:55:24.558+0300	INFO	started protocol	{"addr": "127.0.0.1:20336", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 77, "id": 1475228436}
2022-06-17T18:55:24.559+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 9}
2022-06-17T18:55:24.558+0300	INFO	started protocol	{"addr": "172.200.0.3:20334", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 77, "id": 2435677826}
2022-06-17T18:55:24.559+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 10}
2022-06-17T18:55:24.559+0300	WARN	peer disconnected	{"addr": "172.200.0.1:20335", "error": "unexpected empty payload: CMDVersion", "peerCount": 9}
2022-06-17T18:55:24.559+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 10}
2022-06-17T18:55:24.560+0300	INFO	new peer connected	{"addr": "172.200.0.2:20336", "peerCount": 11}
2022-06-17T18:55:24.560+0300	WARN	peer disconnected	{"addr": "172.200.0.254:20332", "error": "identical node id", "peerCount": 10}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "already connected", "peerCount": 9}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 10}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "10.78.13.84:59876", "error": "unexpected empty payload: CMDVersion", "peerCount": 9}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 8}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 9}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "unexpected empty payload: CMDVersion", "peerCount": 8}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 9}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "unexpected empty payload: CMDVersion", "peerCount": 8}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "172.200.0.2:20336", "error": "unexpected empty payload: CMDVersion", "peerCount": 7}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 8}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 9}
2022-06-17T18:55:24.561+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 8}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 9}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 10}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 11}
2022-06-17T18:55:24.561+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 12}
2022-06-17T18:55:24.562+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "already connected", "peerCount": 11}
2022-06-17T18:55:24.562+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 12}
2022-06-17T18:55:24.562+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 13}
2022-06-17T18:55:24.562+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 12}
2022-06-17T18:55:24.562+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 11}
2022-06-17T18:55:24.562+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 10}
2022-06-17T18:55:24.562+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "unexpected empty payload: CMDVersion", "peerCount": 9}
2022-06-17T18:55:24.563+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 10}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 9}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "unexpected empty payload: CMDVersion", "peerCount": 8}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 7}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "max peers reached", "peerCount": 6}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 5}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "max peers reached", "peerCount": 4}
2022-06-17T18:55:24.563+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 3}
2022-06-17T18:57:21.551+0300	WARN	peer disconnected	{"addr": "172.200.0.4:20333", "error": "ping/pong timeout", "peerCount": 2}
2022-06-17T18:57:21.552+0300	WARN	peer disconnected	{"addr": "172.200.0.3:20334", "error": "ping/pong timeout", "peerCount": 1}
2022-06-17T18:57:21.552+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "ping/pong timeout", "peerCount": 0}
2022-06-17T18:57:21.553+0300	INFO	new peer connected	{"addr": "172.200.0.4:20333", "peerCount": 1}
2022-06-17T18:57:21.554+0300	INFO	new peer connected	{"addr": "10.78.13.84:20332", "peerCount": 2}
2022-06-17T18:57:21.555+0300	INFO	started protocol	{"addr": "172.200.0.4:20333", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 82, "id": 3444438498}
2022-06-17T18:57:21.556+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 3}
2022-06-17T18:57:21.556+0300	INFO	new peer connected	{"addr": "10.78.13.84:46076", "peerCount": 4}
2022-06-17T18:57:21.556+0300	INFO	new peer connected	{"addr": "172.200.0.1:20335", "peerCount": 5}
2022-06-17T18:57:21.556+0300	INFO	new peer connected	{"addr": "172.200.0.254:20332", "peerCount": 6}
2022-06-17T18:57:21.556+0300	INFO	new peer connected	{"addr": "10.78.13.84:59972", "peerCount": 7}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 8}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 9}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "172.200.0.2:20336", "peerCount": 10}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 11}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 12}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "172.200.0.3:20334", "peerCount": 13}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 14}
2022-06-17T18:57:21.557+0300	INFO	started protocol	{"addr": "127.0.0.1:20334", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 82, "id": 2435677826}
2022-06-17T18:57:21.557+0300	WARN	peer disconnected	{"addr": "172.200.0.2:20336", "error": "max peers reached", "peerCount": 13}
2022-06-17T18:57:21.557+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 14}
2022-06-17T18:57:21.558+0300	INFO	started protocol	{"addr": "172.200.0.1:20335", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 82, "id": 970555896}
2022-06-17T18:57:21.558+0300	WARN	peer disconnected	{"addr": "172.200.0.254:20332", "error": "identical node id", "peerCount": 13}
2022-06-17T18:57:21.558+0300	INFO	new peer connected	{"addr": "127.0.0.1:20334", "peerCount": 14}
2022-06-17T18:57:21.558+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "max peers reached", "peerCount": 13}
2022-06-17T18:57:21.558+0300	WARN	peer disconnected	{"addr": "10.78.13.84:46076", "error": "identical node id", "peerCount": 12}
2022-06-17T18:57:21.558+0300	INFO	new peer connected	{"addr": "127.0.0.1:20333", "peerCount": 13}
2022-06-17T18:57:21.558+0300	INFO	new peer connected	{"addr": "127.0.0.1:20335", "peerCount": 14}
2022-06-17T18:57:21.558+0300	INFO	new peer connected	{"addr": "127.0.0.1:20336", "peerCount": 15}
2022-06-17T18:57:21.558+0300	WARN	peer disconnected	{"addr": "10.78.13.84:59972", "error": "identical node id", "peerCount": 14}
2022-06-17T18:57:21.558+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 13}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "10.78.13.84:20332", "error": "unexpected empty payload: CMDVersion", "peerCount": 12}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 11}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "172.200.0.3:20334", "error": "unexpected empty payload: CMDVersion", "peerCount": 10}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "unexpected empty payload: CMDVersion", "peerCount": 9}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20334", "error": "already connected", "peerCount": 8}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "unexpected empty payload: CMDVersion", "peerCount": 7}
2022-06-17T18:57:21.559+0300	INFO	started protocol	{"addr": "127.0.0.1:20336", "userAgent": "/NEO-GO:0.99.1-pre-53-g7ccb646e/", "startHeight": 82, "id": 1475228436}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20333", "error": "already connected", "peerCount": 6}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20335", "error": "already connected", "peerCount": 5}
2022-06-17T18:57:21.559+0300	WARN	peer disconnected	{"addr": "127.0.0.1:20336", "error": "already connected", "peerCount": 4}
2022-06-17T18:58:21.561+0300	INFO	persisted to disk	{"blocks": 1, "keys": 20, "headerHeight": 68, "blockHeight": 68, "took": "5m21.993873018s"}
2022-06-17T18:58:21.563+0300	INFO	persisted to disk	{"blocks": 8, "keys": 111, "headerHeight": 76, "blockHeight": 76, "took": "2.243347ms"}
2022-06-17T18:58:22.567+0300	INFO	persisted to disk	{"blocks": 10, "keys": 135, "headerHeight": 86, "blockHeight": 86, "took": "5.637669ms"}
2022-06-17T18:58:25.565+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 87, "blockHeight": 87, "took": "1.879912ms"}
2022-06-17T18:58:40.572+0300	INFO	persisted to disk	{"blocks": 1, "keys": 20, "headerHeight": 88, "blockHeight": 88, "took": "1.560317ms"}
2022-06-17T18:58:55.579+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 89, "blockHeight": 89, "took": "1.925225ms"}
2022-06-17T18:59:10.587+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 90, "blockHeight": 90, "took": "3.118073ms"}
2022-06-17T18:59:25.592+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 91, "blockHeight": 91, "took": "1.607248ms"}
2022-06-17T18:59:40.600+0300	INFO	persisted to disk	{"blocks": 1, "keys": 20, "headerHeight": 92, "blockHeight": 92, "took": "931.806µs"}
2022-06-17T18:59:55.610+0300	INFO	persisted to disk	{"blocks": 1, "keys": 19, "headerHeight": 93, "blockHeight": 93, "took": "2.019041ms"}

```
2022-07-08 17:05:18 +03:00
Anna Shaleva
cbd20eb959 rpc: implement iterator sessions 2022-07-08 17:05:18 +03:00
Roman Khimov
34ddc99a08
Merge pull request #2583 from nspcc-dev/getblock-sr
Stateroot-enabled GetBlock
2022-07-08 10:00:16 +03:00
Roman Khimov
251c9bd89b block: push PrevStateRoot data into stack item, fix #2551
And add compiler/interop support for this.
2022-07-07 15:10:29 +03:00
Roman Khimov
6deb77a77a compiler: make interface{}() conversions possible 2022-07-07 15:10:29 +03:00
Roman Khimov
ec3d1fae59 compiler: allow to find appropriate methods via selectors
c.funcs contains function names using base types, while methods can be defined
on pointers and the value returned from c.getFuncNameFromSelector will have an
asterisk. We can't have the same name used for (*T) and (T) methods, so just
stripping the asterisk allows to get the right one.
2022-07-07 15:10:29 +03:00
Roman Khimov
b57dd2cad6 compiler: properly inline methods, use receiver
Notice that this doesn't differentiate between (*T) and (T) receivers always
treating them as is. But we have the same problem with arguments now and the
number of inlined calls is limited, usually we want this behavior.
2022-07-07 15:10:29 +03:00
Roman Khimov
6014dd720f compiler: don't push X onto the stack for inlined method calls
Regular methods need this, because it'll be packed into parameters, but
inlined ones should deal with it in inlining code itself because method
receiver will be some local (aliased) variable anyway.
2022-07-06 18:18:21 +03:00
Roman Khimov
2ba9017207
Merge pull request #2581 from nspcc-dev/sym-dec-in-getnep17balances
rpc: add decimals/name/symbol data to getNEPXXBalance
2022-07-05 12:45:50 +03:00
Roman Khimov
ccc820505d
Merge pull request #2554 from nspcc-dev/improve-ws-err
rpc: adjust cases when WS connection close error is returned
2022-07-05 12:45:31 +03:00
Roman Khimov
3fbc1331aa
Merge pull request #2582 from nspcc-dev/fix-server-sync
network: adjust the way (*Server).IsInSync() works
2022-07-05 12:28:20 +03:00
Roman Khimov
9f05009d1a
Merge pull request #2580 from nspcc-dev/service-review
Service review
2022-07-05 12:23:25 +03:00
Anna Shaleva
0835581fa9 network: adjust the way (*Server).IsInSync() works
Always return true if sync was reached once. Fix #2564.
2022-07-05 12:20:31 +03:00
Anna Shaleva
8f53c7d78a rpc: adjust cases when WS connection close error is returned
Do not return error in case of (*WSClient).Close() method was the
initiator of connection closing.
2022-07-05 11:23:29 +03:00
Roman Khimov
3e2eda6752 *: add some comments to service Start/Shutdown methods 2022-07-04 23:03:50 +03:00
Roman Khimov
593f4e8734
Merge pull request #2559 from nspcc-dev/cli/wallet-config
cli: allow to specify wallet via configuration file
2022-07-04 19:24:23 +03:00
Anna Shaleva
5f36a7ca0f *: do not call wallet.Close() explicitly
NewWallet and NewWalletFromFile close underlying io.Closer by itself,
no need to close it manually. Introduced in #2184.
2022-07-04 19:09:48 +03:00
Roman Khimov
c356c14741 rpc: add decimals/name/symbol data to getNEPXXBalance
See neo-project/neo-modules#738 and neo-project/neo-modules#741.
2022-07-04 18:28:27 +03:00
Roman Khimov
f0b08ba3e9
Merge pull request #2574 from nspcc-dev/fix-message
smartcontract: print proper error message on failed testinvoke
2022-07-04 14:14:24 +03:00
Roman Khimov
b7bea7685e
Merge pull request #2579 from nspcc-dev/add-json-enum-doc
Add JSON enum doc
2022-07-04 14:14:11 +03:00
Anna Shaleva
b2f188f8f0 cli: refactor code that opens wallet
Reduce code duplications, no functional changes.
2022-07-04 13:50:15 +03:00
Anna Shaleva
213bfe6bbf cli: allow to specify wallet via configuration file 2022-07-04 12:57:47 +03:00
Roman Khimov
926b082d39
Merge pull request #2538 from nspcc-dev/restrict-out-of-bounds
core: check methods offsets while contract deploying
2022-07-04 12:54:32 +03:00
Roman Khimov
a535c220d1 docs: add a compatibility note about #2563 problem 2022-07-04 11:15:16 +03:00
Roman Khimov
4afdb9fd89
Merge pull request #2578 from nspcc-dev/getcandidates
GetCandidates
2022-07-04 11:13:57 +03:00
Roman Khimov
36d4c17a15 stateroot: wait for the service to stop un Shutdown 2022-07-04 11:12:17 +03:00
Roman Khimov
58b9ac41e2 stateroot: handle double start/shutdown 2022-07-04 11:12:17 +03:00
Roman Khimov
bf462a81fe notary: wait for the service to finish on Shutdown 2022-07-04 11:12:17 +03:00
Roman Khimov
0d627c947f notary: control start/stop state
Don't start/stop twice, don't do anything in callbacks if not started.
2022-07-04 11:12:17 +03:00
Roman Khimov
73e34514a5 oracle: wait for the service to stop during Shutdown 2022-07-04 11:12:17 +03:00
Roman Khimov
cab633ffed oracle: make double-Shutdown a no-op 2022-07-04 11:12:17 +03:00