Commit graph

198 commits

Author SHA1 Message Date
Roman Khimov
8746d9877e keys: move from btcd/btcec to decred/secp256k1 package
There is a security issue found in github.com/btcsuite/btcd that we don't care
about (we're only using 256k1 implementation), but GitHub complains about
it. We could update to github.com/btcsuite/btcd/btcec/v2, but it's now just a
thin wrapper over github.com/decred/dcrd/dcrec/secp256k1/v4, so we better use
it directly.
2022-11-08 17:59:59 +03:00
Roman Khimov
493b979b95 dbft: rev up, fix context timestamp initialization
See nspcc-dev/dbft#64, fixes #2753.
2022-10-20 12:38:14 +03:00
Roman Khimov
73ce898e27 network/consensus: use new dbft StopTxFlow callback
It makes sense in general (further narrowing down the time window when
transactions are processed by consensus thread) and it improves block times a
little too, especially in the 7+2 scenario.

Related to #2744.
2022-10-18 11:06:20 +03:00
Anna Shaleva
08e2511676 *: update interop dependency 2022-09-27 15:34:20 +03:00
Anna Shaleva
ae511447f9 *: update interop dependency 2022-09-23 08:58:55 +03:00
Anna Shaleva
25667914fa *: update interop dependency 2022-09-21 17:40:34 +03:00
Anna Shaleva
0477f83ea8 *: update interop version 2022-09-20 09:43:37 +03:00
Roman Khimov
ee5f8b6c21 consensus: update dbft, drop marshaling from private key
dbft doesn not need this and we must not leak the key in any way.
2022-09-02 14:44:18 +03:00
Anna Shaleva
119b40c378 *: update interop deps 2022-08-09 15:40:15 +03:00
Anna Shaleva
3094d3e0c1 *: update prometheus client library 2022-08-09 15:37:59 +03:00
Anna Shaleva
bb751535d3 *: bump minimum supported go version
Close #2497.
2022-08-08 13:59:32 +03:00
Roman Khimov
3e406c3779 go.mod: update interops, just in case 2022-07-28 17:03:43 +03:00
Roman Khimov
55f910777e Revert "native/interop: revert management.hasMethod()"
This reverts commit 6c7a401f77, introducing
changes from #2598 again.
2022-07-28 17:00:34 +03:00
Roman Khimov
c7b12f8d4c Revert "go.mod: update interop dependencies"
This reverts commit 1a8bff5bbf to simplify
subsequent reverts.
2022-07-28 17:00:19 +03:00
Roman Khimov
1a8bff5bbf go.mod: update interop dependencies
Just to make sure we're not missing something and using the latest ones.
2022-07-27 23:30:01 +03:00
Roman Khimov
6c7a401f77 native/interop: revert management.hasMethod()
This reverts commits
 * f50bcf617a
 * 4f184498bc
 * ab3330564a

because they're 3.4.0-compatible while we need 3.3.1.
2022-07-27 23:26:24 +03:00
Roman Khimov
f50bcf617a compiler: add test for hasMethod, update all go.mods 2022-07-13 18:22:05 +03:00
Anna Shaleva
3594c4f760 examples: update interop deps 2022-07-11 16:01:19 +03:00
Anna Shaleva
cbd20eb959 rpc: implement iterator sessions 2022-07-08 17:05:18 +03:00
Roman Khimov
8d08c4afee go.mod: update dbft
Import nspcc-dev/dbft#61.
2022-06-29 14:32:07 +03:00
Roman Khimov
52fd897324 go.mod: update dbft, pick up cv save fix 2022-06-29 10:38:31 +03:00
Roman Khimov
65c8aa7701 go.mod: update dbft, pick up recovery message send fix 2022-06-07 16:40:37 +03:00
Anna Shaleva
3c2fc165b6 gomod: update interop dependency 2022-06-01 15:10:43 +03:00
Evgeniy Stratonikov
ec21c14ca9 gomod: upgrade yaml package from v2 to v3
Close #2085.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-05-30 15:26:17 +03:00
Roman Khimov
d626a877c9
Merge pull request #2512 from nspcc-dev/update-dbft
go.mod: update dbft, pick up cv fix
2022-05-23 15:32:49 +03:00
Roman Khimov
82da32ded4 go.mod: update dbft, pick up cv fix 2022-05-23 15:22:14 +03:00
Anna Shaleva
1cc107d461 gomod: update interop dependency 2022-05-23 14:05:00 +03:00
Anna Shaleva
bb5cffc4a8 gomod: update interop dependency 2022-05-12 14:32:28 +03:00
Anna Shaleva
8802dcf054 gomod: update interop dependency 2022-05-06 13:44:21 +03:00
Roman Khimov
3ae1647940
Merge pull request #2447 from nspcc-dev/gettransactionsigners
core: add GetTransactionSigners method to native Ledger
2022-04-29 11:58:38 +03:00
Anna Shaleva
69b70c5e93 gomod: update interop dependency 2022-04-29 11:23:43 +03:00
Anna Shaleva
9862b40f2c rpc: support InitialGasDistribution response from old Neo-Go nodes
https://github.com/nspcc-dev/neo-go/pull/2435 breaks compatibility
between newer RPC clients and older RPC servers with the following
error:
```
failed to get network magic: json: cannot unmarshal string into Go struct field Protocol.protocol.initialgasdistribution of type int64
```

This behaviour is expected, but we can't allow this radical change.
Thus, the following solution is implemented:
1. RPC server responds with proper non-stringified
   InitialGasDistribution value. The value represents an integral
   of fixed8 multiplied by the decimals.
2. RPC client is able to distinguish older and newer responses. For
   older one the stringified value without decimals part is
   expected. For newer responses the int64 value with decimal part
   is expected.

The cludge will be present in the code for a while until nodes of
version <=0.98.3 become completely absolete.
2022-04-27 19:00:46 +03:00
Anna Shaleva
3463d7292f gomod: update interop dependency 2022-04-21 19:27:30 +03:00
Anna Shaleva
47c3da4197 gomod: upgrade dBFT revision 2022-04-14 16:18:38 +03:00
Anna Shaleva
7b5ff25a40 gomod: update interop dependency 2022-04-05 10:49:10 +03:00
Anna Shaleva
5388c895d2 gomod: update interop version 2022-04-05 10:39:58 +03:00
Roman Khimov
3b639f518e *: update go.* for the previous change 2022-03-21 17:44:33 +03:00
Roman Khimov
25d72db8b0 *: update go.sum/go.mod wrt previous change 2022-03-21 14:39:05 +03:00
AnnaShaleva
7a8dc11791 examples: update dependencies version 2022-03-18 13:44:33 +03:00
Anna Shaleva
a137552b16 gomod: upgrade minimum required go version up to 1.16 2022-03-18 11:09:23 +03:00
Evgeniy Stratonikov
4960766019 go.mod: update pkg/interop dependency
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-03-15 17:15:40 +03:00
AnnaShaleva
abf719dcde gomod: update version of interop package 2022-03-01 19:08:22 +03:00
Anna Shaleva
563c3a4baa vm: replace ishell with urfave/cli
Use github.com/chzyer/readline for readline capabilities (including
history and ANSI escape sequences handling).
2022-02-18 16:34:50 +03:00
Roman Khimov
7945097543 native: fix ContractManagement's call flags for update/deploy
See neo-project/neo#2653.
2022-02-01 12:21:00 +03:00
Roman Khimov
75fbb914da
Merge pull request #2338 from nspcc-dev/fix-gomod
Examples go.mod fixes
2022-01-31 18:25:16 +03:00
Roman Khimov
64fb9218dd
Merge pull request #2339 from nspcc-dev/compare-states
scripts: add compare-states, related to #2337
2022-01-31 11:51:43 +03:00
Roman Khimov
d1a9aa1d0d scripts: add compare-states, related to #2337
Allows to quickly find the bad block and compare application
logs. Theoretically could also walk through the MPT to find the difference
there, but it's not needed now.
2022-01-26 10:11:19 +03:00
Evgeniy Stratonikov
e890c32dcc rpc/client: remove dependency on examples
Duplicate necessary structures in a dedicated micropackage.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-25 12:41:06 +03:00
Evgeniy Stratonikov
ac06da048c go.mod: add examples/nft-nd-nns dependency
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-21 10:25:20 +03:00
Evgeniy Stratonikov
492db89576 pkg/interop: update actual version
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:52:57 +03:00
Evgeniy Stratonikov
25583f9aeb compiler: make pkg/interop a separate module
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:21:26 +03:00
Evgeniy Stratonikov
9871dc8f5a compiler: update x/tools package
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:21:26 +03:00
Pavel Karpy
a33779c55e oracle/neofs: Upgrade NeoFS dependencies
Update includes:
1. New simple client mode that parses erroneous status codes as `error` and
returns them from the calls of the client methods.
2. `Client` is struct now, not an interface.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-01-13 16:34:47 +03:00
Roman Khimov
b16acfdfc0 go.mod: update go-ordered-json, fix #2319 2022-01-11 19:59:53 +03:00
Leonard Lyubich
0c4017cc20 oracle/neofs: Upgrade NeoFS dependencies
Replace `neofs-api-go` module with `neofs-sdk-go`. Adapt to NeoFS
response statuses in the implementation of NeoFS oracle.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-02 11:59:20 +03:00
Roman Khimov
748a70569a mempool: use uint256 library for fee tracking
It's very effective in avoiding allocations for big.Int, we don't have a
microbenchmark for memppol, but this improves TPS metrics by ~1-2%, so it's
noticeable.
2021-12-01 21:36:25 +03:00
Roman Khimov
328f8b7954
Merge pull request #2238 from nspcc-dev/fix-block-queue
network: remove priority queue from block queue
2021-11-01 12:03:45 +03:00
Roman Khimov
8bb1ecb45a network: remove priority queue from block queue
Use circular buffer which is a bit more appropriate. The problem is that
priority queue accepts and stores equal items which wastes memory even in
normal usage scenario, but it's especially dangerous if the node is stuck for
some reason. In this case it'll accept from peers and put into queue the same
blocks again and again leaking memory up to OOM condition.

Notice that queue length calculation might be wrong in case circular buffer
wraps, but it's not very likely to happen (usually blocks not coming from the
queue are added by consensus and it's not very fast in doing so).
2021-11-01 11:49:01 +03:00
Roman Khimov
1144a03486 storage: drop RedisDB, close #2130 2021-10-27 17:32:25 +03:00
Roman Khimov
fb4b87bb96 storage: drop BadgerDB support, close #2130 2021-10-27 17:31:55 +03:00
Anna Shaleva
dfc0b25cfe gomod: use nspcc-dev's fork of go-ordered-json
Escape non-ASCII characters while JSON encoding.
2021-09-15 15:01:01 +03:00
Roman Khimov
ad5acf4873 *: drop Go 1.14 2021-08-25 14:59:00 +03:00
Roman Khimov
ede410a4a7 go.mod: update ishell package
It only adds go.mod and changes import path, that's it.
2021-07-21 23:28:26 +03:00
Roman Khimov
b3880ab5d8 go.mod: update x/text package
New unicode and things, nothing really interesting for us.
2021-07-21 23:28:26 +03:00
Roman Khimov
f7b8fd522d go.mod: update x/term package
It supposedly fixes some Windows and Solaris problem, but this commit is
deliberately taken before the package switches to Go 1.17 (as we still need
older versions).
2021-07-21 23:28:26 +03:00
Roman Khimov
19495ae631 go.mod: update x/crypto package
We're only using RIPEMD160 and Scrypt from it, Scrypt was updated slightly.
2021-07-21 23:28:26 +03:00
Roman Khimov
4ddea2ce74 go.mod: update zap library
There was a number of fixes, let's have them as well.
2021-07-21 23:28:26 +03:00
Roman Khimov
fcbf30e5e9 go.mod: update Uber's atomic library
They've managed to fix some bug there. And added new types which we don't
currently need, but anyway.
2021-07-21 23:28:26 +03:00
Roman Khimov
ae651df312 go.mod: update bbolt
Some minor fixes/optimizations.
2021-07-21 23:28:26 +03:00
Roman Khimov
c4603443e0 go.mod: update cli library
Something was fixed there, OK.
2021-07-21 23:28:26 +03:00
Roman Khimov
4aff5e673e go.mod: update goleveldb
We were using some version from 2018 and there was a big number of fixes
and optimizations since then. It's not managed well though, current 1.0.0 tag
is 2019, so we're using latest and greatest here.
2021-07-21 23:28:26 +03:00
Roman Khimov
099e7cee02 go.mod: update Prometheus client and YAML package
Prometheus is somehow better (isn't noticeably probably), but it also
wants at least 2.3.0 YAML package, so update it to 2.4.0 which fixes some
important bug wrt v2 line (maybe we need to migrate to v3 though)/
2021-07-21 23:28:26 +03:00
Roman Khimov
c4df3ec5b9 go.mod: update lz4 library
Nothing special there.
2021-07-21 23:28:26 +03:00
Roman Khimov
f9d8573eda go.mod: update base58 library
Some trivial optimizations and document updates, nothing substantial.
2021-07-21 23:28:26 +03:00
Roman Khimov
08be9e5955 go.mod: update redis slightly
redis library itself is at v8 already, but I'm not sure we can reliably test
it quickly, so just apply some minor fixes.
2021-07-21 23:28:26 +03:00
Roman Khimov
350c5b3a59 go.mod: update btcd to 0.22.0-beta
We're using btcec for Koblitz curve implementation from it and there were some
important fixes.
2021-07-21 23:28:26 +03:00
Roman Khimov
002ad9dfee go.mod: update miniredis to 2.15.1
It's only used for testing purposes and this version doesn't change anything
for us, but still better be current.
2021-07-21 23:28:26 +03:00
Roman Khimov
4d1e952be6 go.mod: update go-datastructures to 1.0.53
We're only using queue library and it didn't change in any way, but 1.0.53 has
proper go.mod, so it's still an improvement.

It at the same time pulls some new packages also like x/tools.
2021-07-21 23:28:00 +03:00
Roman Khimov
4d2ecab16f consensus: fix nonce handling
It was broken somewhere between 2f490a3403 and
85ce207f40 leading to panic on watch only node:

2021-07-21T16:21:39.201+0200    INFO    received Commit {"validator": 3}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xbcc59e]

goroutine 486 [running]:
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).newBlockFromContext(0xc0001629a0, 0xc000308000, 0xc0010fa000, 0x2cb417800)
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:664 +0xbe
github.com/nspcc-dev/dbft.(*Context).MakeHeader(...)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/context.go:270
github.com/nspcc-dev/dbft.(*DBFT).onCommit(0xc000308000, 0x138c998, 0xc000115110)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:487 +0x575
github.com/nspcc-dev/dbft.(*DBFT).OnReceive(0xc000308000, 0x138c998, 0xc000115110)
        github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:251 +0xef5
