Commit graph

1563 commits

Author SHA1 Message Date
Roman Khimov
9c34dea296 rpc/server: return more specific error in getblockhash 2021-02-15 16:18:03 +03:00
Roman Khimov
c3b6405f0f transaction: fix asset type JSONization
It's stringy in C#.
2021-02-12 23:02:51 +03:00
Roman Khimov
90a06ed7a5 rpc: fix IsFrozen JSONization for assets
C# node uses `frozen` as field name here.
2021-02-12 00:04:13 +03:00
Roman Khimov
9571ecffac core: add proper asset issuer for UTXO assets
It just wasn't set which is wrong (AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM was
always the issuer).
2021-02-12 00:01:00 +03:00
Roman Khimov
89fb02a7f8
Merge pull request #1648 from nspcc-dev/backport-fixes-from-master
Backport fixes from master to 2.x
2021-01-11 12:44:05 +03:00
Roman Khimov
9e35758653 rpc: fix gettxout result for already spent outputs
As per C# documentation [1]:
  If the transaction output is already spent, the result value will be null .

[1]: https://docs.neo.org/docs/en-us/reference/rpc/latest-version/api/gettxout.html
2020-12-31 13:54:42 +03:00
Evgenii Stratonikov
ee45d7739f network: fix requestTx()
2 bugs were here:
1. If amount of tx is small, no messages were sent.
2. Correctly cut byte slice if last message is small.
2020-12-31 13:00:50 +03:00
Roman Khimov
363c24d128 network: fix tx requests, we can't ask more than 500 txes at once 2020-12-31 13:00:00 +03:00
Evgenii Stratonikov
9756ed2b06 network: set timeout on write
Fix a bug occuring under high load when node
hangs during this write.
2020-12-31 12:58:00 +03:00
Evgenii Stratonikov
edf587bbf1 network: fix a bug in discovery with a peer connected twice
It could be the case that checks are performed simultaneosly and
peers connections goes down from 2 to 0. We must take such case into
account and register address as good in discovery.
2020-12-31 12:57:43 +03:00
Evgenii Stratonikov
0d2bc8f4a6 network: remove extra error check from Message.Encode()
Buffer write error is returned from `Encode()`.
2020-12-31 12:52:40 +03:00
Evgenii Stratonikov
0510d1e6c1 vmcli: return after error in break 2020-12-31 12:51:01 +03:00
Evgenii Stratonikov
5d6065c3ee vmcli: set breakpoint before the instruction
Breakpoint should occur before actual instruction execution.
2020-12-31 12:50:52 +03:00
Anna Shaleva
4a8259caea rpc: adjust getrawtransaction and gettransactionheight RPC call
We should not return transaction metadata from `getrawtransaction` in case
transaction is not in the mempool. Height shouldn't be returned from
`gettransactionheight` in case transaction is in the mempool.
2020-12-31 12:44:07 +03:00
Roman Khimov
124c674b17 *: gofmt -s 2020-12-31 11:52:27 +03:00
Anna Shaleva
66a64dd4c9 core: fix bug with mempool.verifiedMap
Changes ported from #1621.
2020-12-16 14:14:09 +03:00
Roman Khimov
64d0876fc0
Merge pull request #1503 from nspcc-dev/mpt/refcount
Implement reference counting in MPT
2020-11-18 14:20:42 +03:00
Evgenii Stratonikov
0ffffb93d7 mpt: implement reference counting 2020-11-18 12:16:05 +03:00
Evgenii Stratonikov
d93ddfda10 network: retransmit stale transactions 2020-11-11 15:51:36 +03:00
Roman Khimov
06f3c34981 mempool: replace timeStamp with blockStamp
Time is not really relevant for us here and we don't use this timestamp in any
way. Yet it occupies 24 bytes and we do two clock_gettime calls to get it.

Replace it with blockStamp which is going to be used in the future for
transaction retransmissions.

