Homu [Wed, 23 Jan 2019 20:53:51 +0000 (12:53 -0800)]
Auto merge of #3737 - gtank:zmq_checkedblock, r=str4d
zmq: add flag to publish all checked blocks
This change adds a hook for the BlockChecked signal to the zmq publisher. This is useful for light wallet daemon initialization (see https://github.com/zcash/zcash/issues/3638 for context, and [lightwalletd](https://github.com/zcash-hackworks/lightwalletd) for implementation).
The new flag is `-zmqpubcheckedblock=address`, in keeping with the established style.
Homu [Wed, 19 Dec 2018 11:24:50 +0000 (03:24 -0800)]
Auto merge of #3538 - mdr0id:mac_fix_local_rpctest, r=daira
Update for Mac OS local rpc-tests
This PR is for #3341 .
The main issue is that ```#!/usr/bin/env python2``` is not valid on Mac. However, ```#!/usr/bin/env python``` is standard for Python2.7 interpreter link.
On a side note, pyflakes does a passive check on modules imported per some python file. This allows modules to be imported even if they do not exist on the current system (e.g. pyzmq, pybake2). Ultimately, the missing modules wont throw errors until ```rpc-test.sh``` calls that python file.
I sanity checked running this update on an Ubuntu 16.04 node, and the tests pass as expected (minus a known issue that is independent from this update). Also have updated the RTD documentation for the MacOS user guide procedure.
Homu [Wed, 19 Dec 2018 07:28:06 +0000 (23:28 -0800)]
Auto merge of #3691 - ebfull:printsproutr1cs, r=daira
Allow user to ask server to save the Sprout R1CS to a file during startup.
This adds an experimental feature `-savesproutr1cs` which can be used to save the file `r1cs` containing the constraint system used in the original launch of Zcash. The file is written to the parameters directory. This can be used to recover this file for verification of the Sprout MPC transcript and parameters.
Homu [Sun, 16 Dec 2018 14:01:54 +0000 (06:01 -0800)]
Auto merge of #3716 - charlieok:initialize_params_in_transaction_builder_tests, r=daira
initialize pCurrentParams in TransactionBuilder tests
In issue https://github.com/zcash/zcash/issues/3715 the failing tests were calling Params(), which includes an assertion that pCurrentParams is not null, without first calling SelectParams(), which will set that pointer. All the other tests in the same test case (which don't fail in the manner described in #3715 ) start out by calling `SelectParams(CBaseChainParams::REGTEST);`.
This change adds an identical call to the affected tests, getting past the failed assertion in Params() on pCurrentParams.
Here is a GitLab pipeline showing output from these tests run in isolation before this change:
https://gitlab.com/charlieok/zcash/pipelines/38304730
...and here is one with the same set of tests after this change:
https://gitlab.com/charlieok/zcash/pipelines/38307556
Charlie O'Keefe [Thu, 29 Nov 2018 05:44:52 +0000 (22:44 -0700)]
initialize pCurrentParams in TransactionBuilder tests
These three tests were failing when run in isolation, or sporadically
when test order is randomized, since Params() includes an assertion that
pCurrentParams is not null.
Simon [Wed, 7 Nov 2018 01:33:27 +0000 (17:33 -0800)]
For ZEC-013. Don't propagate txs which are expiring soon in p2p messages.
When responding to "mempool" message, do not include the txid of an
expiring soon transaction in the "inv" message reply.
When responding to "getdata" message, do not reply with a "tx" message
for a transaction which is expiring soon.
Simon [Mon, 5 Nov 2018 18:24:20 +0000 (10:24 -0800)]
For ZEC-013. Mitigate potential tx expiry height related DoS vector.
Don't accept transactions which are about to expire (next 3 blocks).
Don't set a ban score if a peer does propragate these transactions.
See ZEC-013 for more detail.
Homu [Sat, 17 Nov 2018 05:07:46 +0000 (21:07 -0800)]
Auto merge of #3684 - str4d:load-sapling-chain-value, r=bitcartel
Load sapling chain value into memory
`CBlockIndex::nSaplingValue` has been correctly set and written to disk since before Sapling activated, meaning that all nodes now are correctly tracking the Sapling shielded pool value on-disk. However, on restart the per-block values are not being read into memory, and so the in-memory pool value appears to be zero on every restart. Setting `nSaplingValue` in-memory during block index loading fixes the problem.
Homu [Thu, 15 Nov 2018 20:34:11 +0000 (12:34 -0800)]
Auto merge of #3669 - charlieok:init_win_networking_in_test_setup, r=str4d
Add a call to SetupNetworking in BasicTestingSetup
In issue https://github.com/zcash/zcash/issues/3668 , the error code returned by `getaddrinfo_a` (10093) is `WSANOTINITIALISED`:
> Successful WSAStartup not yet performed. Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.
`WSAStartup` is called from the `SetupNetworking` function in `util.cpp`, but `SetupNetworking` was not being called during test setup. This pull request adds that call.
Here is a gitlab pipeline running tests in the `test_bitcoin.exe` executable before this change:
https://gitlab.com/charlieok/zcash/pipelines/36483478
...and here is the same set of tests run after this change:
https://gitlab.com/charlieok/zcash/pipelines/36485098
Homu [Thu, 15 Nov 2018 05:48:35 +0000 (21:48 -0800)]
Auto merge of #3585 - str4d:merkle-tree-test-vectors, r=bitcartel
Update IncrementalMerkleTree test vectors to use valid commitments
The original commitments were SHA256 outputs, and some were outside the
scalar field. This didn't affect the Merkle hash, which drops the high
bit from each commitment, but it does affect the creation of the Merkle
path in Rust, which requires path nodes to be valid scalars.
Here, we explicitly drop the high bit of all test vector commitments,
as well as reducing the two that remain outside the field. The test
vectors still pass, and can now also be used in the Rust implementation.