Roman Khimov
97193cf337
golangci: add predeclared linter
...
These can be confusing.
2022-09-02 18:36:26 +03:00
Roman Khimov
63f212f4b3
golangci: enable/fix misspell
2022-09-02 18:36:26 +03:00
Roman Khimov
4f3ffe7290
golangci: enable errorlint and fix everything it found
2022-09-02 18:36:23 +03:00
Roman Khimov
e569edc841
wallet: add ScriptHash() to Account
...
It allows to simplify a lot of code and avoid getting a PrivateKey in some
cases.
2022-09-02 14:43:34 +03:00
Roman Khimov
8d33206bb8
*: don't get private key from account if just public one is needed
...
Add PublicKey() API to the Account and use it as appropriate, avoid creating
additional references to the private key.
2022-09-02 14:43:28 +03:00
Roman Khimov
ac5c609063
core: add a bit more data into NVB errors
...
It's not always obvious what they mean and the NVB value is.
2022-08-29 15:08:37 +03:00
Roman Khimov
9916832e2e
core: set Tx for interop.Context when verifying witnesses
...
Notary contract uses it in the verification context and it's not harmful to
have it always be there when it's there.
2022-08-22 13:38:43 +03:00
Roman Khimov
eeeb0f6f0e
core: accept two-side channels for sub/unsub, read on unsub
...
Blockchain's notificationDispatcher sends events to channels and these
channels must be read from. Unfortunately, regular service shutdown procedure
does unsubscription first (outside of the read loop) and only then drains the
channel. While it waits for unsubscription request to be accepted
notificationDispatcher can try pushing more data into the same channel which
will lead to a deadlock. Reading in the same method solves this, any number of
events can be pushed until unsub channel accepts the data.
2022-08-19 22:08:40 +03:00
Roman Khimov
f7c5ab4f43
state: check for array length in (*Contract).FromStackItem
...
Panicing here is not appropriate.
2022-08-16 17:19:47 +03:00
Roman Khimov
a1a5db8fcd
state: add more convenient method to get native contract hashes
2022-08-15 10:54:29 +03:00
Anna Shaleva
94e84f0364
core: fix native Management's hasMethod signature
...
Affects states, see
28ab45a6ec/src/Neo/SmartContract/Native/ContractManagement.cs (L155)
.
2022-08-11 16:10:01 +03:00
Roman Khimov
bc3bffea53
native: fix oracle.finish reentrancy bug
...
See neo-project/neo#2795 .
2022-08-10 19:02:36 +03:00
Roman Khimov
8d170a1eb8
native: add Oracle.finish reentrancy test
2022-08-10 19:02:36 +03:00
Anna Shaleva
916f2293b8
*: apply go 1.19 formatter heuristics
...
And make manual corrections where needed. See the "Common mistakes
and pitfalls" section of https://tip.golang.org/doc/comment .
2022-08-09 15:37:52 +03:00
Anna Shaleva
bb751535d3
*: bump minimum supported go version
...
Close #2497 .
2022-08-08 13:59:32 +03:00
Roman Khimov
b8a4a6dc5b
Merge pull request #2613 from nspcc-dev/exec-changes-3.4.0
...
Exec changes for 3.4.0
2022-08-05 15:04:35 +03:00
Roman Khimov
e8d2277fe5
contract/vm: only push NULL after call in dynamic contexts
...
And determine the need for Null dynamically. For some reason the only dynamic
context is Contract.Call. CALLT is not dynamic and neither is a call from
native contract, go figure...
2022-08-05 14:35:00 +03:00
Roman Khimov
99e2681d3a
interop/vm: use more robust CalledByEntry check
...
Directly check contexts.
2022-08-05 14:35:00 +03:00
Roman Khimov
13f5fdbe8a
vm: extract shared parts of the Context
...
Local calls reuse them, cross-contract calls create new ones. This allows to
avoid some allocations and use a little less memory.
2022-08-05 14:26:25 +03:00
Roman Khimov
ab7743d78d
Merge pull request #2619 from nspcc-dev/script-oob-and-hasmethod-3.4.0
...
Script OOB checks and HasMethod for 3.4.0
2022-08-04 12:41:43 +03:00
Roman Khimov
cfd2a35172
Merge pull request #2612 from nspcc-dev/fancy-service-restart
...
Fancy service restart
2022-08-02 14:11:44 +03:00
Roman Khimov
9341bb6628
cli: restart notary service on USR1
2022-07-28 19:05:56 +03:00
Roman Khimov
2adcf406d3
cli: reload Oracle service on USR1
...
Which allows to enable/disable the service, change nodes, keys and other
settings. Unfortunately, atomic.Value doesn't allow Store(nil), so we have to
store a pointer there that can point to nil interface.
2022-07-28 19:05:56 +03:00
Roman Khimov
61cfbbd33f
Revert "vm/core: revert out-of-bounds script checks"
...
This reverts commit bd5644aa02
restoring changes
from #2538 .
2022-07-28 17:01:23 +03:00
Roman Khimov
55f910777e
Revert "native/interop: revert management.hasMethod()"
...
This reverts commit 6c7a401f77
, introducing
changes from #2598 again.
2022-07-28 17:00:34 +03:00
Roman Khimov
4e98ca3358
Merge pull request #2616 from nspcc-dev/rollback-to-3.3.1
...
Rollback to 3.3.1
2022-07-28 16:00:49 +03:00
Roman Khimov
6c7a401f77
native/interop: revert management.hasMethod()
...
This reverts commits
* f50bcf617a
* 4f184498bc
* ab3330564a
because they're 3.4.0-compatible while we need 3.3.1.
2022-07-27 23:26:24 +03:00
Roman Khimov
bd5644aa02
vm/core: revert out-of-bounds script checks
...
This reverts commits 1005c1f7db
and
a5b5f88fe2
which are 3.4.0-compatible changes
while we need a 3.3.1-compatible release.
2022-07-27 23:25:23 +03:00
Roman Khimov
8e9bd3e28f
native: trigger committee update on candidate registration
...
It can change the committee even if noone voted. Fixes state diff at block
390726 of T5 testnet where there are no transactions, but committee changes
because there were some registrations in previous 21 blocks.
2022-07-27 23:21:21 +03:00
Roman Khimov
e5c59f8ddd
interop/runtime: disable notifications in dynamic scripts
...
That are only entry scripts today. See neo-project/neo#2796 .
2022-07-27 14:49:53 +03:00
Roman Khimov
c8ff489287
native: use CreateOracleResponseScript directly
...
It wasn't possible way back when this test was written
(CreateOracleResponseScript was a method), now we can simplify things.
2022-07-26 12:19:49 +03:00
Roman Khimov
f749aaff3c
*: reuse smartcontract package to create standard entry scripts
2022-07-26 12:19:49 +03:00
Roman Khimov
88542630ac
blockchainer: drop the package completely
...
It's not an ideal solution, but at least it solves the problem for
now. Caveats:
* consensus only needs one method, so it's mirrored to Blockchain
* rpcsrv uses core.* definition of the StateRoot (so technically it might as
well not have an internal Ledger), but it uses core already unfortunately
2022-07-25 11:58:13 +03:00
Roman Khimov
5ee7ea34b1
blockchainer: drop Blockchainer completely
...
It's only used by the RPC server now, so it can be internalized.
2022-07-25 11:58:13 +03:00
Roman Khimov
284335a4d2
blockchainer: strip unused methods
2022-07-25 11:58:13 +03:00
Roman Khimov
fcbda00f8a
blockchainer/services: drop this package
...
It doesn't add any value.
2022-07-25 11:58:13 +03:00
Roman Khimov
3a6626f21f
blockchainer: drop unused services
dependency
2022-07-25 11:58:13 +03:00
Roman Khimov
4acd1688a1
subscriptions: move NotificationEvent to state
...
1. It's not good for pkg/core to import anything from pkg/neorpc.
2. The type is closely tied to the state package, even though it's not stored
in the DB
2022-07-25 11:58:13 +03:00
Roman Khimov
1e0750e3cd
rpc: merge response and request under pkg/neorpc
...
Move result there also.
2022-07-25 11:57:53 +03:00
Roman Khimov
43a59adbd0
rpc/server: move to services/rpcsrv
...
`server` is not a good package name and it's an internal service, so it can be
just about anywhere.
2022-07-21 22:14:12 +03:00
Roman Khimov
03b559bd44
block: JSONize tx-less block as []
instead of null
...
Improve C# compatibility.
2022-07-21 13:15:31 +03:00
Roman Khimov
ed53fd3221
Merge pull request #2600 from nspcc-dev/handle-mptdata
...
network: allow to handle GetMPTData with KeepOnlyLatestState on
2022-07-15 13:13:31 +03:00
Anna Shaleva
1ae601787d
network: allow to handle GetMPTData with KeepOnlyLatestState on
...
And adjust documentation along the way.
2022-07-14 14:33:20 +03:00
Roman Khimov
ab3330564a
native: add hasMethod, fix #2588
...
Yet another state change.
2022-07-13 17:29:46 +03:00
Roman Khimov
125c2805d3
storage: reduce lock time in (*MemoryStore).Seek
...
It makes a copy of the resulting set, so the lock can be released
earlier. This helps a lot with iterators that keep Seek() unfinished for a
long time,
2022-07-11 16:15:14 +03:00
Roman Khimov
96c4e61063
storage: move Operation into package of its own
...
Don't use storage.* types in rpc/response/result.
2022-07-08 23:30:30 +03:00
Roman Khimov
8cd7b93208
limits: new package with storage limits
...
Packages like core/state or core/mpt shouldn't import whole core/storage just
to get some constant value, it's not a good dependency.
2022-07-08 23:30:30 +03:00
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
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
Anna Shaleva
cbd20eb959
rpc: implement iterator sessions
2022-07-08 17:05:18 +03:00