Commit graph

248 commits

Author SHA1 Message Date
Anna Shaleva
2b06601646 core: change Oracle request ID endianness 2021-02-05 11:37:12 +03:00
Anna Shaleva
12f7111ca8 core: mark blocked accounts with empty byte array 2021-02-05 11:37:12 +03:00
Anna Shaleva
260bcd373c core: store initial native values into DAO 2021-02-05 10:43:17 +03:00
Roman Khimov
641896b2fb
Merge pull request #1658 from nspcc-dev/signature_collection/module
core, network: add Notary module
2021-02-02 22:24:14 +03:00
Anna Shaleva
19fa0daaa6 core, network: add Notary module 2021-02-02 22:01:20 +03:00
Roman Khimov
f7cb00b82d
Merge pull request #1678 from nspcc-dev/nameservice
Implement NameService
2021-02-01 22:52:59 +03:00
Evgeniy Stratonikov
e4ff8326b5 native: add NameService 2021-02-01 21:40:21 +03:00
Evgeniy Stratonikov
2336415f42 naitve: disallow contract name modification 2021-01-29 12:19:08 +03:00
Evgeniy Stratonikov
c1cc7e6f9d native: add additional parameters to deploy
1. Management contract has 2 overloads of `deploy` method.
2. Normal contracts should have `_deploy` with 2 parameters.
2021-01-29 12:19:08 +03:00
Evgeniy Stratonikov
849385a533 native: allow to overload native methods 2021-01-29 12:19:08 +03:00
Roman Khimov
818d5988f5
Merge pull request #1695 from nspcc-dev/committeechecks
native: unify committee checks
2021-01-29 11:58:33 +03:00
Evgeniy Stratonikov
690b787fe3 native: unify committee checks
Fail execution if tx is not signed by committee.
2021-01-29 10:50:17 +03:00
Evgeniy Stratonikov
9592f3e052 network: implement pool for Extensible payloads 2021-01-28 17:09:06 +03:00
Evgeniy Stratonikov
153678160e native: use majority hash only for oracles 2021-01-28 17:09:06 +03:00
Evgeniy Stratonikov
db4e7558e0 native: cache all roles in Designate 2021-01-28 17:09:05 +03:00
Evgenii Stratonikov
43e4d3af88 oracle: integrate module in core and RPC
1. Initialization is performed via `Blockchain` methods.
2. Native Oracle contract updates list of oracle nodes
  and in-fly requests in `PostPersist`.
