Commit Graph

14033 Commits

Author SHA1 Message Date
Dimitris Apostolou 4e1d3856ee
Remove reference to cargo-checksum.sh 2020-09-25 07:15:04 +03:00
Homu 8f15f5fcce Auto merge of #4734 - str4d:2-sodium-2-oxide, r=str4d
Replace libsodium BLAKE2b usage with blake2b_simd crate

Extracted from zcash/zcash#4654.

Also fixes a bug in the `tracing::Span` C++ class.
2020-09-24 23:41:48 +00:00
Homu 9ef15a8415 Auto merge of #4746 - str4d:remove-rust-mingw-workaround, r=ebfull
build: Remove Rust staticlib naming workaround

The bug this was working around was fixed in Rust 1.44.0. We now pin
Rust 1.44.1, so we no longer need the workaround (and in fact, it is
necessary to make this change, as rustc no longer generates the old
filename, causing our Windows cross-compile to fail).
2020-09-24 19:37:22 +00:00
Homu 256d6e33eb Auto merge of #4743 - str4d:cargo-vendor-cleanups, r=str4d
depends: Remove cargo-checksum.sh

Now that we are using `cargo vendor`, the checksum files are computed
automatically.
2020-09-24 16:07:18 +00:00
Jack Grigg 7169cfc0d8 build: Remove Rust staticlib naming workaround
The bug this was working around was fixed in Rust 1.44.0. We now pin
Rust 1.44.1, so we no longer need the workaround (and in fact, it is
necessary to make this change, as rustc no longer generates the old
filename).
2020-09-24 16:27:42 +01:00
Jack Grigg 0f3baaba71 tracing: Correctly override tracing::Span move constructors 2020-09-24 15:58:19 +01:00
Jack Grigg 02b7d2afa2 blake2b: Allow consuming partial BLAKE2b output
Some consumers were relying on the libsodium behaviour that the output
length was not checked against the configured hash output length.
blake2b_simd::Hash::as_bytes returns a correctly-sized slice, which we
were then failing to copy into the consumer's buffer. Instead of
requiring the consumer to provide a full-length buffer and then truncate
the output themselves (likely causing a double-copy, as we don't have
nice slices in C++), we instead allow the consumer to consume up to the
maximum output.
2020-09-24 15:58:19 +01:00
Jack Grigg 2d172e121f Replace libsodium's crypto_generichash_blake2b with blake2b_simd 2020-09-24 15:58:14 +01:00
Homu 31f48caf0e Auto merge of #4690 - LarryRuane:CopyPreviousWitnessesPart2, r=str4d
Flush witness data when consistent (part 2)

Closes #4680. After CWallet::ChainTipAdded() updates the witness data, it may flush it to disk (SetBestChain()); make sure the locator part is consistent with the witnesses (height).
2020-09-24 13:31:31 +00:00
Homu ad56e9c2e9 Auto merge of #4693 - daira:explicit-coercions, r=str4d
Make some conversions explicit to reduce sanitizer warnings

The warnings eliminated by this PR are of the forms, for example:
```
src/chain.h:591:16: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
src/scalar_4x64_impl.h:130:110: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 533633915002 (64-bit, unsigned) to type 'unsigned char' changed the value to 122 (8-bit, unsigned)
src/zcash/util.cpp:9:25: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 1000000000 (64-bit, unsigned) to type 'std::vector<unsigned char, std::allocator<unsigned char> >::value_type' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)
```

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-09-24 12:16:11 +00:00
Jack Grigg a554f7ccc6 depends: Remove cargo-checksum.sh
Now that we are using `cargo vendor`, the checksum files are computed
automatically.
2020-09-23 11:30:35 +01:00
Homu 49fc20aced Auto merge of #4720 - ebfull:fix-perf-regressions, r=str4d
Address some performance regressions

@str4d identified and fixed some performance regressions in our elliptic curve and proving crates, and we also changed to complete formulas in `bls12_381` to get some better performance in some cases. The result:

```
v3.1.0
"runningtime": 0.59883

before upgrading rust:
"runningtime": 0.823932

after upgrading rust:
"runningtime": 0.83004

after upgrading rust packages:
"runningtime": 0.763065
```

which gets us some of the way back to where we were.
2020-09-23 01:36:00 +00:00
Sean Bowe 52777e6d74
Update to latest zcash_* and zkcrypto crates. 2020-09-22 15:15:25 -06:00
Sean Bowe 16e91b0534
cargo update 2020-09-22 15:07:27 -06:00
Sean Bowe 03ce24013a
Update Rust to 1.44.1. 2020-09-22 15:06:01 -06:00
Homu c9672a49c2 Auto merge of #4696 - str4d:3640-z_sendmany-any-taddr, r=str4d
wallet: Add ANY_TADDR special string to z_sendmany

