Commit graph

1927 commits

Author SHA1 Message Date
Roman Khimov
58f23422ac
Merge pull request #1161 from nspcc-dev/neo3/protocol/cmd_not_found
network: update CMDUncknown
2020-07-16 09:49:16 +03:00
Roman Khimov
acfded7f45
Merge pull request #1180 from nspcc-dev/fix-calling-scripthash-check-in-nep5
Add calling scripthash check to native nep5 transfers
2020-07-16 07:29:14 +03:00
Anna Shaleva
db5b42b601 network: update CMDUncknown
Closes #1135
2020-07-16 06:58:55 +03:00
Roman Khimov
59be6bcd24 native: add calling script hash to NEP5 transfer witness check
Fix transfers from contract's address.
2020-07-15 22:52:35 +03:00
Roman Khimov
d4c3a17883 interop/native: always use proper ScriptHashGetter, fix #924
All scripts are run in VM, so it's there to tell us about script hashes
involved and it must be used instead of nep5ScriptHash kludge.
2020-07-15 22:43:30 +03:00
Roman Khimov
f46ed798f0
Merge pull request #1169 from nspcc-dev/neo3/rpc/fields_names_adjustment
rpc: adjust RPC calls JSON fields
2020-07-15 18:24:54 +03:00
Anna Shaleva
e9f4693e18 wallet: adjust isDefault field name
Part of #1130
2020-07-15 14:45:57 +03:00
Anna Shaleva
2ab23dc56a rpc: adjust getunclaimedgas RPC-call
Part of #1130
2020-07-15 14:45:51 +03:00
Anna Shaleva
3a3cd0353d rpc: adjust invokefunction RPC-call JSON fields names
Part of #1130
2020-07-15 14:44:22 +03:00
Anna Shaleva
48ccdb09d4 rpc: adjust getversion RPC-call JSON fields names
Part of #1130
2020-07-15 14:44:22 +03:00
Anna Shaleva
538616e9f8 rpc: adjust getrawtransaction RPC-call JSON fields names
Part of #1130
2020-07-15 14:44:13 +03:00
Roman Khimov
75dc62fa81
Merge pull request #1175 from nspcc-dev/neo3/crypto/ecdsa
crypto: add Secp256k1 support
2020-07-15 13:34:42 +03:00
Roman Khimov
5ba4f3ef08 rpc: set transaction's script for test invocation
GetScriptContainer() interop can try to get this transaction and this attempt
will lead to hash calculation with transaction serialization, but transaction
can't be successfully serialized if it doesn't have a script set, so this
makes test invocations fail.
2020-07-14 18:05:49 +03:00
Anna Shaleva
063a7f683c compiler: add CheckMultisig interops
Part of #918
2020-07-14 16:21:38 +03:00
Anna Shaleva
a3e306ff78 core: implement Secp256k1 Verify and CheckMultisig interops
Closes #918.
2020-07-14 16:21:34 +03:00
Anna Shaleva
5326fc587a core: rename Neo.Crypto.CheckMultisig to Neo.Crypto.CheckMultisigWithECDsaSecp256r1
Part of #918
2020-07-14 16:19:12 +03:00
Anna Shaleva
17233e1d8e core: rename Neo.Crypto.Verify to Neo.Crypto.VerifyWithECDsaSecp256r1
Part of #918
2020-07-14 16:19:12 +03:00
Anna Shaleva
8f17c7fb05 crypto: switch to standard ecdsa keys
Now we have not only Random EC curve, but also Koblitz curve, so
it will be useful to have information about the curve for each
particular EC point. ecdsa.PublicKey has this information.
2020-07-14 16:19:07 +03:00
Roman Khimov
4c23aa1d7c
Merge pull request #1174 from nspcc-dev/neo3/interop/getscriptcontainer
core, compiler: return tx from GetScriptContainer interop
2020-07-14 08:58:52 +03:00
Roman Khimov
dafb9eea4d
Merge pull request #1177 from nspcc-dev/no-free-vm-runs
No free VM runs
2020-07-14 08:42:13 +03:00
Roman Khimov
db027ad9c5 vm: zero GAS means no GAS, use fee data to properly limit execution
We were accepting transactions with zero system fee, but we shouldn't do
that. Also, transaction's verification execution has to be limited by network
fee.
2020-07-14 08:37:29 +03:00
Anna Shaleva
c4f7b06974 core, compiler: return struct from GetScriptContainer interop
Closes #1173
2020-07-14 06:04:48 +03:00
Roman Khimov
419d68329c core: limit GAS available for block verification 2020-07-13 18:24:58 +03:00
Roman Khimov
395f4ea46d consensus: limit the number of signatures used for test transactions
We only need 3 out of 4.
2020-07-13 18:08:23 +03:00
Roman Khimov
330e1670d6 consensus: limit payload verification time with GAS
Follow C# implementation.
2020-07-13 18:07:02 +03:00
Roman Khimov
3134e364b2 core: fix CalculateNetworkFee() for multisig contracts
We return m from the vm.ParseMultiSigContract and n is the length of pubs,
invocation script then pushes m signatures for n keys.
2020-07-13 18:05:46 +03:00
Roman Khimov
afc5ee1ded core: fix ECDSA verifiation price, it's 1000000 and it's defined in crypto 2020-07-13 18:04:50 +03:00
Roman Khimov
a43e374ac6 consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
Roman Khimov
579630a3fa native: don't expose internal slices to the outside world
They should be hidden.
2020-07-11 19:54:50 +03:00
Roman Khimov
7eef895061 consensus: use GetNextBlockValidators where appropriate
GetValidators without parameter is called upon DBFT initialization and it
should receive validators for the next block (that will create it),
parameterized GetValidators is used for NextConsensus calculation where we
need a list for the current state of the chain.
2020-07-11 19:54:50 +03:00
Roman Khimov
2278cd5700 consensus: drop NextConsensus from the prepareRequest
Follow neo-project/neo#744 to make our requests compatible with C# node.
2020-07-11 19:54:50 +03:00
Roman Khimov
ae497228f0 core: use native NEO GetValidators for bc.GetValidators
NextBlockValidators are updated before the new block persist, so we need to
use GetValidators to get the list corresponding to the current state of the
chain.
2020-07-11 19:54:50 +03:00
Roman Khimov
815c075112 consensus: update dbft, use millisecond-precision time, add CV reason 2020-07-11 19:54:50 +03:00
Roman Khimov
fedcc6b6fc transaction: drop old attributes
They're not supported in Neo 3. Also change data encoding to base64 following
Neo 3 changes.
2020-07-10 20:40:27 +03:00
Roman Khimov
56a8f11ad6
Merge pull request #1115 from nspcc-dev/fix/convert
keys: support returning legacy verification script
2020-07-10 19:27:36 +03:00
Anna Shaleva
789ee2d3c1 core: do not update mempool while verifying tx
Closes #1168
2020-07-09 20:45:59 +03:00
Anna Shaleva
4be1009def core: refactor checkBalanceAndUpdate 2020-07-09 18:27:20 +03:00
Anna Shaleva
72a6740717 rpc: adjust getcontractstate RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Anna Shaleva
15f7b78a8c rpc: adjust getnep5transfers RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Anna Shaleva
dc273736be rpc: adjust getnep5balances RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Anna Shaleva
e81ccb7deb rpc: adjust getblock RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Anna Shaleva
51576f236d rpc: adjust getapplicationlog RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Roman Khimov
1fa2d4bc6a
Merge pull request #1165 from nspcc-dev/neo3/state/nep5transfer
core: store NEP5 transfers and balances as big.Int
2020-07-09 16:55:51 +03:00
Roman Khimov
15c6cc932d vm: drop checkedhash, it's an unused NeoVM 2 remnant 2020-07-09 15:05:14 +03:00
Roman Khimov
1bb26dcdc1 vm: fix INITSSLOT, it's context-wide, not VM-wide
It's tied to the current contract, not to VM.
2020-07-09 15:00:49 +03:00
Roman Khimov
bc1d6791b9 compiler: allow to append multiple elements 2020-07-09 13:59:43 +03:00
Anna Shaleva
abe3c94b95 core: use big.Int to store NEP5 balances
closes #1133
2020-07-09 13:26:39 +03:00
Anna Shaleva
43b28ffa06 core: get rid of NEP5TransferSize
Part of #1133

It will help us to use big.Int to store amount of NEP5 tokens. As far as
big.Int doesn't have constant size, we shouldn't use `NEP5TransferSize`
constant anymore.
2020-07-09 13:25:03 +03:00
Roman Khimov
76925fe3e0 compiler: slices must default to nil 2020-07-09 13:07:21 +03:00
Roman Khimov
eee8ac1655 compiler: fix initialization of struct fields, fix #1164
Make `s{}` initializers work. Deduplicate code a bit along the way. The test
added follows bf6aa02dcf test.
2020-07-09 12:27:21 +03:00