Commit Graph

13604 Commits

Author SHA1 Message Date
Kris Nuttycombe 92cec200ee Minor fixes for ZIP-207 review comments. 2020-06-29 16:13:08 -06:00
Kris Nuttycombe 074d054e84
Trivial error message fix.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:54:07 -06:00
Kris Nuttycombe 665b8c647b
Use for..: rather than BOOST_FOREACH
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:53:41 -06:00
Kris Nuttycombe 1c00a0b541
Identify `-fundingstream` parameter as being regtest-only
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:42:45 -06:00
Jack Grigg efd04b920b Implement zip-207 and zip-214.
Add funding streams to consensus parameters.

Add funding stream payments to coinbase txns generated by the miner.
* Reduce valueBalance for shielded outputs to funding streams.
* Ensure we produce binding signatures in any case where shielded
  outputs go to either a funding stream or the miner.
2020-06-25 16:15:50 -06:00
Homu 552482a404 Auto merge of #3913 - str4d:smoke-tests, r=str4d
Automated smoke tests

Usage:

```
ZCASHD=./src/zcashd ZCASHCLI=./src/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash"
```

Includes code cherry-picked from bitcoin/bitcoin#7751.
2020-06-04 22:17:48 +00:00
Homu 4ffccda774 Auto merge of #4322 - oxarbitrage:issue3740, r=str4d
Add -debuglogfile option

Cherry-picked from https://github.com/bitcoin/bitcoin/pull/11781.
Closes https://github.com/zcash/zcash/issues/3740.
2020-06-04 00:40:45 +00:00
Homu e9a6d7926b Auto merge of #4282 - oxarbitrage:issue2375, r=daira
Add a flag to get amount results as integer

Closes https://github.com/zcash/zcash/issues/2375
2020-06-03 11:26:00 +00:00
Daira Hopwood 270a724c87
Remove unused import in qa/rpc-tests/listtransactions.py
Co-authored-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2020-06-03 12:25:31 +01:00
Alfredo Garcia 916351be04
fix/improve docs
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-02 09:14:50 -03:00
Homu 7275bc7f3f Auto merge of #4545 - str4d:metrics-ibd-progress-bar, r=str4d
metrics: Add a progress bar when in Initial Block Download mode

The progress bar shows both headers (in green) and blocks (in white / inverse of background colour). It is only printed for TTY output.

Additionally, the "not mining" message is no longer shown on mainnet, as the built-in CPU miner is not effective at the current network difficulty.
2020-06-02 03:01:51 +00:00
Jack Grigg 12e169d09f metrics: Only print IBD progress bar on TTY
Now that it is created from space characters, it is meaningless to print
it to a log file.
2020-06-02 14:23:03 +12:00
Jack Grigg a79337c3ee metrics: Switch to ANSI colour codes for progress bar
We already assume that ANSI colour codes work for the metrics art,
whereas the block characters have inconsistent support in fonts.
2020-06-02 14:20:55 +12:00
Homu 6d9573c66e Auto merge of #4552 - oxarbitrage:patch-5, r=str4d
Initialize size_t in CTxMemPool::DynamicMemoryUsage before using it

Closes https://github.com/zcash/zcash/issues/4551
2020-06-02 01:50:40 +00:00
Alfredo Garcia 74039434a8
initialize size_t 2020-06-01 09:47:02 -03:00
Alfredo Garcia 93afebeef4 add new parameters to rpc client and fix some bugs 2020-05-30 12:18:43 -03:00
Alfredo Garcia e7c829aa0e update docs 2020-05-30 10:34:03 -03:00
Alfredo Garcia 76cb4e8d04 remove not needed comments from wallet.py 2020-05-29 11:24:39 -03:00
Homu 3ded976d31 Auto merge of #4546 - daira:nu4-to-canopy, r=str4d
Rename NU4 to Canopy in constant and function names

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 09:15:59 +00:00
Daira Hopwood 1527e5b3ca Missing NU4->Canopy renames.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 10:02:50 +01:00
Daira Hopwood 22b8574d9e Rename golden/nu4.tar.gz to canopy.tar.gz.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 01:30:30 +01:00
Alfredo Garcia 3b9bd2da2f fix sort of options 2020-05-28 10:58:04 -03:00
Alfredo Garcia 7c84f4e98a fix test cases 2020-05-28 10:58:04 -03:00
Anthony Towns 83087be393 test: Add tests for `-debuglogfile` with subdirs 2020-05-28 10:58:04 -03:00
Wladimir J. van der Laan 42b025705f doc: Update release notes for `-debuglogfile` 2020-05-28 10:58:04 -03:00
Wladimir J. van der Laan 4de0ac3351 test: Add test for `-debuglogfile` 2020-05-28 10:58:04 -03:00
Wladimir J. van der Laan 540cdb34e2 Add `-debuglogfile` option
This patch adds an option to configure the name and/or directory of the
debug log.