It allows to improve single-node TPS by another 3%.
2020-11-11 15:48:13 +03:00
Evgenii Stratonikov
f3abbf34e3 mpt: fill cached fields when getting node from store
Node which has been got from store shouldn't be flushed again.
2020-11-11 13:22:53 +03:00
Evgenii Stratonikov
df1792c80b mpt: export func for decoding node with type
`NodeObject` can contain auxilliary fields and shouldn't be used from outside.
2020-11-11 13:22:53 +03:00
Anna Shaleva
ef3eb0a842 rpc: allow batch JSON-RPC requests
Close #1509
2020-11-06 17:20:27 +03:00
Roman Khimov
68fc8168ec rpc: add getblocktransfertx RPC call
It uses a bit different output format than getalltransfertx, so
TransferTxEvent type was adjusted accordingly.
2020-11-02 19:01:48 +03:00
Roman Khimov
136e4b5886 core: move NotificationEvent->NEP5Transfer conversion to state
We'll need it as a separate function and it's cleaner this way.
2020-10-29 22:10:40 +03:00
Roman Khimov
14c39b2b26 storage: fix Get for BoltDB, fix #1482 2020-10-13 19:21:57 +03:00
Roman Khimov
d2ee2b5f9f
Merge pull request #1483 from nspcc-dev/2.x-fix-empty-discovery-pool
2.x fix empty discovery pool
2020-10-13 19:00:20 +03:00
Roman Khimov
78773df6ec network: try connecting to seeds indefinitely, use them with 0 pool
If the node is to start with seeds unavailable it will try connecting to each
of them three times, blacklist them and then sit forever waiting for
something. It's not a good behavior, it should always try connecting to seeds
if nothing else works.
2020-10-13 18:00:31 +03:00
Roman Khimov
b36371ed94 network: an address should either be good or bad, but not both 2020-10-13 14:16:06 +03:00
Anna Shaleva
168366f33e core: copy storage item key in simple.GetStorageItems
Close #1468.

We should copy the key to avoid bytes substitution. Otherwise there's a
chance that at the end of dao.Store.Seek(...) execution some keys won't
be the same as the original keys found inside saveToMap function.
2020-10-10 12:24:08 +03:00
Roman Khimov
ca0ff47c05 update dbft, pick timer improvements and other optimizations 2020-09-25 23:06:23 +03:00
Roman Khimov
e3c360c477 vm: fix comment typo 2020-09-15 21:44:54 +03:00
Roman Khimov
b8705bdb79 rpc/server: use strings for sys and net fees in TransferTx
The same they're displayed for transactions.
2020-09-15 20:34:34 +03:00
Roman Khimov
ec631984d0
Merge pull request #1399 from nspcc-dev/getalltransfertx-2.x
Getalltransfertx 2.x
2020-09-15 19:01:24 +03:00
Roman Khimov
615ae1b3aa docs: update RPC documentation with *transfers changes 2020-09-15 12:46:40 +03:00
Roman Khimov
2e0e5cff25 rpc/client: add support for getutxotransfers call 2020-09-15 12:46:40 +03:00
Roman Khimov
26d4a05e57 rpc/client: update GetNEP5Transfers call 2020-09-15 12:46:40 +03:00
Roman Khimov
23719f7e72 rpc/server: add new getalltransfertx API
It unifies UTXO and NEP5 transfers for a given address and presents it with
transaction-level grouping (and additional metadata).
2020-09-15 12:46:39 +03:00
Roman Khimov
4f7fa732cf core|config: make max(free)txperblock height-dependent
See neo-project/neo-modules#336.
2020-09-14 22:57:03 +03:00
Roman Khimov
010c22e2b5 rpc/server: limit the maximum number of elements for get*transfers 2020-09-14 17:48:17 +03:00
Roman Khimov
56d57611ca rpc: add paging to get*transfer calls 2020-09-13 00:12:45 +03:00
Roman Khimov
0ece58e6dd rpc/server: deduplicate parameter parsing for get*transfers 2020-09-11 22:33:17 +03:00
Roman Khimov
e14ba6c855 core: fix policy-enforcing network fee check
0.001 should be added to the 'extra' value as per https://neo.org/blog/details/4148
2020-09-11 16:52:58 +03:00
Roman Khimov
0ef65d1bb9 config: add minimum network fee setting
Follow neo-project/neo#1901.
2020-09-11 15:41:08 +03:00
Roman Khimov
8865d5b2c5
Merge pull request #1395 from nspcc-dev/add-limits-to-gettransfers
Add limits to get(nep5|utxo)transfers
2020-09-09 15:45:09 +03:00
Roman Khimov
5b05081525 config: allow configuring free gas depending on height
And update default mainnet/testnet settings. Follow neo-project/neo#1888 and
neo-project/neo-node#656.
2020-09-08 18:52:53 +03:00
Roman Khimov
b310ac051b core/rpc: add continue flag to iterating functions
Most of the time we don't need to get all transfers from the DB and
deserialize them.
2020-09-08 15:38:33 +03:00
Roman Khimov
d3e415d3bd core/state: reverse the order of ForEachTransfer
When using limits we're usually concerned about the most recent
transfers. Returning 3 transfers from the middle of the chain isn't very
helpful.
2020-09-08 12:57:45 +03:00
Roman Khimov
6761efff24 rpc/server: add limit to get*transfers calls
Return only N transfers requested.
2020-09-08 12:56:52 +03:00
Roman Khimov
9aee3e5a34 transaction: set output position when decoding
We had a kludge for getrawtransaction to set this useless field, but
7e371588a7 broke it. Add it right into the
decoder now to fix all types of queries (getblock/getrawtransaction/gettxout).

Fixes #1392.
2020-09-07 15:37:57 +03:00