Commit graph

3883 commits

Author SHA1 Message Date
Roman Khimov
524c1238e8
Merge pull request #1686 from nspcc-dev/update-contract-hash-calculations
Update contract hash calculation scheme
2021-01-22 14:20:23 +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
dfc23c4246
Merge pull request #1667 from nspcc-dev/extensible
Introduce extensible payloads
2021-01-22 11:10:40 +03:00
Evgeniy Stratonikov
5d83c28bc9 network: replace ConsensusType with ExtensibleType 2021-01-22 10:38:33 +03:00
Evgeniy Stratonikov
b918ec3abc consensus: refactor payloads structure
1. `Version` and `PrevHash` are now in `PrepareRequest`.
2. Serialization is done via `Extensible` payload.
3. Update dbft version.
2021-01-22 10:38:32 +03:00
Evgeniy Stratonikov
59a193c7c7 network/payload: add Extensible payload 2021-01-22 10:35:42 +03:00
Roman Khimov
6bc2512767
Merge pull request #1684 from nspcc-dev/candidate-registration-price
native: make registering as a candidate cost more
2021-01-22 10:04:53 +03:00
Roman Khimov
07583332cd
Merge pull request #1673 from nspcc-dev/vm/calltoken
Implement CALLT opcode
2021-01-22 09:40:16 +03:00
Evgeniy Stratonikov
49de8161ef core: implement LoadToken handler 2021-01-22 09:04:37 +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
Evgenii Stratonikov
bb706aa55b vm: implement CALLT opcode 2021-01-21 19:30:04 +03:00
Roman Khimov
8fad05c5bb
Merge pull request #1679 from nspcc-dev/fix/policysign
Check for committee witness in native contracts
2021-01-21 15:42:36 +03:00
Evgeniy Stratonikov
c6894f3f55 native: check for committee in setters 2021-01-21 15:20:34 +03:00
Evgeniy Stratonikov
24d9a31476 testchain: support signing tx by committee 2021-01-21 14:51:15 +03:00
Roman Khimov
fbbcb16fa1
Merge pull request #1672 from nspcc-dev/fix/nef
Fix NEF serialization
2021-01-19 15:57:48 +03:00
Evgeniy Stratonikov
719dceff77 nef: merge Compiler and Version fields 2021-01-19 11:19:28 +03:00
Evgeniy Stratonikov
0bbdee2ce1 nef: add Reserved bytes 2021-01-19 11:19:28 +03:00
Evgeniy Stratonikov
52843fc1bf nef: add Tokens field 2021-01-19 11:19:24 +03:00
Evgeniy Stratonikov
7fb40e104a io: allow to restrict string size 2021-01-19 11:16:23 +03:00
Roman Khimov
376c22adee
Merge pull request #1670 from nspcc-dev/vm/popitem
Add POPITEM opcode
2021-01-19 09:51:53 +03:00
Evgeniy Stratonikov
f0fe03117a compiler: optimize struct copy a bit
POPITEM is cheaper than PUSH + PICKITEM.
2021-01-19 09:46:01 +03:00
Evgeniy Stratonikov
324107b31e vm: implement POPITEM opcode 2021-01-19 09:46:01 +03:00
Roman Khimov
a2921e38b7
Merge pull request #1671 from nspcc-dev/register-connected-fix
network: don't register addresses before version handshake
2021-01-18 23:12:03 +03:00
Roman Khimov
163d90c866 network: don't register addresses before version handshake
1) It duplicates registration in `version` message handler and no valid
   connection can work without version exchange.
2) On public networks we have seed nodes defined by names, so we register
   connections to them using these names, but then if connection is dropped we
   delist them by IP:PORT combinations which can lead to zero PeerCount() with
   all seeds still being registered as connected in the discovery subsystem
   and thus no reconnection attempts being made.
2021-01-18 21:10:06 +03:00
Roman Khimov
7d937827e3
Merge pull request #1669 from nspcc-dev/native-contract-by-id
Call native contracts by ID
2021-01-18 10:32:14 +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
Roman Khimov
09ca2cc6e3
Merge pull request #1656 from nspcc-dev/vm/iterators
Update iterator API
2021-01-15 21:20:57 +03:00
Roman Khimov
db122de197 storage: fix linter warnings
pkg/core/interop/storage/find.go:19:6: exported type Iterator should have comment or be unexported
pkg/core/interop/storage/find.go:25:1: exported function NewIterator should have comment or be unexported
pkg/core/interop/storage/find.go:33:1: exported method Iterator.Next should have comment or be unexported
pkg/core/interop/storage/find.go:35:3: should replace s.index += 1 with s.index++
pkg/core/interop/storage/find.go:40:1: exported method Iterator.Value should have comment or be unexported
2021-01-15 21:12:10 +03:00
Evgeniy Stratonikov
50d515a3e5 cli: add tests for Storage.Find invocations
It returns values of different types we better be sure that
compiler emits correct code.
2021-01-15 21:12:10 +03:00
Evgeniy Stratonikov
9b1a7021ba core: add PickN flags to Storage.Find
Allow to pick items by index from serialized struct or array.
2021-01-15 21:12:10 +03:00
Evgeniy Stratonikov
44af99fd07 core: add Deserialize flag to Storage.Find
Allow to deserialize values being iterated over.
2021-01-15 21:12:10 +03:00
Evgeniy Stratonikov
7fc0c04dba core: add flags to Storage.Find
It can be iterated over keys, values or both.
Prefix can be stripped.
2021-01-15 21:12:08 +03:00
Evgeniy Stratonikov
2130e17f0c core,vm: remove System.Enumerator.* interops
Map iterator now returns key-value pair, while array/byte-array
iterators work like old enumerators.
Follow neo-project/neo#2190.
2021-01-15 21:11:32 +03:00
Evgeniy Stratonikov
d04b000748 vm: remove iterator/enumerator Concat API
Follow neo-project/neo#2170.
2021-01-15 21:08:59 +03:00
Roman Khimov
e36e71ffbd
Merge pull request #1647 from nspcc-dev/contractcall
Update `System.Contract.Call`
2021-01-15 21:02:01 +03:00
Roman Khimov
a86a18cc04
Merge pull request #1668 from nspcc-dev/mp_fix
core: fix mempool.Add
2021-01-15 17:21:02 +03:00
Anna Shaleva
09f0f03775 core: fix mempool.Add
Unlucky transaction could also have OracleResponce attribute.
2021-01-15 16:43:21 +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
86b0e76bf0 core: remove callback interops
Follow neo-project/neo#2168 .
2021-01-14 17:53:46 +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
Evgeniy Stratonikov
11191c0a08 nef: support JSON serialization 2021-01-13 15:26:35 +03:00
Roman Khimov
f912ee60df
Merge pull request #1660 from nspcc-dev/initialize-role-management-before-oracles
native: swap oracle and role management init
2021-01-13 13:03:27 +03:00
Roman Khimov
96f5981b2d
Merge pull request #1641 from nspcc-dev/mpt/batch
mpt: support put in batches
2021-01-13 13:02:27 +03:00
Evgenii Stratonikov
fb88d4f3a0 mpt: support put in batches 2021-01-13 12:25:27 +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