The user can specify either a relative path, in which case the path
is relative to the data directory. They can also specify an absolute
path to put the log anywhere else in the file system.
2020-05-28 10:53:58 -03:00
Daira Hopwood c1227ae67c Rename NU4 to Canopy in constant and function names.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-28 13:11:48 +01:00
Jack Grigg 5a577c7630 qa: Add --automate flag to smoke tests 2020-05-28 23:04:58 +12:00
Jack Grigg 4498eb26db qa: Remove unused timeout configuration from wait_for_balance 2020-05-28 23:04:58 +12:00
Jack Grigg c2144f7af7 qa: Add --use-faucet flag to smoke tests 2020-05-28 23:04:58 +12:00
Jack Grigg 96681695c9 metrics: Don't show "not mining" text for mainnet
Mining with the zcashd built-in CPU miner is not useful work on mainnet
at the current network difficulty.
2020-05-28 22:21:40 +12:00
Jack Grigg eb4ada98d2 metrics: Draw IBD progress bar showing headers and blocks 2020-05-28 22:21:40 +12:00
Jack Grigg 3a1b1a2fa2 metrics: Fix indents 2020-05-28 22:21:40 +12:00
Homu 68d25c9259 Auto merge of #3936 - solardiz:report-headers-download, r=str4d
Report headers download

