Commit graph

110 commits

Author SHA1 Message Date
Evgeniy Stratonikov
18911caa3a Revert "rpc: marshal GAS in getunclaimedgas as decimal"
This reverts commit df801a8539.
2021-02-09 11:37:25 +03:00
Evgeniy Stratonikov
b0fbd897ad Revert "rpc: marshal fees and GAS as Fixed8 decimal"
This reverts commit a79b12b4d4.
2021-02-09 11:16:52 +03:00
Evgenii Stratonikov
7368ff09ef rpc: marshal GAS correctly
When using ",string" in JSON struct tag, value is first unmarshaled to
a numeric value (float64 in our case), then to our real type via
`UnmarshalJSON()`, which can lead to rounding errors.
2020-12-10 15:32:00 +03:00
Evgenii Stratonikov
df801a8539 rpc: marshal GAS in getunclaimedgas as decimal 2020-12-09 11:19:25 +03:00
Evgenii Stratonikov
e4c3339c91 util: move Fixed8 to encoding/fixedn package 2020-12-09 11:18:18 +03:00
Evgenii Stratonikov
a79b12b4d4 rpc: marshal fees and GAS as Fixed8 decimal 2020-11-26 15:04:30 +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
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
1869d6d460 core: allow to use state root in header 2020-11-20 17:16:32 +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
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
Anna Shaleva
0b15ca8bd0 rpc: add trigger parameter to getapplicationlog 2020-11-12 17:43:11 +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
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
6ee919747f rpc: allow batch JSON-RPC requests
Close #1509
2020-11-06 17:06:20 +03:00
Anna Shaleva
474d2dfb65 rpc: add Magic to Version 2020-10-19 11:51:27 +03:00
Anna Shaleva
c50f3db6ad rpc, cli: encode script in base64 for Invoke* 2020-10-19 11:51:27 +03:00
Anna Shaleva
19a2e3bb91 rpc: add transaction field to InvokeResult 2020-10-17 00:42:39 +03:00
Anna Shaleva
9a493dd2a0 rpc: add FaultException to result.Invoke
Close #1440
2020-10-08 16:12:14 +03:00
Anna Shaleva
d27775acc5 rpc: remove json names from result.Invoke struct
We use invokeAux to marshal result.Invoke to JSON.
2020-10-05 16:00:15 +03:00
Roman Khimov
af17bbfeab rpc/server: encode answers more efficiently
We're at the point where even this code can clearly be seen in profiles. We
can save on some buffers (and CPU cycles) by encoding the answer once.

Another ~2% TPS for single node.
2020-09-09 20:46:31 +03:00
Roman Khimov
9187e2ab25 rpc/response: drop unused GetRawTx type 2020-09-09 20:46:31 +03:00
Anna Shaleva
27348973c3 rpc: fix JSON marshalling for Invoke result
We should return a quote string as JSON value in case of recursive
reference, otherwise json.Marshal returns an error.
2020-09-07 13:57:45 +03:00
Anna Shaleva
acacac1b24 rpc: use state.AppExecResult for ApplicationLog marshalling
Closes #1371
2020-09-07 13:38:32 +03:00
Roman Khimov
e7d13e6db2 *: fix misspellings found in Go Report Card 2020-08-14 12:16:24 +03:00
Anna Shaleva
0834661cac rpc: marshal getapplicationlog stack as []stackitem.Item
Following https://github.com/neo-project/neo-modules/issues/318
2020-08-13 17:16:31 +03:00
Roman Khimov
5ef08f60ae remove github.com/pkg/errors from dependencies
It's not needed any more with Go 1.13 as we have wrapping/unwrapping in base
packages. All errors.Wrap calls are replaced with fmt.Errorf, some strings are
improved along the way.
2020-08-07 12:21:52 +03:00
Evgenii Stratonikov
e5d538ed21 core: use raw stack items in application logs
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-07-31 16:07:16 +03:00
Evgenii Stratonikov
9cba25616d rpc: use raw stack items in invoke* RPC
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-07-31 16:07:16 +03:00
Evgenii Stratonikov
805f746f15 rpc: change NotificationEvent format
Name is now a separate field.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-07-31 16:07:16 +03:00
Anna Shaleva
0c424a0ed2 rpc: update getrawtransaction RPC call
Closes #1183.

Added VMState to transaction output raw.
2020-07-29 10:14:08 +03:00
Anna Shaleva
70ef733ce7 core, vm: store VMState as byte instead of string
Part of #1183
2020-07-29 10:14:08 +03:00
Anna Shaleva
990db9f205 rpc: update getrawmempool RPC-call result
Closes #1182
2020-07-29 10:14:01 +03:00
Roman Khimov
c4cde44543
Merge pull request #1216 from nspcc-dev/neo3/rpc/sendrawtransaction
rpc: adjust `sendrawtransaction` and `submitblock` RPC calls
2020-07-22 22:13:21 +03:00
Anna Shaleva
c2534b1a0b rpc: adjust sendrawtransaction RPC-call
It should return tx has instead of boolean.
2020-07-22 08:37:46 +03:00
Evgenii Stratonikov
3d7fa9de93 *: make Notify interop accept event name 2020-07-20 13:33:32 +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
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
51576f236d rpc: adjust getapplicationlog RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Anna Shaleva
73b630db9b *: switch from fixed8 to int64
Follow C# implementation, we have to marshall JSON Fixed8 fields without
taking into account decimals.
2020-06-29 21:39:27 +03:00
Evgenii Stratonikov
3787a8895e rpc: marshal GasConsumed getapplicationlog as string
Also there is no more decimal point.
2020-06-19 11:38:56 +03:00
Evgenii Stratonikov
c0e482fe6c rpc: restructure getapplicationlog response
Move VM-related fields to top-level.
2020-06-19 11:38:56 +03:00
Roman Khimov
5fe8287fbb rpc: use non-pointer Block and Transaction in results
Pointers can be nil and in some cases it's important to always have access to
Block or Transaction fields.
2020-06-18 12:13:35 +03:00