Commit Graph

13203 Commits

Author SHA1 Message Date
Jack Grigg 684e62e903 Fix Rust static library linking for Windows builds
The library renaming step is necessary because the naming convention
used by rustc does not match the naming convention for libtool/MinGW.
2020-03-12 00:50:45 +13:00
Jack Grigg a04acde970 depends: Remove unused vendored crates 2020-03-06 16:49:03 +13:00
Jack Grigg 5fe41654bf Move root of Rust crate into repo root
This enables IDE integration to work (which requires the Cargo.toml to
be in the repo root).

"make clean" no longer runs "cargo clean", because IDE integrations hold
locks on files within the Rust build directory, and an error inside
"cargo clean" error would prevent "make clean" from completing (and
removing other files).
2020-03-06 16:49:03 +13:00
Jack Grigg 90f7234136 Replace librustzcash from depends system with src/rust
The --enable-online-rust configure flag replicates the behaviour of the
LIBRUSTZCASH_OVERRIDE environment variable (enabling the build system to
use crates.io instead of vendored dependencies).
2020-03-06 16:49:03 +13:00
Jack Grigg 72ab00fdee Update .gitignore for Rust code 2020-03-06 16:24:14 +13:00
Jack Grigg 62d0af94cf rust: Adjust Cargo.toml so that it compiles
The Cargo.lock is updated to account for the Zcash Rust crates no longer
being in the same workspace. Dependencies that were not transitive
dependencies of librustzcash are also removed, but no versions change.
2020-03-06 16:24:14 +13:00
Jack Grigg 28b2a65c64 rust: Pin toolchain to 1.36.0, matching depends system 2020-03-06 16:24:14 +13:00
Jack Grigg ef81abdde3 Bring in Cargo.lock from librustzcash repo
Source: https://github.com/zcash/librustzcash.git
Revision: a57dc7f47807ea50cb0a5deec9b84b3e7da11bc0
2020-03-06 16:24:14 +13:00
Jack Grigg 443fe7d092 Bring in librustzcash crate
Source: https://github.com/zcash/librustzcash.git
Revision: a57dc7f47807ea50cb0a5deec9b84b3e7da11bc0
2020-03-06 16:24:14 +13:00
Homu 6c00a8ccf9 Auto merge of #4280 - oxarbitrage:issue2197, r=daira
Allow negative heights in RPC calls

For issue https://github.com/zcash/zcash/issues/2197

Currently adding the feature to `getblock` and `getblockhash`. There is another candidate: `getblocksubsidy` however i want to have some review about these 2 first before repeating what could be a bad approach.
2020-03-05 16:36:32 +00:00
Homu 26a24da745 Auto merge of #4265 - LarryRuane:CBufferedFile-fixes, r=str4d
util: CBufferedFile fixes

Cherry-pick https://github.com/bitcoin/bitcoin/pull/16577
2020-03-03 01:13:38 +00:00
Larry Ruane 75251cb2bc util: CBufferedFile fixes 2020-03-02 18:03:46 -07:00
Homu 086c2b4d9f Auto merge of #4379 - ebfull:fix-wallet-assertion, r=ebfull
Initialize ThreadNotifyWallets before additional blocks are imported

The intention of this PR is to address #4301. It seems `ThreadNotifyWallets` assumes that `chainActive.Tip()` on initialization reflects the wallet's view of the active tip, but prior to `ThreadNotifyWallets`'s initialization the active chain ends up being modified by blocks that are imported from disk, so our local `pindexLastTip` ends up out of sync with the wallet's actual "last" tip.

This PR moves the initialization of `ThreadNotifyWallets` to earlier in the process while passing in the current active tip. This addresses the problem for non-fresh nodes, and then for fresh nodes we have the notification thread wait until the genesis block has been loaded.
2020-02-28 17:39:45 +00:00
Sean Bowe e597ad842a
Clarify comment 2020-02-27 17:57:59 -07:00
Homu 95e446bf69 Auto merge of #4380 - oxarbitrage:issue3446, r=ebfull
Change cm to cmu in sapling

Part of https://github.com/zcash/zcash/issues/3446

For each of the 2 commits, suggested change was made, then fixed build errors until compile. Finally ran bitcoin and gtests, both of them passing.
2020-02-27 20:46:05 +00:00
Homu 6ff6c9eeef Auto merge of #4378 - defuse:clean-afl-temp, r=ebfull
Have make clean delete fuzzing-related directories
2020-02-26 21:47:59 +00:00
Sean Bowe b79edf1b55
Handle case of fresh wallets in ThreadNotifyWallets. 2020-02-26 14:47:22 -07:00
Alfredo Garcia 8ebe538eaa change maybe_cm to maybe_cmu 2020-02-26 18:33:49 -03:00
Alfredo Garcia 445ae593d6 change the cm member of OutputDescription to cmu 2020-02-26 17:43:50 -03:00
Alfredo Garcia 4d4cb44440 change cm() to cmu() in SaplingNote class 2020-02-26 16:49:34 -03:00
Sean Bowe faca79eb2f
Initialize ThreadNotifyWallets before additional blocks are imported.
Co-authored-by: Daira Hopwood <daira@electriccoin.co>
2020-02-26 11:20:12 -07:00
Taylor Hornby 171ce8336b Have make clean delete AFL output directories. 2020-02-26 09:31:28 -07:00
Taylor Hornby 967b9a40f3 Add AFL build directory to .gitignore 2020-02-26 09:29:05 -07:00
Taylor Hornby eb6c722e78 Have make clean delete temporary AFL build directory 2020-02-26 09:27:44 -07:00
Homu 77c2e1c251 Auto merge of #3481 - LarryRuane:fetch-params-testnet-arg, r=mdr0id
zcutil/fetch-params.sh unneeded --testnet arg should warn user

If fetch-params.sh user doesn't know that testnet and mainnet params are the same, and user specifies --testnet, it's confusing that the argument is ignored.
2020-02-25 20:40:49 +00:00
Homu 69e0e7ee62 Auto merge of #4369 - daira:port-strMiscraceless, r=str4d
Upstream PRs relating to strMiscWarning

This pulls in upstream PRs bitcoin/bitcoin#7114 and bitcoin/bitcoin#9236 (non-QT parts).

* Fixes bitcoin/bitcoin#6809 - run-of-the-mill exceptions should not get into `strMiscWarning` (which is reported by `getinfo`).
* Eliminate data races for `strMiscWarning` and `fLargeWork*Found`. This moves all access to these data structures through accessor functions and protects them with a lock.
2020-02-21 19:06:29 +00:00
Gregory Maxwell 9f4ad7e1c6 Move GetWarnings() into its own file.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-21 01:31:16 +00:00
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
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