github.com/nspcc-dev/neo-go/pkg/consensus.(*service).eventLoop(0xc0001629a0)
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:312 +0x7d6
created by github.com/nspcc-dev/neo-go/pkg/consensus.(*service).Start
        github.com/nspcc-dev/neo-go/pkg/consensus/consensus.go:262 +0xdc

In fact, nonce is correctly provided by dbft library (since Legacy), we just
need to use it here.
2021-07-21 19:06:19 +03:00
Evgeniy Stratonikov
8077f9232d interop: implement System.Runtime.GetRandom
Our murmur3 implementation is architecture independent and optimized in
assembly.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-07-15 16:00:01 +03:00
Pavel Karpy
32948180fb execute go mod tidy
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-10 16:15:33 +03:00
Pavel Karpy
c4f8c7a9b2 oracle/neofs: update neofs-api-go
Update neofs-api-go to `v1.27.1`.
Add `WithURIAddress` client option.
Stop using `V2` abstractions outside
of the `api-go` library.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-10 14:16:02 +03:00
Evgeniy Stratonikov
5fc81c787b jsonpath: use ordered map json unmarshaler 2021-05-13 11:53:49 +03:00
Evgeniy Stratonikov
1c30d8c395 oracle: make JSONPath compatible with C# implementation
C# node uses simplified implementation which is easy to port.
2021-05-13 11:53:28 +03:00
Evgenii Stratonikov
22b4edd58e oracle: support NeoFS 2021-03-09 14:24:57 +03:00
Anna Shaleva
cc112e1a89 *: add go 1.16 support 2021-03-02 14:04:35 +03:00
Anna Shaleva
0cec99a3ea gomod: update dbft version 2021-03-01 17:07:55 +03:00
Anna Shaleva
5bd809f9c8 *: drop go 1.13 support 2021-03-01 14:56:49 +03:00
Evgeniy Stratonikov
f6176b30f2 cli: support escape codes 2021-02-11 16:06:11 +03:00
Evgeniy Stratonikov
c420014cb5 oracle: implement filters 2021-01-28 13:00:59 +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
Evgenii Stratonikov
d6ec1290c5 go.mod: update dbft version
Close #1632.
2020-12-21 13:20:23 +03:00
Evgenii Stratonikov
75eb2b05d8 go.mod: update dbft version 2020-12-16 17:45:14 +03:00
Evgenii Stratonikov
80c3c374fd go.mod: update testify version 2020-12-10 17:01:39 +03:00
Evgenii Stratonikov
33f13ab1c0 vmcli: add tests 2020-12-02 10:49:37 +03:00
Evgenii Stratonikov
2b0d3d2e22 go.mod: update dbft 2020-11-09 17:34:57 +03:00
Roman Khimov
3a92151e9f update dbft to pick timer improvements 2020-09-25 23:00:50 +03:00
Roman Khimov
a6a1df4e0d consensus: update dbft, use new timer 2020-09-11 18:55:07 +03:00
Roman Khimov
9c5ef8d234 dbft: rev up, pick performance improvements 2020-09-09 20:46:31 +03:00
Roman Khimov
f5f58a7e91 keys: add simple LRU key cache for 1024 elements
The cost of Y calculation from X is comparable with signature check, so it
reduces witness check overhead by ~30% for cached keys and gives ~5% overall
boost in TPS.
2020-09-09 20:46:31 +03:00