Commit Graph

13230 Commits

Author SHA1 Message Date
Gregory Maxwell d6a48adb76 Eliminate data races for strMiscWarning and fLargeWork*Found.
This moves all access to these datastructures through accessor functions
and protects them with a lock.

Relative to the upstream commit, we also add GetMiscWarning() to make this accessible to tests.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-21 01:30:23 +00:00
Gregory Maxwell 05882459c0 Move GetWarnings and related globals to util.
This is a first step in avoiding racy accesses to strMiscWarning.

By itself this commit causes a link error because global variables relating to alerts
are only accessible in the zcashd server, but util is used in other binaries.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-21 01:28:13 +00:00
Wladimir J. van der Laan f08e31382b util: Don't set strMiscWarning on every exception
Fixes bitcoin/bitcoin#6809 - run-of-the-mill exceptions should not get into
strMiscWarning (which is reported by `getinfo`).
2020-02-21 01:06:00 +00:00
Homu 55354537b7 Auto merge of #4366 - str4d:z_viewtransaction-release-notes, r=str4d
Add release notes for z_viewtransaction
2020-02-20 23:52:09 +00:00
Homu e50639517f Auto merge of #4362 - str4d:3060-zcash-address-refactor, r=str4d
Refactor shielded address logic

This gets the more menial work out of the way in order to simplify the viewing key PR.

Part of #3060.
2020-02-20 22:28:39 +00:00
Homu d75fe844e3 Auto merge of #4356 - oxarbitrage:issue4286, r=str4d
remove debug noise from gtests

Closes #4286.
2020-02-20 13:28:14 +00:00
Jack Grigg 7de06244e6 test: Add test for CBasicKeyStore::AddSaplingFullViewingKey 2020-02-20 13:01:49 +00:00
Jack Grigg b62bb98087 Remove default address parameter from Sapling keystore methods
Now that we store SaplingExtendedFullViewingKey internally, we have
access to the default address everywhere we require it.
2020-02-20 13:01:49 +00:00
Jack Grigg d74fdd76eb SaplingFullViewingKey -> SaplingExtendedFullViewingKey in keystore maps
All of these maps are created from scratch on wallet load, so we can
alter their contents without compatibility concerns. With this change,
we can use the existing maps to implement viewing key support. The
downside is that the wallet will take more space in memory, but that can
easily be improved in future by storing ExtFVK fingerprints in some of
the maps (which would improve memory usage even compared to the original
layout).
2020-02-20 13:01:49 +00:00
Jack Grigg 9658c87d4a Move ZIP 32 classes inside zcash/Address.hpp
This fixes the dependency graph between the general address-handling
logic, ZIP 32, and the core Sapling address classes.
2020-02-20 12:26:58 +00:00
Jack Grigg 42b423c3a5 Move Sprout and Sapling address logic into separate files 2020-02-20 12:26:58 +00:00
Jack Grigg 4964328210 Deduplicate some wallet keystore logic 2020-02-20 12:26:58 +00:00
Homu 6a6114f954 Auto merge of #4355 - rex4539:fix-lf, r=str4d
End diff with LF character

Fixes https://github.com/zcash/zcash/issues/4354.
2020-02-20 12:21:22 +00:00
Jack Grigg 85548eca62 Add release notes for z_viewtransaction 2020-02-20 11:39:28 +00:00
Homu 27c04c8f9c Auto merge of #4146 - str4d:z_viewtransaction, r=str4d
z_viewtransaction

This RPC method returns all decryptable information for any transaction in the wallet.

Several values are conditionally included in the output for convenience:
- `recovered`: True if an output is not for a Sapling address in the wallet.
- `memoStr`: The text form of an output's memo, if it is valid UTF-8.
- Values are provided both in decimal currency units, and integer zatoshis.
2020-02-19 20:52:47 +00:00
Homu 3f270a2afa Auto merge of #4360 - oxarbitrage:issue3235, r=str4d
Add destination wrapper functions

Closes #3235.
2020-02-19 17:53:54 +00:00
Homu 0e57ffa710 Auto merge of #4353 - daira:blossom-tests, r=str4d
Add missing cases for Blossom in ContextualCheckBlock tests

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-19 12:12:32 +00:00
Alfredo Garcia d53d4d880a add destination wrappers 2020-02-18 13:20:43 -03:00
Jack Grigg 0f12f47f58 Patch libsodium 1.0.15 signature validation onto 1.0.18 2020-02-18 01:18:37 +00:00
Jack Grigg 4fe5969157 Patch libsodium 1.0.15 pubkey validation onto 1.0.18 2020-02-18 01:18:37 +00:00
ca333 d4644e7ed0 update libsodium to v1.0.18
according to changelogs backwards compatible and containing various optimizations:

https://github.com/jedisct1/libsodium/releases
https://fossies.org/diffs/libsodium/1.0.15_vs_1.0.16/ChangeLog-diff.html
https://fossies.org/diffs/libsodium/1.0.16_vs_1.0.17/ChangeLog-diff.html
https://fossies.org/diffs/libsodium/1.0.17_vs_1.0.18/ChangeLog-diff.html

