Commit graph

6703 commits

Author SHA1 Message Date
Roman Khimov
ab0ff63ce1
Merge pull request #2804 from nspcc-dev/check-aer-sub
rpc: fix subscribers locking logic and properly drain poll-based waiter receiver
2022-11-17 04:24:35 +07:00
Anna Shaleva
1399496dfb rpcclient: refactor event-based waiting loop
Avoid receiver channels locks.
2022-11-16 23:57:00 +03:00
Anna Shaleva
95e23c8e46 actor: fix event-based tx awaiting
If VUB-th block is received, we still can't guaranty that transaction
wasn't accepted to chain. Back this situation by rolling back to a
poll-based waiter.
2022-11-16 23:44:31 +03:00
Anna Shaleva
6dbae7edc4 rpcclient: fix WS-client unsubscription process
Do not block subscribers until the unsubscription request to RPC server
is completed. Otherwise, another notification may be received from the
RPC server which will block the unsubscription process.

At the same time, fix event-based waiter. We must not block the receiver
channel during unsubscription because there's a chance that subsequent
event will be sent by the server. We need to read this event in order not
to block the WSClient's readloop.
2022-11-16 23:44:30 +03:00
Anna Shaleva
ddaba9e74d rpcsrv: fix "subscribe" parameters handling
If it's a subscription for AERs, we need to check the filter's state only
if it has been provided, otherwise filter is always valid.
2022-11-16 14:05:13 +03:00
Anna Shaleva
d043139b66 rpcsrv: adjust "subscribe" response error
Make it more detailed for better debugging experience.
2022-11-16 13:35:19 +03:00
Anna Shaleva
3f122fd591 rpcclient: adjust WS waiter error formatting
Follow the other errors formatting style.
2022-11-16 12:22:18 +03:00
Roman Khimov
5f763a26e7
Merge pull request #2802 from nspcc-dev/fix-node-startup-with-broken-contract
Fix node startup with broken contract
2022-11-16 16:21:56 +07:00
Roman Khimov
822722bd2e native: ignore decoding errors during cache init
Bad contract -> no contract. Unfortunately we've got a broken
6f1837723768f27a6f6a14452977e3e0e264f2cc contract on the mainnet which can't
be decoded (even though it had been saved successfully), so this is a
temporary fix for #2801 to be able to start mainnet node after shutdown.
2022-11-16 12:00:28 +03:00
Roman Khimov
0402a75d20 cli: fix error message formatting
This is not very useful:
   could not initialize blockchain: %!w([]interface {}=[0xc0018da2c0])
