Commit graph

92 commits

Author SHA1 Message Date
Evgenii Stratonikov
d193e16662 compiler: support System.Binary.Atoi/Itoa syscalls 2020-11-10 16:15:10 +03:00
Roman Khimov
eaa260474f trigger/core: split System trigger into OnPerist and PostPersist
Follow neo-project/neo#2022.
2020-10-29 19:17:07 +03:00
Roman Khimov
5f22bdfecf
Merge pull request #1375 from nspcc-dev/compiler/types
Smartcontract types definition in interops
2020-09-16 14:43:50 +03:00
Evgenii Stratonikov
bcc11cbd74 compiler: support removing slice elements
Go-way of removing elements from slice is via `append` builtin.
There is a separate opcode for removing elements from
Arrays, which is cheaper and supported in this commit.
2020-09-15 16:33:43 +03:00
Evgenii Stratonikov
b319f127e7 interop: make Base*Encode return string 2020-09-09 13:10:38 +03:00
Evgenii Stratonikov
37f7363386 interop: return struct pointers where needed
`Transaction`, `Block` and `Contract` are represented as
`Array`s in VM, so we must return pointers.

Revert a1f98f92.
2020-09-09 13:10:04 +03:00
Evgenii Stratonikov
cee1836183 interop: provide missing smartcontract parameter type defs
Contract can have Hash160, Hash256, Signature etc. types which
all map to a `[]byte` in Go. Having synonyms helps us to generate
proper manifest file.
2020-09-09 13:06:44 +03:00
Roman Khimov
9c72ea1d64 core/interop: add base58 encoding/decoding syscalls
Follow neo-project/neo#1833.
2020-08-23 17:19:56 +03:00
Roman Khimov
e7d13e6db2 *: fix misspellings found in Go Report Card 2020-08-14 12:16:24 +03:00
Evgenii Stratonikov
f2cb1d5f02 compiler: use constants in interops
We now support using exported constants, so there is no
need in declaring functions. All functions from `interop/`
are not to be compiled.

Fix #1298.
2020-08-10 17:52:31 +03:00
Evgenii Stratonikov
28e0661f82 interop: update AppCall comment
Do not require contract hash to be known at compile time.
2020-07-27 13:00:35 +03:00
Evgenii Stratonikov
d2ddf7b7cb *: support invoking methods by offset
Allow to invoke methods by offset:
1. Every invoked contract must have manifest.
2. Check arguments count on invocation.
3. Change AppCall to a regular syscall.
4. Add test suite for `System.Contract.Call`.
2020-07-27 13:00:35 +03:00
Roman Khimov
d8a1c3de46
Merge pull request #1221 from nspcc-dev/neo3/interop/post-preview2_adjustment3
interop: post-preview2 adjustment, part 3
2020-07-23 20:35:53 +03:00
Anna Shaleva
76acef18ad core: adjust System.Runtime.Platform interop
Part of #1055.

Added `Platform` method to compiler.
2020-07-23 07:51:24 +03:00
Anna Shaleva
c9ef7425ac core: adjust System.Iterator.Create interop
Closes #1201.

It should be able to iterate over primitive byte-array-like types also.
2020-07-23 07:51:55 +03:00
Anna Shaleva
459ac34839 core: adjust System.Enumerator.Create interop
Part of #1201.

It should be able to create enumerator from primitive byte-array-like
stack items too.
2020-07-23 07:51:24 +03:00
Anna Shaleva
b8d82b49ec core: add Neo.Crypto.RIPEMD160 interop
Closes #1193.
2020-07-22 16:58:32 +03:00
Anna Shaleva
84bf87df52 core: adjust System.Storage.PutEx interop
Part of #1055.

Added System.Storage.PutEx to compiler. Added StorageFlag in order to
denote whether item is constant or not.
2020-07-22 16:58:23 +03:00
Evgenii Stratonikov
3d7fa9de93 *: make Notify interop accept event name 2020-07-20 13:33:32 +03:00
Anna Shaleva
74d2f437f4 core: add System.Binary.Base64Encode(Decode) interops
Part of #1055
2020-07-17 12:36:18 +03:00
Anna Shaleva
f31ce9289d core: add System.Contract.GetCallFlags interop
Part of #1055.

It returns calling flags of the current context.
2020-07-17 12:35:02 +03:00
Anna Shaleva
842feb2533 core: adjust System.Contract.Update interop
Part of #1055.

We should check contract scripthash against the one provided in manifest
and manifest groups. We shouldn't put on stack anything after return.
And ofcourse, we mast not destroy the old contract at the end, as
`contractDestroy` removes all storage items associated with the
old contract ID (which equals to the new contract ID). We just remove
old contract state - it's enough.
2020-07-17 12:33:44 +03:00
Anna Shaleva
fddad0b475 core: adjust System.Contract.Create interop
Part of #1055.

It should check given scripthash against manifest groups and return the
contract state as a struct (not interop interface).
2020-07-17 09:28:52 +03:00
Anna Shaleva
d2ec0fed3d core: adjust System.Blockchain.GetContract interop
Part of #1055.

