Commit graph

7461 commits

Author SHA1 Message Date
Roman Khimov
56d32a010e
Merge pull request #3256 from fyfyrchik/fix-signer
Allow complex contract signature schemes in `wallet.Account`
2023-12-21 22:50:57 +03:00
Roman Khimov
a872c200b0
Merge pull request #3279 from nspcc-dev/fix-next-vals-panic
native: prevent improper Neo cache invalidation
2023-12-21 22:17:43 +03:00
Anna Shaleva
47aefad7ea consensus: remove unnecessary call to ComputeNextBlockValidators
dBFT doesn't use validators got from this call to GetValidators callback,
because NeoGo doesn't properly set WithGetConsensusAddress, and thus
this call can be safely skipped. Instead, NeoGo fills NextConsensus field
by itself in NewBlockFromContext callback.

This commit technically doesn't perform any functional changes and doesn't
affect the problem described in #3253 in any way. This commit is just a
removal of the code that was never used by NeoGo library.

This commit is a direct consequence of https://github.com/nspcc-dev/dbft/issues/84.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-21 18:16:34 +03:00
Anna Shaleva
d7d850ac7d native: never set Neo's newEpoch* cache values to nil
We have cache update mechanism (Neo's cache votesChanged flag), it must
be used for current epoch and new epoch cached values update. And the
cached current/new epoch values themselves must always contain valid
information for the current/new epoch. These cached values must only be
changed once per epoch, never set them to nil.

This commit prevents CN node panic described in #3253 when dBFT tries
to retrieve new epoch validators with some votes modifications made
before at the same dBFT epoch.

Close #3253.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-21 17:56:07 +03:00
Roman Khimov
b62541b6a3 docs: minimally outline local labels
Fixes #2707.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
2023-12-21 13:25:34 +03:00
Evgenii Stratonikov
c8ff44560e neotest: reuse wallet.Account for contract signers
Refs #3245
Refs #3233

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
2023-12-21 11:27:41 +03:00
Evgenii Stratonikov
962b161652 wallet: allow complex contract verification schemes, close #3015
This was recently added in neotest, but working with the real RPC is
still not enjoyable. This commit extends `wallet.Account` with
invocation script builder to aid network fee calculations and signing.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
2023-12-21 11:26:55 +03:00
Roman Khimov
de98b39a95
Merge pull request #3269 from nspcc-dev/dependabot/go_modules/golang.org/x/crypto-0.17.0
build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0
2023-12-19 09:03:39 +03:00
Roman Khimov
2df0ba7c10
Merge pull request #3270 from nspcc-dev/dependabot/go_modules/examples/zkp/cubic_circuit/golang.org/x/crypto-0.17.0
build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /examples/zkp/cubic_circuit
2023-12-19 09:03:20 +03:00
Roman Khimov
bcee8c268c
Merge pull request #3271 from nspcc-dev/dependabot/go_modules/examples/nft-nd-nns/golang.org/x/crypto-0.17.0
build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /examples/nft-nd-nns
2023-12-19 09:03:00 +03:00
dependabot[bot]
0baa35ed77
build(deps): bump golang.org/x/crypto in /examples/nft-nd-nns
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 23:42:52 +00:00
dependabot[bot]
ad122aec41
build(deps): bump golang.org/x/crypto in /examples/zkp/cubic_circuit
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 23:40:58 +00:00
dependabot[bot]
ead5b3dc09
build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 23:34:02 +00:00
Roman Khimov
3766206f44
Merge pull request #3255 from smallhive/3177-wallet-from-bytes
wallet: Add new wallet constructors
2023-12-14 18:45:44 +03:00
Evgeny Baydakov
2012c56031
wallet: Add new wallet constructors
Closes #3177

Signed-off-by: Evgeny Baydakov <e.bajdakov@gmail.com>
2023-12-12 08:33:30 +04:00
Roman Khimov
a5a87a72c2
Merge pull request #3261 from nspcc-dev/fix-client-init-test
rpcclient: fix failing initialisation-based tests
2023-12-11 13:11:10 +03:00
Anna Shaleva
d5dee8fc94 rpcclient: fix failing initialisation-based tests
Must be a part of #3257.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-11 12:41:56 +03:00
Anna Shaleva
6f3a219d67
Merge pull request #3235 from nspcc-dev/actor_refactor
cli: move actor handling
2023-12-11 12:19:33 +05:00
Anna Shaleva
bbbb12af20
Merge pull request #3236 from nspcc-dev/filter_NotaryRequestEvents
rpc: add an ability to filter out NotaryRequestEvents
2023-12-11 12:19:10 +05:00
Ekaterina Pavlova
3fd48a743e rpc: add an ability to filter out NotaryRequestEvents
Add new filter NotaryRequestFilter, support for filtering
NotaryRequestEvents by mempoolevent.Type
(added or removed).

Closes #2425.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-09 11:37:25 +03:00
Roman Khimov
afca64f164
Merge pull request #3257 from nspcc-dev/check-init
rpcclient: check network initialisation for blocks subscriptions
2023-12-08 22:40:08 +03:00
Anna Shaleva
21ccb1a02a rpcclient: check network initialisation for blocks subscriptions
StateRootInHeader depends on it, so we better immediately return error
if client is not initialised.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-08 21:57:40 +03:00
Ekaterina Pavlova
44e21c9a8e cli: optimize CosignersSeparator check in loops
No functional changes.
We have 2 exactly the same cycles,and in the 1st cycle we set
cosignersOffset to the right value. So we don't need to check for arg ==
 cmdargs.CosignersSeparator one more time.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-07 10:37:01 +03:00
Ekaterina Pavlova
8bdbac3c5e cli: move actor-related functions handling to options package
Move actor handling into CLI package.
GetRPCWithActor returns RPC with actor instances.

Close #2682.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-07 10:35:37 +03:00
Ekaterina Pavlova
d7cab3b82c cli: move wallet-related flags handling to options package
Move GetAccFromContext, GetUnlockedAccount, ReadWalletConfig handling
into options package to reuse this code from all CLI handlers.
getDecryptedAccount is replaced by GetUnlockedAccount.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-06 10:49:50 +03:00
Ekaterina Pavlova
f93e2fbba4 cli: use (*transaction.Transaction).HasSigner where possible
No functional changes.
tx.HasSigner usage to avoid code duplication.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-06 10:49:50 +03:00
Anna Shaleva
441eb8aa86
Merge pull request #3250 from nspcc-dev/bbolt
go.mod: upgrade BoltDB to 1.3.8
2023-12-06 11:18:02 +05:00
Anna Shaleva
af0d1fe3c9
Merge pull request #3251 from nspcc-dev/mac
github: enable amd64 builds for osx
2023-12-06 11:16:44 +05:00
Ekaterina Pavlova
cab358dba1 github: enable amd64 builds for osx
Enable AMD64 builds for Intel based OSX.

Closes #3238.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-05 21:49:10 +03:00
Roman Khimov
0639cedd05 go.mod: upgrade BoltDB to 1.3.8
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2023-12-05 21:01:44 +03:00
Roman Khimov
9a270ae30c
Merge pull request #3233 from stepanovdmitrii/feat/neotest_contract_signer_support
neotest: Add contract signer support
2023-12-04 10:03:49 +03:00
Dmitrii Stepanov
7b53a0c239 neotest: Add contract signer support
Signed-off-by: Dmitrii Stepanov <dima-stepan@yandex.ru>
2023-12-01 10:50:08 +03:00
Roman Khimov
6c0c2a6a98
Merge pull request #3246 from nspcc-dev/fix-doc
neotest: adjust Signer documentation
2023-12-01 10:23:46 +03:00
Roman Khimov
26f96fe7ee
Merge pull request #3243 from nspcc-dev/add-management-test
native: test immediate contract availability
2023-12-01 10:21:09 +03:00
Anna Shaleva
daa2b3b920 neotest: adjust Signer documentation
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-01 09:25:41 +03:00
Roman Khimov
b31d39836a native: test immediate contract availability
I had some reason to suspect something is wrong here (but it's all OK). Even
though this is kinda tested in TestDeployGetUpdateDestroyContract, it uses
internal APIs and with neotest we can ensure it work OK for a complete tx/block
environment. So, won't hurt having these tests as well.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
2023-11-30 15:58:00 +03:00
Roman Khimov
34be76efb7
Merge pull request #3240 from nspcc-dev/fix-native-upd
core: remove UpdateHistory from NativeContract structure
2023-11-29 16:18:34 +03:00
Roman Khimov
90e18ec743
Merge pull request #3242 from nspcc-dev/improve-subs-doc
Improve notification subsystem documentation
2023-11-29 14:35:38 +03:00
Anna Shaleva
e3aa6bba4d docs: add ordering guarantees for notary request events
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-29 14:00:44 +03:00
Anna Shaleva
81a439a0d6 docs: fix typo
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-29 13:55:54 +03:00
Anna Shaleva
6fdda0f15d rpcclient: add doc link to notifications ordering guarantees
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-29 13:53:45 +03:00
Anna Shaleva
8e8936912d core: remove UpdateHistory from NativeContract structure
Although it doesn't raise an exception on our side, we still have this
unrelevant information in the resulting RPC call response structure.
This should be a part of https://github.com/nspcc-dev/neo-go/pull/3212.

Port https://github.com/neo-project/neo-modules/pull/851.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-29 09:25:04 +03:00
Roman Khimov
76261f1605
Merge pull request #3239 from nspcc-dev/ntr-doc-upd
rpcclient: improve documentation
2023-11-28 20:25:08 +03:00
Anna Shaleva
42b84ad905 rpcclient: improve documentation
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-28 20:23:33 +03:00
Roman Khimov
98de5b9ccb
Merge pull request #3237 from nspcc-dev/emit-smth
vm: allow to emit `any` based on its type
2023-11-28 18:01:06 +03:00
Anna Shaleva
b637048122 vm: allow to emit any based on its type
No functional changes, just moved a part of emit.Array to a separate
exported method. It may be useful for contract-based witness invocation
scripts construction and not only. Ref.
https://github.com/nspcc-dev/neo-go/pull/3233#discussion_r1407786333.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-28 17:17:34 +03:00
Roman Khimov
e8e964e3da
Merge pull request #3234 from nspcc-dev/add-response-source
examples: improve cubic circuit documentation
2023-11-28 17:07:12 +03:00
Anna Shaleva
d7b84c0b47 examples: improve ZKP production example
Add more detailed errors and comments.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-28 17:00:34 +03:00
Anna Shaleva
29f344fd9b examples: add one more source of suitable response* files for Groth16
Turns out that Zcash swiched to BLS12-381 since https://github.com/zcash/zcash/issues/2502,
thanks to @EdgeDLT for pointing that out. I've checked that our
TestCubicCircuit_EndToEnd_Prod test passes with response file downloaded
from the attestations page of Zcash ceremony, thus I propose to put theirs
attestations link before the link to PPoT, because PPoT attestations contain
outdated links and not all responses can be downloaded.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-28 17:00:33 +03:00
Roman Khimov
2f9b4a2dbf
Merge pull request #3232 from nspcc-dev/storage-limits
interop: add contract storage limits
2023-11-28 13:19:55 +03:00