2022-11-16 11:34:29 +03:00
Roman Khimov
bd67fe5371
Merge pull request #2800 from nspcc-dev/fix-vm-bugz
Fix VM bug and istack printing
2022-11-16 13:24:07 +07:00
Roman Khimov
aef01bf663 vm: fix istack marshaling, fix #2799 2022-11-16 00:40:12 +03:00
Roman Khimov
90582faacd vm: save current stack slice when loading new context
v.estack is used throughout the code to work with estack, while ctx.sc.estack
is (theoretically) just a reference to it that is saved on script load and
restored to v.estack on context unload. The problem is that v.estack can grow
as we use it and can be reallocated away from its original slice (saved in the
ctx.sc.estack), so either ctx.sc.estack should be a pointer or we need to
ensure that it's correct when loading a new script. The second approach is a
bit safer for now and it fixes #2798.
2022-11-15 23:48:02 +03:00
Roman Khimov
e9407e2054
Merge pull request #2793 from nspcc-dev/ga-upd
.github: upgrade stale GithubActions workflow dependencies
2022-11-15 20:25:51 +07:00
Anna Shaleva
eaa0d42b9c .github: fix condition for adding latest tag to buider job 2022-11-15 16:16:02 +03:00
Anna Shaleva
59741bbffc .github: update deprecated workflows 2022-11-15 16:16:01 +03:00
Roman Khimov
5197723dfe
Merge pull request #2797 from nspcc-dev/adj-deposit-warning
network: adjust warning for deposit expiration
2022-11-15 18:40:22 +07:00
Anna Shaleva
6f3a0a6b4c network: adjust warning for deposit expiration
Provide additional info for better user experience.
2022-11-15 14:16:34 +03:00
Roman Khimov
c67ee54566
Merge pull request #2792 from nspcc-dev/rpcwrapper-arrays
RPC wrapper for simple arrays
2022-11-15 13:08:25 +07:00
Roman Khimov
82c6ce218b rpcbinding: use binding condig to generate code for simple arrays
Part of #2767.
2022-11-14 13:01:13 +03:00
Roman Khimov
b5c79f4be3 unwrap: add a complete set of simple array unwrappers
Arrays of basic types should be covered completely.
2022-11-14 13:01:13 +03:00
Roman Khimov
633413541c
Merge pull request #2791 from nspcc-dev/fix-win-reest
cli: properly close storage on `db reset`
2022-11-14 15:13:30 +07:00
Roman Khimov
ecf1f3195c
Merge pull request #2788 from nspcc-dev/dbft-tx-list
network: pre-filter transactions going into dbft
2022-11-14 15:10:10 +07:00
Anna Shaleva
aceeeeca33 cli: properly close storage on db reset
And fix failing test along the way:
```
2022-11-11T12:37:47.0413934Z === RUN   TestResetDB
2022-11-11T12:37:47.0414557Z 2022-11-11T12:36:54.510Z	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
2022-11-11T12:37:47.0415288Z 2022-11-11T12:36:54.510Z	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
2022-11-11T12:37:47.0416020Z 2022-11-11T12:36:54.510Z	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
2022-11-11T12:37:47.0416786Z 2022-11-11T12:36:54.510Z	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
2022-11-11T12:37:47.0417725Z 2022-11-11T12:36:54.510Z	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 5760}
2022-11-11T12:37:47.0418415Z 2022-11-11T12:36:54.510Z	INFO	Hardforks are not set, using default value
2022-11-11T12:37:47.0419272Z 2022-11-11T12:36:54.523Z	INFO	no storage version found! creating genesis block
2022-11-11T12:37:47.0419997Z 2022-11-11T12:36:54.529Z	INFO	chain is already at the proper state	{"height": 0}
2022-11-11T12:37:47.0420974Z     testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestResetDB671187463\001\chains\privnet\000001.log: The process cannot access the file because it is being used by another process.
2022-11-11T12:37:47.0421606Z --- FAIL: TestResetDB (1.99s)
```
2022-11-14 10:29:10 +03:00
Roman Khimov
b930a970ce
Merge pull request #2789 from nspcc-dev/release-instr-upd
docs: update release instructions
2022-11-14 14:05:03 +07:00
Anna Shaleva
a8b40eafe0 docs: update release instructions 2022-11-14 09:03:42 +03:00
Roman Khimov
91e9b5fe9a
Merge pull request #2787 from nspcc-dev/0.99.5-changelog
*: add changelog for 0.99.5
2022-11-11 20:42:00 +07:00
Anna Shaleva
b9765fa720 *: add changelog for 0.99.5 2022-11-11 16:28:41 +03:00
Roman Khimov
c405092953 network: pre-filter transactions going into dbft
Drop some load from dbft loop during consensus process.
2022-11-11 15:32:51 +03:00
Roman Khimov
f78231fd9c
Merge pull request #2773 from nspcc-dev/state-reset
core: implement state reset
2022-11-10 22:26:43 +07:00
Roman Khimov
470822753b
Merge pull request #2785 from nspcc-dev/deprecation-roadmap
ROADMAP: add deprecated code removal schedule
2022-11-10 22:13:10 +07:00
Anna Shaleva
e7effef052 core: reuse appendTokenTransferInfo from appendTokenTransfer 2022-11-10 18:08:18 +03:00
Anna Shaleva
30cfe4d8c8 cli: add db reset command
Close #2576.
2022-11-10 18:08:18 +03:00
Anna Shaleva
bd6bb9e9e2 core: allow to reset blockchain state 2022-11-10 18:08:17 +03:00
Anna Shaleva
ec9317d5b4 core: fix typo 2022-11-10 17:58:06 +03:00
Roman Khimov
e208ef1478 ROADMAP: add deprecated code removal schedule
I think it's useful to have this publically available.
2022-11-10 17:57:03 +03:00
Roman Khimov
cb806d4233 result: drop Version (un)marshaler, we only need it for Protocol
Simplify code a bit.
2022-11-10 17:51:02 +03:00
Roman Khimov
8324a247d3 result: drop pre-0.99.0 compatibility code
0.99.0 is too old already.
2022-11-10 16:49:38 +03:00
Anna Shaleva
1dac45bbbb core: add ability to check whether blockchain is running 2022-11-10 16:47:04 +03:00
Roman Khimov
7f8a79ffaa result: drop deprecated Magic and StateRootInHeader from Version
It's more than a year now we have them deprecated.
2022-11-10 16:32:49 +03:00
Roman Khimov
4c9473872e
Merge pull request #2783 from nspcc-dev/rpcbindings-iterators
Initial iterator support for RPC bindings
2022-11-10 12:51:40 +07:00
Roman Khimov
ea44367c97 cli/smartcontract: generate bindings also for examples
We do compilation test for them, just to check that the compiler doesn't choke
for any reason, but we can do the same for wrapper generators.
2022-11-09 18:13:45 +03:00
Roman Khimov
145ebad90e binding: drop the only error condition from TemplateFromManifest
Simplify the interface, we do IsValid() check anyway in the CLI and it covers
this condition as well.
2022-11-09 18:13:45 +03:00
Roman Khimov
be02eea7b1 binding: precompile template, remove useless error condition 2022-11-09 18:13:45 +03:00
Roman Khimov
a7f86dcb7f rpcbinding: generate Expanded methods for iterators
Refs. #2768.
2022-11-09 18:13:45 +03:00
Roman Khimov
d569fe01e6 rpcbinding: initial support for iterators, see #2768
Already better than stackitem.Item.
2022-11-09 18:13:45 +03:00
Roman Khimov
47d0f0d137
Merge pull request #2784 from nspcc-dev/rpc-histogram
rpcsrv: provide Prometheus histograms for calls
2022-11-09 21:58:21 +07:00
Roman Khimov
d0b1015b2c rpcsrv: provide Prometheus histograms for calls
They're a bit more useful and they're naturally grouped under rpc
prefix. Simple counters will be removed eventually to avoid duplication.
2022-11-09 13:26:45 +03:00
Roman Khimov
57ec67b375
Merge pull request #2782 from nspcc-dev/websocket-origin
rpcsrv: allow any Origin in WS connections if EnableCORSWorkaround
2022-11-09 13:38:28 +07:00
Roman Khimov
3247aa40a7 rpcsrv: allow any Origin in WS connections if EnableCORSWorkaround
Break origin checks even more. Alternative to #2772.
2022-11-09 09:28:09 +03:00