Commit Graph

14507 Commits

Author SHA1 Message Date
Casey Rodarmor 4761c9f2bc Add p2p-fullblocktest.py
Zcash: Includes pyflakes changes.
2020-11-20 03:32:53 +00:00
Daniel Kraft 95d1f887ca Fix crash when mining with empty keypool.
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>
2020-11-20 03:30:37 +00:00
Homu 877212414a Auto merge of #4745 - nathan-at-least:autoconf-require-prog, r=str4d
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. 😆
2020-11-20 01:03:29 +00:00
Nate Wilcox da081de356 configure.ac: Introduce macros to simplify requiring tools. 2020-11-20 00:59:43 +00:00
Homu bf70e357cf Auto merge of #4553 - oxarbitrage:issue4356, r=daira
Return address in z_importviewingkey error

Closes https://github.com/zcash/zcash/issues/4536.
2020-11-19 17:49:58 +00:00
Kris Nuttycombe 9a5f9bf5ee
Merge branch 'master' into issue4356 2020-11-19 07:22:39 -07:00
Homu 10b09d483e Auto merge of #4793 - str4d:faster-rpc-tests, r=str4d
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.
2020-11-19 14:15:08 +00:00
Homu 949fdca3a6 Auto merge of #4873 - str4d:rpc-test-blocks, r=str4d
Enable mininodes to construct blocks in RPC tests

Includes changes to disable difficulty adjustment on regtest, cherry-picked from:
- bitcoin/bitcoin#6853
- bitcoin/bitcoin#13046

The ZIP 143/243 logic is ported from https://github.com/zcash-hackworks/zcash-test-vectors
2020-11-18 15:11:49 +00:00
Homu 2cc836680a Auto merge of #4843 - furszy:2020_improving_sendmany_redudant_loops_first_round, r=daira
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.
2020-11-18 13:54:13 +00:00
Jack Grigg 044ff5716e test: Re-enable regtest difficulty adjustment for unit tests that use it 2020-11-18 12:17:57 +00:00
Homu e3974db2d3 Auto merge of #4870 - mdr0id:canopy_smoke_tests_update, r=str4d
Update expected fails for  Sprout txns flows on Canopy

