Evgenii Stratonikov
966b50f2ae
core: save StateRootInHeader in genesis block
2020-11-24 16:39:56 +03:00
Evgenii Stratonikov
7d91a3a89e
pkg: move internal/ package to the root directory
...
This way we can use it in scripts and cli.
2020-11-24 16:39:56 +03:00
Evgenii Stratonikov
31eca342eb
*: replace all NEP5 occurences to NEP17
2020-11-24 13:08:24 +03:00
Evgenii Stratonikov
b97dfae8d8
native: replace NEP-5 with NEP-17
2020-11-24 13:08:23 +03:00
Evgenii Stratonikov
a5914f89fa
core: allow to provide block in GetTestVM()
...
Sometimes amount of GAS consumed depends on block height.
2020-11-24 12:17:29 +03:00
Evgenii Stratonikov
42ae226f9e
native: use proper stack for result
...
When native method calls other contract result should be put
on the stack of current context. With oracles this problem wasn't
noticed because of void return type.
2020-11-24 12:17:28 +03:00
Evgenii Stratonikov
4de233b339
emit: allow to emit nested arrays
2020-11-24 11:23:44 +03:00
Evgenii Stratonikov
c849176be7
manifest: include contract Name
2020-11-24 11:23:44 +03:00
Evgenii Stratonikov
8e60a65b55
rpc: implement verifyproof RPC
...
Test getproof and verifyproof together.
2020-11-20 18:06:22 +03:00
Evgenii Stratonikov
e38e8aa48a
rpc: implement getproof RPC
2020-11-20 18:06:22 +03:00
Evgenii Stratonikov
6b42e9306a
rpc/server: implement getstateheight RPC
2020-11-20 18:06:21 +03:00
Evgenii Stratonikov
4de22247d5
rpc/server: implement getstateroot RPC
2020-11-20 17:16:33 +03:00
Evgenii Stratonikov
1869d6d460
core: allow to use state root in header
2020-11-20 17:16:32 +03:00
Evgenii Stratonikov
3025b42c65
consensus: assume non-nil message in decodeData
...
`nil` message is occuring only in tests to check that
no unnecessary decoding is done on errors.
2020-11-20 17:14:19 +03:00
Evgenii Stratonikov
85f927d892
mpt: implement reference counting
...
Also postpone MPT initialization until `storeBlock`
because we need to read-and-check or save info about refcounting
depending on starting height.
2020-11-20 16:50:30 +03:00
Evgenii Stratonikov
1c559634aa
mpt: fill cached fields when getting node from store
...
Node which has been got from store shouldn't be flushed again.
2020-11-19 12:25:43 +03:00
Evgenii Stratonikov
fd9ff4102a
mpt: export func for decoding node with type
...
`NodeObject` can contain auxilliary fields and shouldn't be used from outside.
2020-11-19 12:25:43 +03:00
Roman Khimov
2f824c590a
Merge pull request #1556 from nspcc-dev/allow-null-oracle-filters
...
Allow null oracle filters
2020-11-19 10:30:22 +03:00
Roman Khimov
eef921b8e0
native: allow NULL filter in oracle requests
...
Follow neo-project/neo#2067
2020-11-18 23:59:13 +03:00
Roman Khimov
4640ba2758
Merge pull request #1551 from nspcc-dev/core/adjust_runtime_notify
...
core: adjust System.Runtime.Notify interop
2020-11-18 21:40:54 +03:00
Anna Shaleva
ec8ebc292c
core: restrict notification size for System.Runtime.Notify
2020-11-17 16:27:51 +03:00
Anna Shaleva
8e29a200c0
rpc: adjust NEP5 transfers amount JSON marshalling
...
This committ fixes the difference between Go and C# nodes:
Go:
```
{
"jsonrpc" : "2.0",
"result" : {
"received" : [
{
"blockindex" : 65,
"txhash" : "0x394f851cf167d664c0dbcf98e2e64f2da23022fd7943dcb914492529de20a945",
"transfernotifyindex" : 0,
"timestamp" : 1605535020126,
"transferaddress" : "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY",
"amount" : "29999999",
"assethash" : "0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc"
}
],
"address" : "NULwe3UAHckN2fzNdcVg31tDiaYtMDwANt",
"sent" : []
},
"id" : 1
}
```
C#:
```
{
"id" : 1,
"result" : {
"address" : "NULwe3UAHckN2fzNdcVg31tDiaYtMDwANt",
"sent" : [],
"received" : [
{
"transferaddress" : "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY",
"timestamp" : 1605535020126,
"txhash" : "0x394f851cf167d664c0dbcf98e2e64f2da23022fd7943dcb914492529de20a945",
"blockindex" : 65,
"transfernotifyindex" : 0,
"amount" : "2999999900000000",
"assethash" : "0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc"
}
]
},
"jsonrpc" : "2.0"
}
```
2020-11-17 15:50:19 +03:00
Anna Shaleva
933bb4ca75
core: update committee every [committee length] blocks
...
Was changed in https://github.com/neo-project/neo/pull/1848 . Affects
storage dumps.
2020-11-17 11:22:32 +03:00
Anna Shaleva
054e60c0cf
core: remove NodeList from Oracle storage
...
The reference implementation does not store NodeList. This commit fixes
state difference for genesis block.
2020-11-16 19:09:34 +03:00
Roman Khimov
88cee80a58
Merge pull request #1543 from nspcc-dev/compatibility-fixes
...
rpc, cli: tiny compatibility fixes
2020-11-16 15:53:42 +03:00
Anna Shaleva
083879838c
rpc: adjust getrawtransaction
and gettransactionheight
RPC call
...
We should return verbose transaction in case if it is in the mempool
from `getrawtransaction`. We also shouldn't return height from
`gettransactionheight` in case if transaction is in the mempool.
2020-11-16 13:25:42 +03:00
Roman Khimov
3cb945f022
manifest: simplify marshaling
2020-11-13 21:46:26 +03:00
Roman Khimov
286d9185f4
smartcontract: remove contract features
...
We're featureless now, all contracts have access to storage and payable status
is to be determined via new NEP. Follow neo-project/neo#2060 .
2020-11-13 21:26:23 +03:00
Roman Khimov
112fa5b92d
smartcontract: drop unused ContractDetails
...
That's a remnant from 2.0.
2020-11-13 21:00:54 +03:00
Evgenii Stratonikov
adf403666f
native: decode storage item in Seek
2020-11-13 17:33:00 +03:00
Anna Shaleva
31cf71fb62
rpc: use default Uint160 marshaller for result.NEP5Balance.Asset
...
To match C# behaviour we should marshal asset hash with `0x` prefix.
2020-11-13 12:28:31 +03:00
Roman Khimov
0f827ee6ba
Merge pull request #1531 from nspcc-dev/core/applicationlog_with_multiple_triggers
...
core, rpc: store multiple execution results for single hash
2020-11-12 19:05:22 +03:00
Roman Khimov
543871fb2c
Merge pull request #1541 from nspcc-dev/core/fix_nef_getversion
...
smartcontract: fix nef.GetVersion
2020-11-12 17:56:12 +03:00
Anna Shaleva
251a660b85
smartcontract: ignore case in trigger.FromString
2020-11-12 17:49:28 +03:00
Anna Shaleva
d6992cb5c4
core: marshal block hash for AppExecResult [NotificationsSubsystem]
2020-11-12 17:43:20 +03:00
Anna Shaleva
0b15ca8bd0
rpc: add trigger parameter to getapplicationlog
2020-11-12 17:43:11 +03:00
Anna Shaleva
9c3d8cd398
smartcontract: fix nef.GetVersion
...
It should be able to parse versions like `1.1.1-rc.1`.
Close #1540 .
2020-11-12 17:08:54 +03:00
Anna Shaleva
7ca93e76ac
core, rpc: allow to store several AppExecResult for a single hash
...
It is required for we have several executions per block.
2020-11-12 16:24:39 +03:00
Roman Khimov
2712ef6e5a
Merge pull request #1537 from nspcc-dev/rpc/unify_base64
...
rpc: use base64 for `submitblock` and `sendrawtransaction`
2020-11-12 15:49:39 +03:00
Roman Khimov
9142906abe
Merge pull request #1539 from nspcc-dev/core/fix_mempool_test
...
core: fix failing mempool test
2020-11-12 15:48:28 +03:00
Roman Khimov
11a224057b
Merge pull request #1536 from nspcc-dev/feature/retransmit3
...
network: retransmit stale transactions (master)
2020-11-12 15:47:00 +03:00
Anna Shaleva
20f8fe5699
rpc: use base64 for submitblock
and sendrawtransaction
...
Changes ported from https://github.com/neo-project/neo-modules/pull/394 .
2020-11-12 15:21:35 +03:00
Anna Shaleva
a84e4c1e89
core: make some checks in TestMempoolAddRemoveConflicts non-critical
...
It will help to investigate test failures.
2020-11-12 15:14:32 +03:00
Anna Shaleva
54e6bcad12
core: fix failing mempool test
...
There might be a case when identical nonces are generated for tx6, tx7 or
tx8 (they are not in mempool, so each of them pass mempool-presence
check). In this case test fails due to the lack of hashes into mp.conflicts
map (two of tx6, tx7 or tx8 have identical hashes) with the following
error:
```
=== RUN TestMempoolAddRemoveConflicts
--- FAIL: TestMempoolAddRemoveConflicts (0.00s)
mem_pool_test.go:376:
Error Trace: mem_pool_test.go:376
Error: Not equal:
expected: 4
actual : 3
Test: TestMempoolAddRemoveConflicts
```
Fixed by maling the nonce non-random.
2020-11-12 15:05:01 +03:00
Anna Shaleva
b51eb7f5ef
core: update opcodes prices
...
Changes ported from https://github.com/neo-project/neo/pull/2020 .
2020-11-12 14:20:26 +03:00
Evgenii Stratonikov
3e5b84348d
network: retransmit stale transactions
2020-11-12 13:51:44 +03:00
Anna Shaleva
01296bda5f
core: remove policy default values initialisation
2020-11-10 18:05:40 +03:00
Roman Khimov
62d6f3ba22
Merge pull request #1530 from nspcc-dev/syscall/atoi
...
core: implement `System.Binary.Atoi/Itoa` syscalls
2020-11-10 16:39:02 +03:00
Evgenii Stratonikov
d193e16662
compiler: support System.Binary.Atoi/Itoa
syscalls
2020-11-10 16:15:10 +03:00
Evgenii Stratonikov
e4bf531e3e
core: implement System.Binary.Atoi/Itoa
syscalls
...
They follow C# conversion rules, but differ from our `bigint` module
conversions:
1. String must be big-endian.
2. Sign extension is 4-bit in size (single hex character)
and not 8-byte.
2020-11-10 16:15:10 +03:00
Evgenii Stratonikov
54992ad4f3
core: provide account in calculate claimable
...
`getunclaimedgas` RPC should return all GAS available to claim.
2020-11-10 16:08:21 +03:00
Evgenii Stratonikov
860c146260
native: increase committee GAS bounty
...
Follow neo-project/neo#2049 .
2020-11-10 15:30:31 +03:00
Evgenii Stratonikov
af583c14ea
native: add GAS rewards for voters
...
Close #1348 .
2020-11-10 15:30:30 +03:00
Evgenii Stratonikov
a3c7130ab2
native: cache committee together with votes
2020-11-10 15:23:06 +03:00
Roman Khimov
ede2b05f29
Merge pull request #1529 from nspcc-dev/fix/nextconsensus
...
consensus: update NextConsensus only when committee is recalculated
2020-11-10 10:24:35 +03:00
Evgenii Stratonikov
c30d891aa9
consensus: update NextConsensus only when committee is recalculated
2020-11-09 17:35:32 +03:00
Roman Khimov
a1ce3d2db2
transaction: add new oracle response codes
...
Follow neo-project/neo#2037 .
2020-11-09 16:54:09 +03:00
Roman Khimov
a9dddf893a
Merge pull request #1525 from nspcc-dev/rpc/base64
...
rpc: return bse64 bytes from `getblock`, `getblockheader`, `getrawtx`
2020-11-09 10:48:28 +03:00
Anna Shaleva
6bb81d9b51
rpc: return bse64 bytes from getblock
, getblockheader
, getrawtx
...
Close #1522
2020-11-09 10:29:33 +03:00
Roman Khimov
58f384a323
Merge pull request #1526 from nspcc-dev/improve-worst-case-reverseitems
...
vm: improve REVERSEITEMS for 1M Buffer
2020-11-07 23:18:34 +03:00
Roman Khimov
bf9ecc2bd3
vm: improve REVERSEITEMS for 1M Buffer
...
Before:
BenchmarkOpcodes/REVERSEITEMS/buffer/1M-8 1680 758747 ns/op
After:
BenchmarkOpcodes/REVERSEITEMS/buffer/1M-8 2649 442720 ns/op
2020-11-06 23:31:26 +03:00
Roman Khimov
536f488f0c
Merge pull request #1514 from nspcc-dev/rpc/batch_requests
...
rpc: allow batch JSON-RPC requests
2020-11-06 17:27:23 +03:00
Anna Shaleva
6ee919747f
rpc: allow batch JSON-RPC requests
...
Close #1509
2020-11-06 17:06:20 +03:00
Roman Khimov
bdd073aad7
Merge pull request #1520 from nspcc-dev/tune-some-limits
...
Tune some limits
2020-11-06 15:35:44 +03:00
Roman Khimov
0ee377792e
Merge pull request #1519 from nspcc-dev/designate-role-history
...
native: implement designate contract history retention
2020-11-06 15:35:18 +03:00
Roman Khimov
47421f23f4
native: add events to oracle contract
...
Follow neo-project/neo#2036 .
2020-11-06 13:49:07 +03:00
Roman Khimov
9e781bff47
native: implement designate contract history retention
...
Follow neo-project/neo#2007 . Fix getDesignatedByRole price along the way.
2020-11-06 13:46:40 +03:00
Roman Khimov
b233158c9f
transaction: lower MaxValidUntilBlockIncrement
...
Follow neo-project/neo#2042 .
2020-11-06 13:41:46 +03:00
Roman Khimov
b327308df8
core/config: move MaxTraceableBlocks to configuration file
...
Follow neo-project/neo#2042 , use 2102400 setting for mainnet/testnet and
200000 for private networks.
2020-11-06 13:41:46 +03:00
Roman Khimov
39a38dc5f5
transaction: raise max oracle response size
...
Follow neo-project/neo#1984 .
2020-11-06 13:41:46 +03:00
Roman Khimov
679846c1a1
Merge pull request #1426 from nspcc-dev/rpc/getcontractstate_by_id_or_name
...
rpc: allow to `getcontractstate` by id or name
2020-11-05 13:17:42 +03:00
Roman Khimov
d7502debba
core: adjust storage update fees
...
Follow neo-project/neo#2033 .
2020-11-03 22:50:40 +03:00
Anna Shaleva
b8a88f9378
rpc: allow to use address, id or name instead of scripthash [Client]
...
... for getcontractstate RPC client method.
2020-11-03 17:58:24 +03:00
Anna Shaleva
d3daaafbe4
rpc: allow to get contract scripthash from address, id or name [Server]
...
... for `invokefunction` RPC method.
2020-11-03 17:25:46 +03:00
Anna Shaleva
15a939b1da
rpc: allow to getcontractstate
by address, id or name
...
close #1423
2020-11-03 17:23:49 +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
044786b995
core: use Application trigger in CalculateClaimable()
...
It doesn't need a System one.
2020-10-29 19:17:07 +03:00
Roman Khimov
2522271161
vm: use Application trigger by default
...
Don't mess with System, it's too powerful to be the default.
2020-10-29 19:17:07 +03:00
Roman Khimov
2924ecd453
core: use ic.SpawnVM() in tests, not vm.New()
...
vm.New() sets some arbitrary trigger while interop context always sets
something appropriate according to its state.
2020-10-29 19:17:07 +03:00
Roman Khimov
d4da811d12
Merge pull request #1507 from nspcc-dev/conflicts_attr
...
core: implement Conflicts transaction attribute
2020-10-29 16:54:58 +03:00
Anna Shaleva
ec63d5c456
core: add conflicts attribute
...
Close #1491
2020-10-29 10:57:31 +03:00
Roman Khimov
0eb4ad8564
Merge pull request #1508 from nspcc-dev/core/check_witness_tests
...
core: add CheckWitness tests
2020-10-27 15:56:35 +03:00
Roman Khimov
c4a4a84515
native: lower voting fee
...
Follow neo-project/neo#2010 .
2020-10-26 22:12:56 +03:00
Anna Shaleva
5a15e6b54c
core: add tests for CheckWitness
...
Close #1366
2020-10-26 20:30:45 +03:00
Anna Shaleva
204d7f1c6a
core: refactor runtime.CheckWitness interop
...
Removed unreachable code, see
8fed383523
runtime.CheckHashedWitness can only be used for transaction
verification, the other two options from reference implementation (block
and consensus payload) have separate methods for verification.
2020-10-26 20:26:21 +03:00
Roman Khimov
eca1221d22
Merge pull request #1504 from nspcc-dev/core/native_serialisation
...
core: native serialisation
2020-10-23 18:38:35 +03:00
Anna Shaleva
f259a614de
core: add transaction.HasSigner method
2020-10-23 16:32:26 +03:00
Anna Shaleva
0232bbcb0c
core: refactor GASRecord handling
...
We should store each GAS record as
{
Key: ContractID + RecordsPrefix + RecordID,
Value: RecordValue,
}
So don't use state.GASRecord for storing anymore. However, it's still
useful to cache GasRecord values by using state.GASRecords, because we
have to keep GASIndexPairs sorted by indexes.
2020-10-23 12:49:12 +03:00
Anna Shaleva
0da01fde7f
core: refactor blocked accounts logic
2020-10-23 11:42:30 +03:00
Roman Khimov
1956f2c079
Merge pull request #1496 from nspcc-dev/signatures-collection
...
core: implement NotValidBefore and Reserved tx attributes
2020-10-23 11:26:49 +03:00
Anna Shaleva
7947e99a1e
core: add transaction.GetAttributes
2020-10-23 11:05:03 +03:00
Anna Shaleva
95630b72e8
core: verify transaction attributes before adding it into mempool
...
Attributes check should be done before adding transaction to
the pool, otherwise there might be a case when transaction with invalid
attributes is in the pool.
2020-10-23 11:05:03 +03:00
Anna Shaleva
a6579a05ac
core: refactor transaction.Attribute unmarshalling
2020-10-23 11:05:03 +03:00
Anna Shaleva
09b8b8de73
core: reserve attributes range for experimantal purposes
2020-10-23 11:04:59 +03:00
Anna Shaleva
368ff820b3
core: add NotValidBefore transaction attribute
...
Close #1490
2020-10-23 11:02:46 +03:00
Anna Shaleva
6685f8eba9
core: restrict the maximum number of requests per URL
2020-10-22 11:32:02 +03:00
Anna Shaleva
7c232e2ddc
core: add max nodes count restriction to designate contract
2020-10-22 11:32:02 +03:00
Roman Khimov
8be7cd4bff
Merge pull request #1489 from nspcc-dev/rpc/invoke_with_base64
...
rpc, cli: use base64 script encoding for Invoke* calls; add Magic to `getversion` RPC call
2020-10-19 16:17:06 +03:00
Roman Khimov
62be070737
Merge pull request #1499 from nspcc-dev/rpc/notifications_subscriptions_fix
...
rpc: fix Matches and marshalling for notification events
2020-10-19 16:15:39 +03:00
Anna Shaleva
590be7a58d
rpc, cli: remove Network from RPC client and cli
2020-10-19 16:11:11 +03:00