3. RPC uses Oracle module directly.
2021-01-28 13:00:58 +03:00
Evgenii Stratonikov
7e16bea126 network: implement Oracle module 2021-01-28 12:43:20 +03:00
Evgeniy Stratonikov
73f888f02e core: allow to overload contract methods
Multiple methods with different parameter count can co-exist.
2021-01-27 12:51:07 +03:00
Roman Khimov
054ca27e9c state: use checksums and names to calculate contract hashes
It allows to deploy the same NEF using one sender and get different contract
hashes. See neo-project/neo#2240.
2021-01-22 12:22:48 +03:00
Roman Khimov
6b9b37f170 native: don't call CreateNativeContractHash() in oracle contract
Move oracleScript from global context to Oracle itself. We have the hash
already computed by NewContractMD, there is no need to repeat this
calculation.
2021-01-22 11:28:13 +03:00
Roman Khimov
476cbbebdc native: make registering as a candidate cost more
Follow neo-project/neo#2252.
2021-01-21 23:02:59 +03:00
Evgeniy Stratonikov
c6894f3f55 native: check for committee in setters 2021-01-21 15:20:34 +03:00
Roman Khimov
6ecc6f0422 native: call native contracts by ID instead of name
Fix #1666.
2021-01-18 00:38:23 +03:00
Roman Khimov
f39ede9869 opcode: add CALLT opcode, move ABORT/ASSERT
Refs. #1644. Hash compatibility test temporarily disabled, to be enabled when
it's up to date with current C# master.
2021-01-18 00:14:52 +03:00
Evgenii Stratonikov
1c0c331e25 core: update System.Contract.Call syscall
1. Remove `System.Contract.CallEx`.
2. Extend number of parameters.
3. Add return value count to `VM.Context`.
2021-01-14 18:23:36 +03:00
Evgenii Stratonikov
dbe81f9b80 smartcontract: move flags to a separate package 2021-01-14 17:52:09 +03:00
Roman Khimov
36b5751262
Merge pull request #1665 from nspcc-dev/nefstate
Store NEF in contract state
2021-01-14 10:14:38 +03:00
Evgeniy Stratonikov
0b26b46234 state: store NEF instead of script for contract
NEFs for native contracts are set statically, thus
field values are taken from the reference implementation.
2021-01-13 15:34:10 +03:00
Roman Khimov
524bf9aaa0 native: swap oracle and role management init
Role management doesn't need oracles, but oracles do need role management. See
neo-project/neo#2187.
2021-01-12 21:27:42 +03:00
Roman Khimov
ca86b78536
Merge pull request #1622 from nspcc-dev/nativenames
native: update contract names
2021-01-12 20:59:10 +03:00
Roman Khimov
4fa1476c03 native: use Hash160 method parameters where appropriate
Partially reverts 33386065bc, see
neo-project/neo#2183.
2021-01-12 18:08:12 +03:00
Evgenii Stratonikov
33b926586a native: update contract names
Follow https://github.com/neo-project/neo/pull/2152 .
2021-01-12 17:58:05 +03:00
Anna Shaleva
c13382e27d core: fix (*NEO).getCandidates
Don't need to pay attention to key prefix while sorting.
2020-12-25 17:03:05 +03:00
Anna Shaleva
bc3f8a3b48 core: fix (*NEO).computeCommitteeMembers
In (*NEO).computeCommitteeMembers we return standbyCommittee in case
if there's not enought candidates. But there can be standby committee
members among candidates, so we need to fill in known votes.
2020-12-24 12:47:42 +03:00
Anna Shaleva
33386065bc core: adjust parameters of native methods
This commit is mostly about Hash160 -> ByteArray for native contracts'
methods. Manifest is included into states, so we need to be compatible.
2020-12-23 11:18:44 +03:00
Anna Shaleva
e40f3610ed core: store MinimumDeploymentFee as uint32 2020-12-22 16:09:16 +03:00
Anna Shaleva
b1324db847 core: add notifications to ManagmentContract 2020-12-18 16:52:51 +03:00
Anna Shaleva
d34353aec2 core: add MinimumDeploymentFee 2020-12-18 16:48:05 +03:00
Anna Shaleva
a65544aab1 core: fix Managment destroy price
Too expensive.
2020-12-18 16:46:09 +03:00
Evgenii Stratonikov
3397f2c9be native: cache contract in Management contract 2020-12-18 13:11:17 +03:00
Anna Shaleva
31b06907c9 core: restrict allowed Oracle callbacks 2020-12-17 11:41:28 +03:00
Evgenii Stratonikov
62da365302 native: allow to modify StoragePrice in the policy contract 2020-12-16 13:55:40 +03:00
Evgenii Stratonikov
4946556830 native: allow to modify ExecFeeFactor in the policy contract 2020-12-16 13:55:40 +03:00
Evgenii Stratonikov
1840c1c80d core: redefine opcode prices
Prices are defined in as a coefficients to `BaseExecFee` which
is defined by Policy contract (TBD later).
Native method prices are defined without need to multiply.
2020-12-16 13:55:39 +03:00
Evgenii Stratonikov
dda4ba8d4d native: add compatibility test for hashes 2020-12-15 12:58:04 +03:00
Evgenii Stratonikov
1ffa1f9ade native: fix contract hashes 2020-12-15 12:58:04 +03:00
Evgenii Stratonikov
5310c7f3ce native: fix NEP17.Transfer cost
It was increased with the introducion of `postTransfer`.
2020-12-15 12:04:10 +03:00
Roman Khimov
cb5ecaefe7 native: drop OnPersistEnd
Now that PostPersist is being run for every native contract we can do our
dirty caching tricks right there instead of OnPersistEnd.
2020-12-14 15:24:15 +03:00
Roman Khimov
cf8cf93e7a native: change contract names, move them to separate package
Follow neo-project/neo#2138 and make RPC client's GetNativeContractHash
case-sensitive.
2020-12-14 15:24:15 +03:00
Roman Khimov
aff1469482 native: uppercase token symbols
Follow neo-project/neo#2136.
2020-12-14 15:24:15 +03:00