Roman Khimov
b44f9eefb0
rpc: correctly handle RPC invocations with no arguments, fix #2219
...
In N3 no arguments passed should be treated as empty arguments array not as
missing array of arguments, because the array must be present even for
functions that accept no parameters.
2021-10-16 21:28:43 +03:00
Anna Shaleva
55fb221bbb
rpc: make getproof
work with destroyed contracts
...
Now it's able to get proof for destroyed contract if the contract wasn't
destroyed before the requested stateroot's height.
2021-10-15 07:06:25 +03:00
Roman Khimov
2bec43511d
Merge pull request #2207 from nspcc-dev/rpc/gethistoricalstate
...
rpc: implement `getstate` and `findstates` RPC methods
2021-10-13 15:27:51 +03:00
Anna Shaleva
360bb220b0
rpc: remove unnecessary base64 encoding
...
It's default encoding for []byte.
2021-10-13 14:47:59 +03:00
Anna Shaleva
892eadf86d
core: mandate passing from
as a subprefix for (*Trie).Find
...
However, we need to distinguish empty subprefix and nil subprefix (no
start specified) to match the C# behaviour.
2021-10-13 14:47:41 +03:00
Anna Shaleva
43ac4e1517
rpc: implement findstates
RPC handler
2021-10-13 11:41:05 +03:00
Anna Shaleva
6eb3cad6d5
rpc: use uint64 for timestamp boundaries in GetNEP17Transfers
...
Block's timestamp is in milliseconds, so it overflows uint32.
2021-10-11 17:34:05 +03:00
Anna Shaleva
01143da621
rpc: add getstate
RPC handler
2021-10-11 16:43:44 +03:00
Roman Khimov
b4e24bef14
Merge pull request #2202 from nspcc-dev/validatorscount
...
rpc: add validatorscount to getversion response
2021-09-29 11:55:59 +03:00
Roman Khimov
5a2b77238c
rpc: add validatorscount to getversion response
...
See neo-project/neo-modules#642 .
2021-09-28 10:10:26 +03:00
Evgeniy Stratonikov
45976a4111
rpc/response: beautify error message
...
If `Error.Cause` is nil, omit ugly `%s!<nil>`.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-09-28 09:57:42 +03:00
Anna Shaleva
5c97e0dcf2
rpc: move NotaryRequestEvent to the subscriptions pkg
...
It is used for subscriptions only, so move it to the subscriptions pkg.
2021-09-24 17:42:59 +03:00
Anna Shaleva
b3ea7504cb
subscriptions: add container hash to notification event
...
External users make use of it. Close #2190 .
2021-09-24 17:42:02 +03:00
Roman Khimov
42a9d3d7b8
nef: add Source field
...
Follow neo-project/neo#2605 .
2021-09-24 00:19:37 +03:00
Anna Shaleva
c113d682bd
core: fix NEO balance state handler
...
We need to store NEO balance's LastUpdateHeight before GAS mint,
because mint can call onNEP17Payment and onNEP17Payment can call NEO
transfer which also calls GAS mint. Storing balance height allows to
avoid recursion.
2021-09-20 19:23:35 +03:00
Roman Khimov
621478296c
Merge pull request #2161 from nspcc-dev/rpc-get-version
...
rpc: return protocol parameters in `getversion`, fix #2160
2021-09-13 19:10:43 +03:00
Evgeniy Stratonikov
8a3e05096b
*: gofmt -s
...
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-09-10 21:49:11 +03:00
Evgeniy Stratonikov
c465b18cb2
rpc: return protocol parameters in getversion
, fix #2160
...
`StateRootInHeader` is duplicated similarly to `Network`.
It will be removed in future as it is surely a protocol parameter.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-09-10 21:45:59 +03:00
Roman Khimov
63e00ac128
Merge pull request #2166 from nspcc-dev/fix-nns-compat
...
Fix NNS compatibility
2021-09-10 18:10:17 +03:00
Roman Khimov
aaccf748ac
nft-nd-nns: add getAllRecords method
...
See neo-project/non-native-contracts#5 .
2021-09-10 16:30:45 +03:00
Anna Shaleva
b989fdb462
rpc: fill transaction witnesses during invokescript
handling
2021-09-10 11:38:59 +03:00
Anna Shaleva
61faf28738
rpc: avoid null
unverified transactions in getrawmempool
response
2021-09-10 11:38:59 +03:00
Anna Shaleva
ed9cdfe667
rpc: use core Header for getblockheader
response
...
Nonce and Primary fields were missing from response.
2021-09-09 18:47:22 +03:00
Roman Khimov
b502c5f148
Merge pull request #2162 from nspcc-dev/docs/update
...
docs: minor documentation updates and adjustments
2021-09-09 12:38:20 +03:00
Anna Shaleva
df8141ff7d
rpc: adjust client documentation
2021-09-08 17:53:09 +03:00
Anna Shaleva
74f1848d19
core: adjust LastUpdatedBlock calculation for NEP17 balances
...
...wrt P2PStateExchange setting.
2021-09-07 19:43:27 +03:00
Evgeniy Stratonikov
9d34547118
rpc/client: add MaxConnsPerHost
option, fix #2149
...
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-09-02 11:26:17 +03:00
Evgeniy Stratonikov
3c34e6fa21
rpc/request: delay parameter unmarshaling
...
It is rather costly to try to unmarshal many structs in order.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-08-13 16:22:54 +03:00
Anna Shaleva
e8bed184d5
core: implement dynamic NEP17 balances tracking
...
Request NEP17 balances from a set of NEP17 contracts instead of getting
them from storage. LastUpdatedBlock tracking remains untouched, because
there's no way to retrieve it dynamically.
2021-07-29 10:23:01 +03:00
Anna Shaleva
e46d76d7aa
core: rename state.NEP17Balances to state.NEP17TransferInfo
...
Balances are to be removed from state.NEP17TransferInfo, so the remnant
fields are NextTransferBatch, NewBatch and a map of LastUpdatedBlocks.
These fields are more staff-related.
Also rename dao.[Get, Put, put]NEP17Balances and STNEP17Balances
preffix.
Also rename NEP17TransferInfo.Trackers to LastUpdatedBlockTrackers
because NEP17TransferInfo.Balances are to be removed.
2021-07-28 13:22:53 +03:00
Roman Khimov
7366d45985
rpc: add GetStateHeight to client
2021-07-22 21:13:44 +03:00
Roman Khimov
a188d20fd1
rpc: fix getstateheight result compatibility
...
C#:
"result" : {
"localrootindex" : 11623,
"validatedrootindex" : 11623
}
Go:
"result" : {
"blockHeight" : 11627,
"stateHeight" : 11627
}
2021-07-22 21:13:44 +03:00
Roman Khimov
5bdcd4c241
client: add GetCandidateRegisterPrice method
...
It's important for clients.
2021-07-21 12:19:55 +03:00
Roman Khimov
a617390185
rpc/request: support passing accounts as addresses
...
Turns out, it's completely legal in C#, see neo-project/neo#2543 .
2021-07-18 16:45:53 +03:00
Evgeniy Stratonikov
3a4e0caeb8
core/block: add Nonce
field to header
...
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-07-15 15:58:49 +03:00
Roman Khimov
473a1fc24e
rpc/server: fix sporadic test failures
...
It can still be "reading" after test end:
subscription_test.go:24:
Error Trace: subscription_test.go:24
asm_amd64.s:1374
Error: Received unexpected error:
set tcp 127.0.0.1:49874: use of closed network connection
Test: TestFilteredNotaryRequestSubscriptions
==================
WARNING: DATA RACE
Write at 0x00c000e28989 by goroutine 185:
testing.tRunner()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1126 +0x21a
Previous write at 0x00c000e28989 by goroutine 192:
testing.(*common).FailNow()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:731 +0x4f
testing.(*T).FailNow()
<autogenerated>:1 +0x44
github.com/stretchr/testify/require.NoError()
/home/runner/go/pkg/mod/github.com/stretchr/testify@v1.6.1/require/require.go:1038 +0x104
github.com/nspcc-dev/neo-go/pkg/rpc/server.wsReader()
/home/runner/work/neo-go/neo-go/pkg/rpc/server/subscription_test.go:24 +0x187
Goroutine 185 (running) created at:
testing.(*T).Run()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1168 +0x5bb
testing.runTests.func1()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1439 +0xa6
testing.tRunner()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1123 +0x202
testing.runTests()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1437 +0x612
testing.(*M).Run()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1345 +0x3b3
main.main()
_testmain.go:89 +0x236
Goroutine 192 (finished) created at:
github.com/nspcc-dev/neo-go/pkg/rpc/server.initCleanServerAndWSClient()
/home/runner/work/neo-go/neo-go/pkg/rpc/server/subscription_test.go:65 +0x294
github.com/nspcc-dev/neo-go/pkg/rpc/server.TestFilteredNotaryRequestSubscriptions()
/home/runner/work/neo-go/neo-go/pkg/rpc/server/subscription_test.go:348 +0x68d
testing.tRunner()
/opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1123 +0x202
==================
testing.go:1038: race detected during execution of test
2021-07-08 10:40:54 +03:00
Roman Khimov
23fb5dd420
rpc/server: properly shutdown things in subscription test
...
Chain is the last one to Close().
2021-07-07 20:47:34 +03:00
Roman Khimov
0cd9cd0c80
state/result: save/return real JSONization errors
...
Don't hide/obfuscate real problems.
2021-07-07 00:42:36 +03:00
Evgeniy Stratonikov
aa76383fa7
compiler: extend permission check to runtime hashes
...
If a method is known at compile time we can still check
if it is present in the list of methods of at least one contract.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-06-28 11:49:30 +03:00
Anna Shaleva
50296975e2
crypto: allow to provide non-default scrypt parameters
2021-06-11 15:22:28 +03:00
Roman Khimov
a6fc5d9fe4
Merge pull request #1998 from nspcc-dev/fix-calculatenetworkfee-result
...
rpc: wrap calculatenetworkfee result in a structure
2021-06-07 09:53:48 +03:00
Roman Khimov
6a61e86d12
rpc: wrap calculatenetworkfee result in a structure
...
C#:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"networkfee": "1185120"
}
}
Go:
{
"id": 2,
"jsonrpc": "2.0",
"result": 1185120
}
Thanks @csmuller for finding it.
2021-06-04 23:38:35 +03:00
Anna Shaleva
1dbf1d4310
rpc: allow to track notary requests via Notification subsystem
2021-06-01 16:29:04 +03:00
Evgeniy Stratonikov
c8ddc790d9
rpc/request: handle bool parameters correctly
2021-05-25 11:24:28 +03:00
Anna Shaleva
2d20b0fa23
core: remove nnsrecords package from native
...
Use nns from examples instead.
2021-05-17 22:24:56 +03:00
Anna Shaleva
7180b2ce06
rpc: use non-native NNS instead of native NNS in testchain
2021-05-17 22:08:15 +03:00
Roman Khimov
9d2712573f
*: enable godot linter and fix all its warnings
...
It's important for NeoGo to have clean documentation. No functional changes.
2021-05-12 23:17:03 +03:00
Roman Khimov
c4e084b0d8
*: fix whitespace errors
...
leading/trailing newlines
2021-05-12 22:51:41 +03:00
Roman Khimov
a44376903a
rpc: fix errcheck warnings in websocket code
2021-05-12 21:48:38 +03:00
Roman Khimov
e9cefc4bfc
*: fix all errcheck warnings in testing code
2021-05-12 21:45:12 +03:00