With current compile-time defaults, a Zcash node prefetches up to 160 block headers per request without a limit on how far it can prefetch, but only up to 16 full blocks at a time. For this and other reasons, it can get very far ahead in headers prefetch (and PoW verification on those, so it's quite some processing too) over full blocks fetch (such as 10x ahead) during initial blocks download. Let's report to the user on how many headers the node has fetched, and let's also use this information as additional input on estimating the total number of blocks to fetch: it can't be less than the number of headers already fetched.

While at it, also fix typos in related code.
2020-05-28 09:08:44 +00:00
Solar Designer fad004114a During initial blocks download, also report the number of headers 2020-05-28 20:34:31 +12:00
Solar Designer ed3b473ec6 Fix typos in ProcessMessage() "headers" 2020-05-28 20:26:00 +12:00
Homu 804125cc20 Auto merge of #4543 - defuse:fix-invalid-argument, r=str4d
Add missing <stdexcept> header for std::invalid_argument

Closes #1703.
2020-05-28 08:06:06 +00:00
mdr0id a63c1d6279 Add helpers for tapping and donating to the testnet faucet 2020-05-28 19:10:32 +12:00
Eirik Ogilvie-Wigley b21fcf37cb Various improvements
- Print time since start for each operation
- Print traceback for any raised exceptions
- Improve messages to user
- Warning cleanups
2020-05-28 19:01:52 +12:00
Eirik Ogilvie-Wigley aa4b98a7c3 Resolve decimal vs float issues 2020-05-28 18:59:20 +12:00
Homu 1d7574eb7b Auto merge of #4488 - oxarbitrage:issue4315, r=str4d
Add options and help to AFL scripts

Closes https://github.com/zcash/zcash/issues/4315

For reference here is how the help of each command is script:

**afl-get.sh**:
```
$ ./zcutil/afl/afl-get.sh --help
Obtains and builds a copy of AFL from source.

Usage:
    ./zcutil/afl/afl-get.sh --afl-install=AFL_INSTALL_DIR

    OPTIONS:
        -h, --help              Print this help message
        -i, --afl-install       Directory where AFL is going to be installed
    EXAMPLE:
        ./zcutil/afl/afl-get.sh -i /tmp/afl

$
```

**afl-build.sh**:

```
$ ./zcutil/afl/afl-build.sh --help
A wrapper around ./zcutil/build.sh for instrumenting the build with AFL.
You may obtain a copy of AFL using ./zcutil/afl/afl-get.sh.
Additional arguments are passed-through to build.sh.

Usage:
    ./zcutil/afl/afl-build.sh --afl-install=AFL_INSTALL_DIR --fuzz-case=FUZZ_CASE [ OPTIONS ... ] [ ARGUMENTS ... ]

    OPTIONS:
        -a, --harden            Turn off AFL_HARDEN. Default: 1
        -c, --configure-flags   Pass this flags to ./configure. Default: --enable-tests=no --enable-fuzz-main
        -f, --fuzz-case         Options are: CheckBlock, DecodeHexTx, DeserializeAddrMan, DeserializeTx or ReadFeeEstimates
        -h, --help              Print this help message
        -l, --afl-log           Directory to save AFL logs. Default: /home/oxarbitrage/zcash/zcash4/zcash
        -i, --afl-install       Directory where AFL is installed
        -z, --zcutil            The zcutil directory. Default /home/oxarbitrage/zcash/zcash4/zcash/zcutil
    ARGUMENTS:
        By default we are passing to build.sh the following flags:
            CC=/home/oxarbitrage/zcash/zcash4/zcash/zcutil/afl/zcash-wrapper-gcc
            CXX=/home/oxarbitrage/zcash/zcash4/zcash/zcutil/afl/zcash-wrapper-g++
    EXAMPLE:
        ./zcutil/afl/afl-build.sh -i /tmp/afl -f DecodeHexTx

$
```

**afl-run.sh**:

```
$ ./zcutil/afl/afl-run.sh --help
Start fuzzing a case in a previously zcashd built for AFL.
Additional arguments are passed-through to AFL.

Usage:
    ./zcutil/afl/afl-run.sh --afl-install=AFL_INSTALL_DIR --fuzz-case=FUZZ_CASE [ ARGUMENTS... ]

    OPTIONS:
        -f, --fuzz-case         Options are: CheckBlock, DecodeHexTx, DeserializeAddrMan, DeserializeTx or ReadFeeEstimates
        -h, --help              Print this help message
        -i, --afl-install       Directory where AFL is installed
    EXAMPLE:
        ./zcutil/afl/afl-run.sh -i /tmp/afl -f DecodeHexTx

$
```

**afl-getbuildrun.sh**:

```
$ ./zcutil/afl/afl-getbuildrun.sh --help
Builds AFL and an instrumented zcashd, then begins fuzzing.
This script must be run from within the top level directory of a zcash clone.
Additional arguments are passed-through to AFL.

Usage:
    ./zcutil/afl/afl-getbuildrun.sh --fuzz-case=FUZZ_CASE [ OPTIONS ... ] [ ARGUMENTS... ]

    OPTIONS:
        -f, --fuzz-case         Options are: CheckBlock, DecodeHexTx, DeserializeAddrMan, DeserializeTx or ReadFeeEstimates
        -h, --help              Print this help message
        -i, --afl-install       Directory where AFL is installed. Default: /home/oxarbitrage/zcash/zcash4/zcash/afl-temp
    EXAMPLE:
        ./zcutil/afl/afl-getbuildrun.sh -f DecodeHexTx

$
```
2020-05-28 04:01:05 +00:00
Homu 9bf8443c16 Auto merge of #4504 - str4d:disconnectblock-fixes, r=str4d
Use the cached consensusBranchId in DisconnectBlock

If a node is started with a set of network upgrades that don't match the
serialized chain (such as when we implement NU rollbacks on testnet),
RewindBlockIndex will disconnect each block in the chain until it
reaches the most recent block that agrees with the node's set of network
upgrades. However, the blocks themselves should be disconnected using
the consensus branch ID that they were connected with, which is
persisted alongside the chain and reconstructed in LoadBlockIndex.
2020-05-28 02:51:34 +00:00
Jack Grigg a2db35137b qa: Improve reliability of smoke test cleanup 2020-05-28 13:15:55 +12:00
Jack Grigg a2ba414d69 qa: Improve reliability of smoke tests 2020-05-28 13:15:55 +12:00
Jack Grigg 0261ccbbe8 qa: Don't allow smoke tests with mainnet wallet.dat 2020-05-28 13:15:55 +12:00
Jack Grigg a6ff0a0794 qa: Use slick-bitcoinrpc for smoke tests 2020-05-28 13:15:55 +12:00
Jack Grigg eeecb3bf8c qa: Transaction chain smoke test 2020-05-28 13:15:55 +12:00
Jack Grigg 01757cff23 qa: Simple smoke tests 2020-05-28 13:15:55 +12:00
Jack Grigg 6d1563d7a3 qa: Run Zcash node for smoke tests 2020-05-28 13:15:55 +12:00