Updating smoke test for Canopy consensus
2020-11-18 11:52:29 +00:00
Jack Grigg a7f9365fb8 test: Set hashFinalSaplingRoot default correctly in create_block 2020-11-18 11:12:09 +00:00
Jack Grigg 030a685392 test: Fix SignatureHash RPC test helper
- Check validity of inIdx.
- ZIP 143 and 243 support.
2020-11-18 11:11:54 +00:00
Jack Grigg bbed3ecc3c test: Remove FindAndDelete from RPC test framework 2020-11-17 18:48:32 +00:00
Jack Grigg 8bc0a591a0 Revert "remove SignatureHash from python rpc tests"
This reverts commit 910ff448d6.
2020-11-17 18:48:32 +00:00
Jesse Cohen aead91419e [doc][trivial] no retargeting in regtest mode 2020-11-17 18:48:32 +00:00
Eric Lombrozo 03f1d38e04 Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation.
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.
2020-11-17 18:48:32 +00:00
Homu 20dd32fe9b Auto merge of #4871 - rex4539:typos, r=str4d
Fix typo
2020-11-17 14:55:24 +00:00
Dimitris Apostolou 31e220a316
Fix typo 2020-11-17 16:33:31 +02:00
mdr0id 4dc94c954f Update expected fails for Sprout txns flows on Canopy 2020-11-16 15:57:49 -08:00
Homu 33fdb1b4bc Auto merge of #4868 - daira:clean-removes-lib, r=str4d
Windows cross-build generates .lib files, which should be ignored by git and removed by clean

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-16 21:34:08 +00:00
Homu 6d856869e9 Auto merge of #4869 - zcash:release-v4.1.1, r=nuttycom
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.
2020-11-16 18:45:38 +00:00
Kris Nuttycombe 251405491b Add notable changes to release notes for v4.1.1 2020-11-16 10:26:11 -07:00
Kris Nuttycombe 7ec8a9c5f4 make-release.py: Updated release notes and changelog for 4.1.1. 2020-11-16 10:23:40 -07:00
Kris Nuttycombe 092829cf5b make-release.py: Updated manpages for 4.1.1. 2020-11-16 10:23:40 -07:00
Kris Nuttycombe 142328b067 make-release.py: Versioning changes for 4.1.1. 2020-11-16 10:07:07 -07:00
Daira Hopwood f6fc97f35e Windows cross-build generates .lib files, which should be ignored by git and removed by clean.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-16 11:03:22 +00:00
Homu 9248cd743b Auto merge of #4864 - daira:go-faster, r=daira
Set release CFLAGS/CXXFLAGS to use -O3.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-14 08:15:23 +00:00
Homu 61ebef4095 Auto merge of #4865 - nuttycom:fix/shielded_coinbase_fr_rpc_fields, r=str4d
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.
2020-11-14 04:24:14 +00:00
Kris Nuttycombe c8a90d9b98
Update getblocktemplate documentation.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-11-13 17:09:29 -07:00
Kris Nuttycombe 1a89167944 Document how to get block subsidy information in getblocktemplate. 2020-11-13 16:36:36 -07:00
Kris Nuttycombe d107cf13b6 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.
2020-11-13 16:25:37 -07:00
Daira Hopwood a0a87ab413 Set release CFLAGS/CXXFLAGS to use -O3.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-13 22:39:17 +00:00
Homu 0ccc885371 Auto merge of #4863 - nuttycom:fix/ibd_flag_check_order, r=daira
Change order of checks to skip IsInitialBlockDownload check if flag is unset.
2020-11-13 21:49:27 +00:00
Kris Nuttycombe b5ad4cfc5e Change order of checks to skip IsInitialBlockDownload check if flag is unset. 2020-11-13 12:59:14 -07:00
furszy 2be143a20b
sendmany::find_unspent_notes removing an unneeded recursive lock, GetFilteredNotes is already locking cs_main and cs_wallet. 2020-11-13 10:56:39 -03:00
furszy b4e6353f29
asyncOp sendmany: moved inputs total amount check inside load_utxo before the dust validation. 2020-11-13 10:23:59 -03:00
furszy ca9fc49fc4
rpc_wallet_tests: changed "Insufficient funds" error message to a proper "Insufficient transparent funds". This is because we are now throwing the insufficient transparent balance rpc error inside load_utxo. 2020-11-13 10:23:59 -03:00
furszy 3a1b51900c
Improving asyncoperation_sendmany, removing another redundant for loop over all of the available utxos.
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).
2020-11-13 10:23:58 -03:00
furszy 2c7b08029d
sendmany operation: Creating TxValues struct to store the transaction values in a more organized manner. 2020-11-13 10:23:58 -03:00
furszy a9f3315872
move-only: asyncOp_sendmany, target amount calculation moved before find inputs (utxos and notes). 2020-11-13 10:23:58 -03:00
furszy 88eef56581
sendmany: removing now unused SendManyInputUTXO class. 2020-11-13 10:23:58 -03:00
furszy 726daeee4e
asyncRPCOperation_sendmany:find_utxos, removing a redundant loop over all of the available utxo in the wallet. 2020-11-13 10:23:58 -03:00
furszy c84390279c
COutput: implemented Value() method. 2020-11-13 10:23:58 -03:00
furszy d8e154ebfb
wallet:COutput adding fIsCoinbase member. 2020-11-13 10:23:58 -03:00
furszy a1b7cd4b05
sendmany::find_utxo removing an unneeded recursive lock, AvailableCoins is already locking cs_main and cs_wallet. 2020-11-13 10:23:57 -03:00
furszy 359a05d6ae
wallet:AvailableCoins filter by destination/s feature implemented + connected to sendmany async operation. 2020-11-13 10:23:56 -03:00
furszy 4007e24ed0
asyncrpcoperation_sendmany::find_utxos removing a redundant coinbase check, coinbases are already being filtered by the AvailableCoins flag. 2020-11-13 10:22:33 -03:00
furszy fbfb2c0339
wallet:AvailableCoins nMinDepth filter implemented + connected to sendmany async operation. 2020-11-13 10:22:31 -03:00
furszy e4e9712d08
wallet:AvailableCoins fOnlySpendable filtering flag implemented + connected to sendmany async operation. 2020-11-13 10:17:39 -03:00