Thanks to @MarcoFalke @dexX7 @laanwj for review.
Zcash: Just the --coverage flag for rpc-tests.py, as we backported the
rest of the coverage backend in zcash/zcash#4411.
1) created rpc-tests.py
2) deleted rpc-tests.sh
3) travis.yml points to rpc-tests.py
4) Modified Makefile.am
5) Updated README.md
6) Added tests_config.py and deleted tests-config.sh
7) Modified configure.ac with script to set correct path in tests_config.py
Zcash: Migrated our test list over, and other necessary modifications.
The UI changes were not migrated.
Since the introduction of the ScriptForMining callback, the mining
functions (setgenerate and generate) crash with an assertion failure
(due to a NULL pointer script returned) if the keypool is empty. Fix
this by giving a proper error.
Zcash: Adapted to our MinerAddress type.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
configure.ac: Introduce macros to simplify requiring tools.
## what
Introduce two `ZC_REQUIRE_(PROG|TOOL)` macros that are like `AC_PATH_(PROG|TOOL)` except they immediately error out if the target program is not detected.
Then require almost all programs, except for two known optional cases: three programs required only if `--with-lcov` is given, and then `ccache` which has exceptional logic (The equivalent of "--enable-ccache=auto" by default, with explicit 'yes' or 'no' possible, each with different detection needs.)
## why
Provide early explicit errors for build misconfigurations. Hopefully this should never hit our "standard official flow" which relies on the `./zcutil/build.sh` path, though it may come into play for anyone experimenting with the build system or altering dependencies.
### background motivation
While prototyping a nix build system I didn't provide the `cargo` program to the `zcashd` build process. `./configure` happily exited with a success value, but the build system was instantiated with the `CARGO` make / shell variable set to the empty string, which lead to a strange command execution where a long command of `… $CARGO build …` became `… build …`, so bash looked for a program named `build`. I spent a bit too long looking for where "build" was defined in our dependencies. 😆
test: Use default shielded address in RPC tests where the type is irrelevant
This means we are running these tests against the recommended functionality,
and that these RPC tests will now use the faster Sapling addresses.
Improving asyncOp_sendmany redundancies (first round)
Work over async sendmany operation flow. Specifically on the utxo finding, utxo selection, total amount calculation and the tx inputs appending process. Removed several unneeded for loops over the entire utxo set, re structuring and cleaning the flow.
Zcash: Moved conditional into GetNextWorkRequired(), as we had rewritten
CalculateNextWorkRequired() to not have the necessary information. This
means that CalculateNextWorkRequired() will in unit tests calculate what
regtest would use were the new field not set; this is irrelevant, as only
GetNextWorkRequired() is used directly in consensus rules.
Release v4.1.1
Optimize release build
----------------------
The release build now sets CLAGS/CXXFLAGS to use the -O3 optimization
option, which turns on more optimization flags than the previously used
-O1. This produces a faster build, addressing a performance regression in
v4.1.0.
Correctly report Founders' Reward amount in `getblocktemplate`
--------------------------------------------------------------
This release correctly returns the `foundersreward` field from `getblocktemplate`
output pre-Canopy and removes the field post-Canopy. (The Founders' Reward will
expire exactly as Canopy activates, as specified in [ZIP 207](https://zips.z.cash/zip-0207).)
To obtain information about funding stream amounts, use `getblocksubsidy HEIGHT`,
passing in the height returned by the `getblocktemplate` API.
Correctly report founder's reward amount in getblocktemplate prior to Canopy
Previously this would return incorrect results in the case that the
miner reward was sent to a shielded address. Post-Canopy, the
foundersreward field is removed; this information should be obtained
from getblocksubsidy instead.
Previously this would return incorrect results in the case that the
miner reward was sent to a shielded address. Post-Canopy, the
foundersreward field is removed; this information should be obtained
from getblocksubsidy instead.
What the commits is essentially doing is:
1) Decouple transparent inputs load into its own method (making use of the recently added TxValues helper).
2) Move load transactions inputs right after get the available coins from the wallet inside find_utxos.
3) Remove the redundant loop over the available utxo to calculate the _inputs_total value that occurs after calling find_utxos (_inputs_total is being calculated inside the inputs selection loop only once now, inside load_utxos).