(EDIT by str4d): The update is not in fact backwards-compatible; the
passing test cases added in the previous commit fail as of this commit.
2020-02-18 01:18:37 +00:00
Jack Grigg 7893f7b752 Add test vectors for small-order Ed25519 pubkeys
I'm not adding test vectors for non-canonical pubkeys, as that would
require grinding to find a private key corresponding to one of the 19
pubkeys that can be non-canonical.
2020-02-18 01:18:37 +00:00
Homu 5dde1a7702 Auto merge of #4328 - oxarbitrage:issue3344, r=str4d
Reduce duplication in key_io decode

Attempt to fix https://github.com/zcash/zcash/issues/3344 by adding a new `DecodeAny` template function with arguments that will handle all the cases. Then on each decoding this new function is called with the appropriate arguments resulting in reducing code duplication.

Some of the complexity(`boost::optional`) will be removed if `ViewingKey` is implemented for sapling.
2020-02-17 21:50:45 +00:00
Alfredo Garcia 0987bf349a add missing calls to DecodeAny 2020-02-17 14:54:08 -03:00
Alfredo Garcia df38c039f5 make type and size a pair in DecodeAny arguments 2020-02-17 14:27:56 -03:00
Alfredo Garcia 9ba20840e9 remove debug noise from 2 gtests 2020-02-17 13:57:49 -03:00
Alfredo Garcia a8f6b8c2e5 fix rpx_wallet_tests 2020-02-17 09:52:40 -03:00
Dimitris Apostolou daff771ca4
End diff with LF character 2020-02-16 21:14:42 +02:00
Daira Hopwood fd164f56f2 Add missing cases for Blossom in ContextualCheckBlock tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-16 18:38:56 +00:00
Homu a830563309 Auto merge of #4316 - str4d:worst-case-benchmarks, r=str4d
Worst-case block verification benchmarks

The micro-benchmark framework from #3858 is used to measure the time to verify various transaction components. These are leveraged by a script that simulates the verification cost of different compositions of full blocks.
2020-02-14 23:42:44 +00:00
Jack Grigg ec32287fe7 bench: "Use" result of crypto_sign_verify_detached
This fixes compilation with --enable-werror.
2020-02-14 16:48:32 +00:00
Jack Grigg ef5fb6a93c test: Fix pyflakes warnings 2020-02-13 20:04:33 +00:00
Jack Grigg 0d5d329312 test: Hard-code hex memo in wallet_listreceived for Python3 compatibility 2020-02-13 20:04:33 +00:00
Homu bfa54b28f4 Auto merge of #4348 - rex4539:typos, r=str4d
Fix typo
2020-02-13 15:44:38 +00:00
Dimitris Apostolou 3247e3c901
Fix typo 2020-02-13 17:14:19 +02:00
Homu c5d20b5da0 Auto merge of #4335 - rex4539:remove-libsnark-flags, r=str4d
Remove libsnark preprocessor flags

Closes https://github.com/zcash/zcash/issues/4285.
2020-02-11 23:47:52 +00:00
Homu 3011702f53 Auto merge of #4302 - oxarbitrage:issue3687, r=str4d
Add z_getnewaddress test

Supercedes #3749. Closes #3687.

It takes the commit from @dagurval where a new test case
`rpc_wallet_z_getnewaddress` is added and it adds a check for too many
arguments.

It uses `CheckRPCThrows()` to test the error message of invalid argument.
However, for too many arguments the full help message is displayed, so I
am just testing there is an runtime exception.
2020-02-11 22:43:44 +00:00
Homu 64f0291790 Auto merge of #4257 - oxarbitrage:issue4004, r=str4d
Delete SignatureHash from python script framework

Fixes https://github.com/zcash/zcash/issues/4004

Code is not used anywhere.
2020-02-11 21:39:31 +00:00
Homu db6fb09518 Auto merge of #4334 - rex4539:fix-boost, r=str4d
Fix Boost compilation on macOS

Fixes https://github.com/zcash/zcash/issues/4333
2020-02-11 14:50:48 +00:00
Dimitris Apostolou 439c3dd6d2
Remove libsnark preprocessor flags 2020-02-11 16:28:18 +02:00
Alfredo Garcia 70d5682e31
Merge branch 'master' into issue4004 2020-02-11 10:58:33 -03:00
Alfredo Garcia ebd9d0c562
remove unused imports 2020-02-11 10:56:45 -03:00
Homu e10576434d Auto merge of #4258 - oxarbitrage:issue3575, r=str4d
Changing gtest to CamelCase

This is #3583 with merge conflicts fixed.

Closes #3575.
2020-02-11 13:47:26 +00:00
Homu b5e38edfda Auto merge of #4236 - mdr0id:rpc_py2_to_py3, r=mdr0id
RPC Python2 to Python3 Update

Updates to allow RPCs to run in Python3.
2020-02-10 22:35:27 +00:00
mdr0id 1ce2e86612 Update #! env for python3 2020-02-10 13:34:29 -08:00
mdr0id 7300db81ed Updating remaining python3 conventions 2020-02-10 13:15:26 -08:00
mdr0id 4cb368a8d9 Update remaining Python3 conventions 2020-02-10 12:46:41 -08:00
mdr0id 826135d5ed Fix remaining python3 conventions 2020-02-10 12:38:46 -08:00
mdr0id fdac835b13 update comment regarding prior py2 exception 2020-02-09 12:38:01 -08:00
mdr0id 5ac9cb85f3 fix string pattern issue on byte object 2020-02-09 09:07:42 -08:00