Commit graph

3260 commits

Author SHA1 Message Date
Roman Khimov
02eb40376e netmode: fix testnet magic
Somehow missed this in 134c7acff1.
2021-05-07 16:40:08 +03:00
Roman Khimov
39571745cb stateroot: fix incompleteRoot leak
Drop old incomplete roots from the map.
2021-05-07 14:31:20 +03:00
Roman Khimov
3d49f7d99a stateroot: only send stateroot message once per validators count
Actually fix #1922.
2021-05-07 14:31:20 +03:00
Roman Khimov
4a45abe3e0 stateroot: make vote/root extensibles live less
These are arbitrary numbers, but that's what C# node uses. maxRetries could be
set lower because we have exponential backoff anyway, but this works too.
2021-05-07 14:31:20 +03:00
Roman Khimov
7c902669bf stateroot: implement exponential vote resends 2021-05-07 14:31:20 +03:00
Roman Khimov
d5c7a40db9 stateroot: try finalizing stateroot when adding our signature
And don't add/resend it multiple times.

1. We can be in a setup with one SV only and no AddSignature() called at all.
2. AddSignature() might add M-1 signatures and our signature should be the
   last one to complete MPTRoot, but we'll never do that.
2021-05-06 23:29:43 +03:00
Roman Khimov
847927af74 stateroot: s/onValidatedRoot/relayExtensible/
Makes more sense because it's not just roots that we're relaying.
2021-05-06 22:32:13 +03:00
Roman Khimov
222b4dc920 stateroot: simplify account locking, deduplicate code 2021-05-06 22:17:09 +03:00
Roman Khimov
fc800dcbc1 stateroot: protect incomplete root manipulations in signAndSend
We're modifying it here, so there can be a race between this method and
AddSignature().
2021-05-06 21:53:34 +03:00
Roman Khimov
ba5273999f
Merge pull request #1950 from nspcc-dev/nep11/data
*: add `data` to NEP11 Transfer
2021-05-06 10:39:56 +03:00
Anna Shaleva
d0c64347ab *: add data to NEP11 Transfer 2021-05-05 19:44:29 +03:00
Anna Shaleva
efe9bee1ff smartcontract: refactor manifest.FromStackItem test
We need a good case to ensure that error cases constructed well.
2021-05-05 18:54:42 +03:00
Anna Shaleva
50fc9bf766 smartcontract: use permission descriptors for manifest's trusts 2021-05-05 17:40:10 +03:00
Evgeniy Stratonikov
bb039ef035 manifest: add features field 2021-05-04 13:10:46 +03:00
Roman Khimov
3acdbbd603
Merge pull request #1918 from nspcc-dev/cli/nep11
cli: support NEP11-related commands
2021-04-30 17:10:29 +03:00
Anna Shaleva
e27c894338 rpc: add NEP11 commands which return iterator
These are Tokens (optional), TokensOf and OwnerOf (divisible).
2021-04-30 16:23:06 +03:00
Anna Shaleva
9eeebf481c rpc: allow to marshal Iterators for invoke* results 2021-04-30 16:23:06 +03:00
Anna Shaleva
35ba3d97e6 rpc: export createNEP11TransferTx
It'll be used from cli package.
2021-04-30 16:23:06 +03:00
Anna Shaleva
c3264c065d rpc: check token standard in nepTokenInfo 2021-04-30 16:23:04 +03:00
Anna Shaleva
40ae78cb88 wallet: add Standard field to Token
We need to distinguish NEP11 and NEP17 tokens preesnted in the wallet.
2021-04-30 15:58:27 +03:00
Roman Khimov
8bfb6d7e37
Merge pull request #1942 from nspcc-dev/server/announced_port
network: add ability to specify port for P2P version exchange
2021-04-30 14:42:25 +03:00
Anna Shaleva
28b78d1a6c smartcontract: remove NEP10 standard name
It's unused.
2021-04-30 11:38:11 +03:00
Anna Shaleva
bc3a3d103e rpc: fix (*Client)TransferNEP11D
Four args should be specified: from, to, amount and tokenID.
2021-04-30 11:38:11 +03:00
Anna Shaleva
2fb083bd37 rpc: add NEP11TokenInfo method 2021-04-30 11:38:11 +03:00
Anna Shaleva
09bb162de0 network: add ability to specify port for P2P version exchange 2021-04-30 11:27:55 +03:00
Evgeniy Stratonikov
ac601601c1 native: add refuel method to GAS contract 2021-04-29 18:26:34 +03:00
Evgeniy Stratonikov
0114f9a912 interop: add System.Runtime.BurnGas 2021-04-29 18:23:33 +03:00
Roman Khimov
5924123927
Merge pull request #1939 from nspcc-dev/vm-arith-null
Allow NULL items for LT/LE/GT/GE instructions
2021-04-29 17:55:13 +03:00
Roman Khimov
62810bb510
Merge pull request #1941 from nspcc-dev/storage-find-prefix
interop: strip full prefix in `System.Storage.Find`
2021-04-29 17:55:00 +03:00
Evgeniy Stratonikov
ffaae0f773 interop: strip full prefix in System.Storage.Find 2021-04-29 17:29:26 +03:00
Roman Khimov
a34a5c1887
Merge pull request #1938 from nspcc-dev/designate-events
native: emit `Designation` event on role update
2021-04-29 16:40:32 +03:00
Evgeniy Stratonikov
8fa4a576f4 vm: allow Null arguments for LT,LE,GT,GE opcodes 2021-04-29 16:10:51 +03:00
Evgeniy Stratonikov
dc393642a2 opcode: fix GTE, LTE string representations 2021-04-29 16:08:48 +03:00
Evgeniy Stratonikov
8c3998593e native: emit Designation event on role update 2021-04-29 14:12:48 +03:00
Roman Khimov
438eb0c43a rpc: rename magic to network in JSON
Follow neo-modules/neo-core changes. We don't rename structure fields though
to stay compatible with current code (and we do have netmode.Magic to justify
that also).
2021-04-28 23:41:31 +03:00
Evgeniy Stratonikov
da360be5b1 rpc/request: allow to provide bool parameters, fix #1919 2021-04-28 16:44:19 +03:00
Anna Shaleva
0632e15f06 core: add NEP11 to nonfungible supported standards list 2021-04-26 17:56:02 +03:00
Anna Shaleva
127d0ad2ba rpc: allow to provide cosigners for NEP11-transfer-related commands 2021-04-23 10:45:11 +03:00
Anna Shaleva
49c35dec20 rpc: allow to provide cosigners for NEP17-transfer-related commands 2021-04-23 10:29:40 +03:00
Anna Shaleva
1d6ba389c9 rpc: split SignAndPushInvocationTx in two parts
There are several places where constructed transaction need to be
signed and sent. Thus, we definitely need a separate method for signing
and sending constructed transaction to avoid code duplication.
2021-04-23 10:27:47 +03:00
Roman Khimov
8407ae057c
Merge pull request #1912 from nspcc-dev/cli/invoke_with_contract_signer
rpc: properly construct cosigners' witnesses in SignAndPushInvocationTx
2021-04-21 19:13:16 +03:00
Anna Shaleva
48ae1cc486 rpc: refactor SignAndPushInvocationTx
We have a set of accounts provided via `cosigners` argument, so we
should fill all transaction witnesses in (not only sender's witness).
If we can't properly construct witnesses for all of the signers then an
error should be returned.
2021-04-21 18:52:32 +03:00
Anna Shaleva
f7c65f2b55 core: fix Condition never satisfied test error
This test is failing from time to time.
2021-04-21 11:19:12 +03:00
Anna Shaleva
eaf45d243b wallet: allow to sign with encrypted contract-based accounts 2021-04-20 14:53:51 +03:00
Roman Khimov
881ed3065e
Merge pull request #1909 from nspcc-dev/cli/default-cosigner-scope
cli, rpc: use CalledByEntry as a default cosigner's scope
2021-04-19 14:43:31 +03:00
Anna Shaleva
8f4257639e rpc: use CalledByEntry as default cosigner's scope 2021-04-19 12:06:13 +03:00
Anna Shaleva
ae36523a61 rpc, internal: fix CodeQL int conversions warnings
```
Incorrect conversion of an integer with architecture-dependent bit
size from to a lower bit size type int32 without an upper bound
check.
```
2021-04-19 11:30:28 +03:00
Anna Shaleva
28b74cb647 smartcontract: add ExpandParameterToEmitable method
It'll help to convert Parameter to a atandard type which then can be
emitted ass an array item.
2021-04-16 17:30:25 +03:00
Anna Shaleva
f7dcb7ae29 vm: allow emit.Array handle uint256 2021-04-16 16:20:30 +03:00
Anna Shaleva
1d3a297a6b rpc: add Data field to NEP17 TransferTarget
It's a part of transfer, thus it should be passed along with the other
transfer parameters.
2021-04-16 13:54:23 +03:00