These reject messages end up bubbling up to users via the RPC interface.
Distinguishing between the various failure cases will help users figure
out why their transaction is being rejected.
Uses operator* instead of std::optional::value because the latter was
introduced in macOS 10.14, and our current minimum is 10.12.
Closeszcash/zcash#3114.
depends download: fix a logging bug for multi-archive packages:
No documentation change needed.
The test plan appears below. Since this bug output should appear on all builds without a pre-existing source cache, then an easier test plan might be to verify the bug output is not present from an infrastructure build log that doesn't rely on cached sources.
# Bug Behavior
While initially fetching packages, I saw `sh: test:` error messages in the make output for only two packages. However, it appears all packages are correctly fetched.
See detailed output appendix for demonstration of the bug output and conditions compared to with this patch for the same conditions.
# Analysis
## Design Requirements
The intent of the `check_or_remove_sources` is to fetch sources if either existing archive hashes do not match or the archives aren't present.
Additionally, this should report hash mismatches and be quiet about missing files.
## Bug Source
The second design requirement goal has a bug for multi-archive packages which define `$(package)_extra_sources)` because `test -f $($(package)_all_sources)` passes more than one argument to `test -f` which is not supported. If sha256sum fails in any case for multi-archive packages, a `sh: test` error line is always printed.
Aside from this spurious output, this bug has no effect, I believe. Fortunately this bug does not bypass the hash check!
## Testing
I tested this patch manually by running the same three tests against the `v4.0.0` tag and then again repeating those same three steps with this patch. In all 6 cases I visually inspected the output.
1. Starting with a pre-downloaded source cash, run the `download` target.
2. Remove an archive from a multi-archive package, then rerun `download`.
3. Alter a hash to cause a hash mismatch condition, then rerun `download`.
I believe after each step both with and without this patch the resulting source cache should be identical (except for filesystem timestamps).
### Testing v4.0.0 without this patch
Notice in the second and third steps the same bug output:
```
/bin/sh: 1: test: rust-std-1.42.0-x86_64-apple-darwin.tar.gz: unexpected operator
```
While initially fetching packages, I saw `sh: test:` error messages in the make output for only two packages.
However, it appears all packages are correctly fetched.
I tested this patch manually by running these three tests against the `v4.0.0` tag and then with this patch.
In all 6 cases I visually inspected the output.
1. Starting with a pre-downloaded source cash, run the `download` target.
2. Remove an archive from a multi-archive package, then rerun `download`.
3. Alter a hash to cause a hash mismatch condition, then rerun `download`.
I believe after each step both with and without this patch the resulting source cache should be identical
(except for filesystem timestamps).
Co-authored-by: Nathan Wilcox <nathan@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Update secp256k1
This migrates us to the same dependency version that upstream Bitcoin
Core migrated to in bitcoin/bitcoin#19944.
Also enables the endomorphism optimization now that the patents have
expired.
std::random_shuffle is removed in C++17; it is replaced by std::shuffle,
which was introduced in C++11. The new ZcashRandomEngine class provides
the Uniform Random Number Generator interface, as inferred from
std::random_device.
allow getaddressutxos if -lightwalletd
The wallets need to be able to retrieve, via lightwalletd, the UTXO set for a given address, see https://github.com/zcash/lightwalletd/issues/312. The `getaddressutxos` rpc that was added for Insight Explorer is perfect for this, but this rpc is disabled when only `-lightwalletd` is enabled (that is, it requires `-insightexplorer`, which is a superset of `-lightwalletd`). However, the `DB_ADDRESSUNSPENTINDEX` index that supports this rpc is present when only `-lightwalletd` is enabled. This was probably a (fortuitous, as it turns out) oversight. So all that's required is to allow this rpc when `-lightwalletd` is enabled.
Fix integer types in DisplayDuration
After this, `src/zcash-gtest --gtest_filter='Metrics*'` passes on a native macOS build.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>