It should put on stack an array instead of interop interface.
2020-07-17 09:28:52 +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
17233e1d8e core: rename Neo.Crypto.Verify to Neo.Crypto.VerifyWithECDsaSecp256r1
Part of #918
2020-07-14 16:19:12 +03:00
Roman Khimov
b3e450477d interop/runtime: synchronize trigger values with smartcontract/trigger
Neo 3.0 has new updated and improved constants. A better (non-function-based)
fix requires #1154 to be solved.
2020-07-07 20:25:52 +03:00
Roman Khimov
d81d826bfc core: fix Storage.Get to return Null when there is no value
Match C# implementation and fix state inconsistency at block 249920 of
preview2 testnet. Make our Go Storage.Get return nil and adapt
examples/tests.
2020-06-24 10:43:58 +03:00
Evgenii Stratonikov
61cae8d8b1 compiler: implement missing System.Contract.* interops
Support System.Contract.IsStandard/CreateStandardAccount syscall.
2020-06-17 11:38:34 +03:00
Evgenii Stratonikov
3762ebdd08 core: implement System.Runtime.GetInvocationCounter syscall 2020-06-17 11:24:11 +03:00
Evgenii Stratonikov
75e597f880 core: implement System.Runtime.GetNotifications syscall 2020-06-17 11:24:11 +03:00
Evgenii Stratonikov
a4e4439967 core,vm: implement System.Runtime.GasLeft syscall 2020-06-17 11:24:11 +03:00
Evgenii Stratonikov
ad2a75a500 core: move System.ExecutionEngine.* interops to System.Runtime.* 2020-06-16 12:30:55 +03:00
Evgenii Stratonikov
becb8a0f72 compiler: support System.Json.* syscalls 2020-06-16 11:35:08 +03:00
Evgenii Stratonikov
18066143bd core,vm: adjust binary (de-)serialization syscalls
Related #1027.

1. Move System.Runtime.(De)serialize to System.Binary.*
2. Rename compiler stubs.
3. Adjust opcode prices.
2020-06-16 11:00:38 +03:00
Evgenii Stratonikov
f8a11f61b6 core: update *.Contract.* interops
1. Remove GetScript, IsPayable, GetStorageContext.
2. Revert 82319538 related to GetStorageContext.
3. Rename Migrate to Update.
4. Move remaining to System.Contract.*.

Related #1031.
2020-06-11 10:50:35 +03:00
Evgenii Stratonikov
df958caf93 core: add Manifest to state.Contract 2020-06-11 10:45:24 +03:00
Evgenii Stratonikov
38d020d1a2 core: move Neo.Storage.* interops to System.* 2020-06-10 12:13:35 +03:00
Evgenii Stratonikov
0472a0b0b1 core: move Neo.Runtime/Enumerator/Iterator.* interops to System.* 2020-06-10 12:13:35 +03:00
Evgenii Stratonikov
3d3fe9398e core: remove Neo.Header/Witness/Account.* interops
They are not present in NEO3.
2020-06-10 12:13:18 +03:00
Anna Shaleva
8b7abd36c9 core: remove Block.GetTransactions, Block.GetTransactionsCount interops
Updated System.Blockchain.GetBlock interop replaced the functionality of
the following interops:
	System.Block.GetTransactions
	System.Block.GetTransactionCount
	Neo.Block.GetTransactions
	Neo.Block.GetTransactionsCount
2020-06-09 23:24:11 +03:00
Anna Shaleva
7a2d37cf7e core: update System.Blockchain.GetBlock interop
closes #1025

Now we put on stack stackitem.Array instead of Interop, so we're able to
use all available block properties without extra interop getters.
Removed Neo.Blockchain.GetBlock interop as we don't need it anymore.
2020-06-09 23:24:04 +03:00
Anna Shaleva
e2187c0a96 core: remove Block.GetTransaction interops
Removed Neo.Block.GetTransaction and System.Block.GetTransaction
interops. These interops were replaced by new
System.Blockchain.GetTransactionFromBlock interop.
2020-06-09 22:54:21 +03:00
Anna Shaleva
d692de5ea4 core: add System.Blockchain.GetTransactionFromBlock interop 2020-06-09 22:54:16 +03:00
Anna Shaleva
1e63ae4b3f core: update System.Blockchain.GetTransactionHeight interop
Update System.Blockchain.GetTransactionHeight and removed
Neo.Blockchain.GetTransactionHeight interop as we don't need it.
2020-06-09 22:04:18 +03:00
Anna Shaleva
53655c5ac2 core: implement new System.Blockchain.GetTransaction interop
closes #1023

Now we put on stack stackitem.Array instead of Interop, so we don't
need old transaction-related interops anymore. Removed the following
interops:
	System.Transaction.GetHash
	Neo.Transaction.GetAttributes
	Neo.Transaction.GetHash
	Neo.Transaction.GetWitnesses
	Neo.Attribute.GetData
	Neo.Attribute.GetUsage

Also removed the following duplicated NEO interop:
	Neo.Blockchain.GetTransaction
2020-06-09 22:04:13 +03:00
Roman Khimov
a986e2a064 *: drop support for old on-chain assets
You no longer can transfer them, so creating/renewing/storing doesn't make
much sense.
2020-06-05 19:21:37 +03:00
Roman Khimov
709146f295 transaction: drop Inputs and Outputs, forget UTXO 2020-06-05 19:20:16 +03:00
Roman Khimov
21efccd300 transaction: remove type field, set Version to 0
Two changes being done here, because they require a lot of updates to
tests. Now we're back into version 0 and we only have one type of
transaction.

It also removes GetType and GetScript interops, both are obsolete in Neo 3.
2020-06-05 19:20:16 +03:00