When using this special string as the from address, non-coinbase UTXOs
from any transparent addresses within the wallet will be used to fund the
transaction. Change outputs will be sent to a new transparent address,
as with any other spend of transparent funds.

Closes zcash/zcash#3640.
2020-09-22 18:09:58 +00:00
Jack Grigg 3311a85dbe rpc: Fix comma spacing in example z_sendmany commands 2020-09-22 17:45:09 +01:00
Jack Grigg e33f530a65 wallet: Ignore coinbase UTXOs with z_sendmany ANY_TADDR
Coinbase UTXOs from multiple transparent addresses may be shielded
together using z_shieldcoinbase.
2020-09-22 17:45:09 +01:00
Homu 8dcab5ee3b Auto merge of #4737 - nathan-at-least:link-to-read-the-docs-build-instructions, r=daira
Link README.md to readthedocs.io page for building on Debian/Ubuntu.
2020-09-22 07:14:13 +00:00
Daira Hopwood fbca35e9df
Line-wrap addition to README.md 2020-09-22 08:12:30 +01:00
Nate Wilcox 933e841a7a Link the README.md to the specific readthedocs.io page for building on Debian/Ubuntu. 2020-09-22 01:22:58 +00:00
Homu 35bb61be39 Auto merge of #4725 - str4d:cargo-vendor, r=str4d
depends: Switch to `cargo vendor` for Rust dependencies

When we first integrated Rust into our build system, we had two
limitations:

- We were building the `librustzcash` FFI library as a dependency, and
  therefore needed access to its crate dependencies in the depends
  system.
- Gitian builds happen offline, so we needed to fetch any crate
  dependencies ahead of time, and then configure cargo to use these in
  an offline environment.

At the time, `cargo` already had support for "Source Replacement", but
there was no easy way to package the dependencies in the necessary way.
What we implemented was effectively the `cargo-vendor` tool, built using
Makefiles. A noticeable downside was that we were pinning dependencies
twice: once in the `Cargo.lock` for the FFI library, and again in our
depends system.

Since then, `cargo-vendor` has been upstreamed into `cargo` itself, and
we have moved `librustzcash` into this repository. We can therefore use
`cargo vendor` directly from our pinned Rust compiler to fetch the
dependencies, and rely on our local `Cargo.lock` to pin the specific
crates we are relying on.
2020-09-19 12:37:51 +00:00
Jack Grigg 2449349882 depends: Ensure that SOURCES_PATH exists before vendoring crates
During Gitian builds, SOURCES_PATH is set to a path within the Gitian
cache. Normally this path is created as part of creating a particular
dependency's source directory, but in some situations we may vendor Rust
crates before this folder exists.
2020-09-19 13:35:36 +01:00
Jack Grigg c36ad21e74 QA: Comment out Rust crate checks in updatecheck.py
https://github.com/zcash/zcash/issues/4726 has been opened to track
fixing this.
2020-09-19 13:35:36 +01:00
Jack Grigg 549bf2dfa8 depends: Switch to `cargo vendor` for Rust dependencies
When we first integrated Rust into our build system, we had two
limitations:

- We were building the `librustzcash` FFI library as a dependency, and
  therefore needed access to its crate dependencies in the depends
  system.
- Gitian builds happen offline, so we needed to fetch any crate
  dependencies ahead of time, and then configure cargo to use these in
  an offline environment.

At the time, `cargo` already had support for "Source Replacement", but
there was no easy way to package the dependencies in the necessary way.
What we implemented was effectively the `cargo-vendor` tool, built using
Makefiles. A noticeable downside was that we were pinning dependencies
twice: once in the `Cargo.lock` for the FFI library, and again in our
depends system.

Since then, `cargo-vendor` has been upstreamed into `cargo` itself, and
we have moved `librustzcash` into this repository. We can therefore use
`cargo vendor` directly from our pinned Rust compiler to fetch the
dependencies, and rely on our local `Cargo.lock` to pin the specific
crates we are relying on.
2020-09-18 22:55:57 +01:00
Homu b8650d6f41 Auto merge of #4732 - zcash:3786_review_dependencies, r=str4d
Postponed dependency updates, refer to core team sync meeting.
2020-09-18 11:13:49 +00:00
zebambam 0314ad1a53 Postponed dependency updates, refer to core team sync meeting. 2020-09-16 09:48:55 -07:00
Homu 6f9b281ef7 Auto merge of #4706 - str4d:4705-nuparams-config-file, r=daira
Allow multiple nuparams options in config file

We didn't add this in zcash/zcash#4583 because `-nuparams` is only ever
used as a CLI argument in our testing infrastructure. It turns out that
there are external developers using regtest mode with `nuparams` in
their config files instead. Neat!

Closes zcash/zcash#4705.
2020-09-06 12:49:47 +00:00
Larry Ruane 81db0a2fc7 Flush witness data when consistent (part 2)
After CWallet::ChainTipAdded() updates the witness data, it
may flush it to disk (SetBestChain()); make sure the locator
part is consistent with the witnesses (height).
2020-09-05 07:21:11 -06:00
Jack Grigg 566e0d38b4 Allow multiple nuparams options in config file
We didn't add this in zcash/zcash#4583 because `-nuparams` is only ever
used as a CLI argument in our testing infrastructure. It turns out that
there are external developers using regtest mode with `nuparams` in
their config files instead. Neat!

Closes zcash/zcash#4705.
2020-09-04 19:00:38 +01:00
Homu f8e1a02bbe Auto merge of #4561 - oxarbitrage:issue1873, r=daira
Allow full and relative path wallet database location

Closes https://github.com/zcash/zcash/issues/1873
2020-09-04 14:49:50 +00:00
Daira Hopwood fbe68913bd Ensure that the absolute path used in the test definitely does not exist.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-09-04 14:52:11 +01:00
Daira Hopwood 21fee305a2 Fix grammar in error messages.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-09-04 14:52:05 +01:00
Alfredo Garcia dc9c95b705 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-04 14:50:17 +01:00
Alfredo Garcia 6a7cfdea54 allow wallet file to be outside datadir 2020-09-04 14:50:17 +01:00
Homu 7e958be2cb Auto merge of #4300 - oxarbitrage:issue3939, r=nuttycom
add shielded balance to getwalletinfo

Closes zcash/zcash#3939

It is based on the definition that unconfirmed balance has 0 confirmations; anything else is regular balance.

Implementation:

1. `getBalanceZaddr` uses one version of `GetFilteredNotes`, we want to use the other version that allow us to get balances inside min and max confirmations.
2. `shielded_unconfirmed_balance`, and `shielded_balance` are obtained by calling `getBalanceZaddr` with different min and max confirmations according to the definitions from above.
2020-09-04 13:29:58 +00:00
Kris Nuttycombe 9d8555cf1b Fix forward declaration. 2020-09-04 07:29:24 -06:00
Homu 443954580d Auto merge of #4687 - defuse:fix-cscript-test-buffer-overflows, r=daira
Fix buffer overflows in P2PKH tests
2020-09-03 22:16:23 +00:00
Homu af6ca1406c Auto merge of #4357 - oxarbitrage:issue2880, r=daira
Add null check to feof

Closes https://github.com/zcash/zcash/issues/2880
2020-09-03 18:51:37 +00:00
Homu cf8cd09ae1 Auto merge of #4349 - oxarbitrage:issue3996, r=daira
Prevent creation of shielded transactions when chain is not synced up

Part of zcash/zcash#3996.

Inspired by jl777/komodo#1486 and jl777/komodo#1493, but takes a different approach:

- Uses a function `ThrowIfInitialBlockDownload()` that checks `IsInitialBlockDownload()`, instead of macros.
- Added `initial_block_download_complete` output only to `getblockchaininfo`.
2020-09-03 16:21:51 +00:00
Homu 3caa784970 Auto merge of #2778 - syd0:add-python-assert, r=daira
Add assert_raises_message to the python test framework.
2020-09-03 14:26:54 +00:00
Daira Hopwood bd4469339a
Rename z_*_balance fields of getwalletinfo output to shielded_*_balance 2020-09-03 14:43:10 +01:00
Kris Nuttycombe 4c4a1c4d68 Revert the move of the `getBalanceZaddr` block for ease of review. 2020-09-03 07:34:01 -06:00
Kris Nuttycombe 48149defab Prevent creation of shielded transactions in initial block download.
Author: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: Jack Grigg <jack@z.cash>
Co-authored-by: Duke Leto <duke@leto.net>
2020-09-03 07:13:50 -06:00
Homu ef62a1c5e4 Auto merge of #4688 - defuse:fix-rpc-test-string-interpolation, r=daira
Add a missing % to a string interpolation in rpc test framework
2020-09-03 13:06:45 +00:00
Homu 5e7e9687fc Auto merge of #4702 - ebfull:release-v4.0.0, r=ebfull
Release v4.0.0

This release activates [Canopy](https://z.cash/upgrade/canopy/) on the 4 year anniversary of the launch of the Zcash network!
2020-09-01 20:58:51 +00:00
Sean Bowe 02c5f089cf
minor: Add backticks to avoid formatting in 4.0.0 release notes. 2020-09-01 14:58:04 -06:00
Sean Bowe 505495a73d
make-release.py: Updated release notes and changelog for 4.0.0. 2020-09-01 13:31:19 -06:00
Sean Bowe eedd28599b
make-release.py: Updated manpages for 4.0.0. 2020-09-01 13:31:19 -06:00
Sean Bowe 01d1ea5f0f
make-release.py: Versioning changes for 4.0.0. 2020-09-01 13:28:51 -06:00