Commit Graph

8190 Commits

Author SHA1 Message Date
Homu 8df7a073ce Auto merge of #3647 - LarryRuane:2926-mutex-assert-stop, r=str4d
On shutdown, wait for miner threads to exit (join them)

Closes #2926. Have `Shutdown()` running in the main thread wait for miner threads to exit before exiting.
2019-01-03 08:49:16 -08:00
Homu abd55f27f2 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.
2018-12-18 23:28:06 -08:00
Homu e84b865a55 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
2018-12-16 06:01:54 -08:00
Homu c4d352166d Auto merge of #3699 - Eirik0:mergetoaddress-doc-update, r=daira
Update z_mergetoaddress documentation

Corrected an error, added clarification, and updated some formatting for z_mergetoaddress documentation.
2018-12-12 11:58:18 -08:00
Eirik Ogilvie-Wigley 25f1f7dc61 Update z_mergetoaddress documentation 2018-12-11 14:25:35 -07:00
Homu 9cd74866c7 Auto merge of #3262 - str4d:2074-perf-1, r=str4d
Bitcoin 0.12 performance improvements

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6918
- bitcoin/bitcoin#6932

Part of #2074.
2018-11-30 15:25:33 -08:00
Homu 8e2ca4d94e Auto merge of #3714 - mdr0id:release-v2.0.2, r=bitcartel
Release v2.0.2
2018-11-30 10:18:43 -08:00
mdr0id 6f8d182f50 Add Charlie and Ariel alias to author_aliases
Update approx_release_height to allow pre-rel to get into master prior

Bump APPROX_RELEASE_HEIGHT due to transient failures in pre-release 2.0.2 PR
2018-11-30 10:04:49 -08:00
mdr0id 9a126cbb70 Update nnMinimumChainWork per 2.0.2 getblockchaininfo 2018-11-29 10:32:18 -08:00
Charlie O'Keefe 67d2b19caa 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.
2018-11-29 01:40:37 -07:00
mdr0id d974ec3fec make-release.py: Versioning changes for 2.0.2. 2018-11-28 11:00:22 -08:00
Larry Ruane 23c9deafb7 remove non-ascii characters from help text 2018-11-20 17:41:45 -07:00
mdr0id 4c5943cade make-release.py: Versioning changes for 2.0.2-rc1. 2018-11-18 10:11:46 -08:00
Sean Bowe 685c0ab07f Allow user to ask server to save the Sprout R1CS out during startup. 2018-11-17 17:10:58 -07:00
Simon 6d154ace1a For ZEC-013. RPC sendrawtransaction returns error if tx expiring soon. 2018-11-17 09:02:18 -08:00
Simon 4484c76202 For ZEC-013. RPC createrawtransaction returns error if tx expiring soon. 2018-11-17 09:02:10 -08:00
Simon cc1ab2db55 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.
2018-11-17 09:02:00 -08:00
Simon f8cd79c2de 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.
2018-11-17 09:01:49 -08:00
Homu a47e1fda73 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.
2018-11-16 21:07:46 -08:00
Homu ed6b10018a Auto merge of #3670 - LarryRuane:3399-peer-ban-overwinter, r=bitcartel
don't ban peers when loading pre-sapling (and pre-blossom) blocks

Resolves #3399.
2018-11-16 19:22:48 -08:00
Eirik Ogilvie-Wigley 88d134c251 Add additional z_mergetoaddress parameter tests 2018-11-16 18:14:58 -07:00
Eirik Ogilvie-Wigley 12040363ad Better error messages when sending between Sprout and Sapling 2018-11-16 18:14:58 -07:00
Eirik Ogilvie-Wigley 0adb77d32e Add locking for Sapling notes 2018-11-16 18:14:58 -07:00
Eirik Ogilvie-Wigley 487c9020bd Add Sapling support to z_mergetoaddress 2018-11-16 18:14:58 -07:00
Eirik Ogilvie-Wigley 9c6b6a2be5 Fix z_mergetoaddress parameter tests 2018-11-16 18:00:05 -07:00
Simon 471138a9f3 Update rpc_wallet_tests for new "sapling" default for z_getnewaddress. 2018-11-16 10:16:43 -08:00
Simon 6eec2812a2 Closes #3671 to make "sapling" the default for z_getnewaddress RPC. 2018-11-16 10:16:43 -08:00
Jack Grigg 51df195f5e
Comment in CDiskBlockIndex that LoadBlockIndexGuts also needs updating 2018-11-16 15:13:17 +00:00
Jack Grigg aa9d47f9d5
Set nSaplingValue in-memory when loading block index from disk 2018-11-16 15:11:33 +00:00
Homu ae49175cd4 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.

https://docs.microsoft.com/en-us/windows/desktop/winsock/windows-sockets-error-codes-2

`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
2018-11-15 12:34:11 -08:00
Homu 570e09ea59 Auto merge of #2815 - str4d:2074-relay-pruning, r=bitcartel
Relay blocks when pruning

Cherry-picked from https://github.com/bitcoin/bitcoin/pull/6148

Part of #2074.
2018-11-15 10:28:44 -08:00
Homu 85fefca399 Auto merge of #3663 - garethtdavies:3610-rpc-cleanup, r=bitcartel
Cleaning up RPC output

Closes #3610 and #3661 to clean up RPC help messages.
2018-11-15 08:42:33 -08:00
Homu bc81c12a4f 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.
2018-11-14 21:48:35 -08:00
Larry Ruane 4f53418c88 don't ban peers when loading pre-sapling (and pre-blossom) blocks 2018-11-13 17:37:59 -07:00
Charlie O'Keefe efc2b22465 Add a call to SetupNetworking in BasicTestingSetup 2018-11-13 14:00:52 -07:00
Homu dfc3e186fc Auto merge of #3613 - bitcartel:3597_transaction_builder_version_check, r=bitcartel
Closes #3597. TransactionBuilder should check tx version before adding Sapling spends and outputs
2018-11-12 13:18:47 -08:00
Gareth Davies 4c646bb45b Cleaning up RPC output
Closes #3610 and #3661
2018-11-10 07:56:39 -08:00
Homu 44f5d33465 Auto merge of #3631 - arielgabizon:rename-method, r=bitcartel
rename HaveJoinSplitRequirements for Sapling

The method also checks condition for Sapling spends whilst the method name implies otherwise
2018-11-07 23:39:55 -08:00
Simon 7a9b6f8435 Closes #3597. TransactionBuilder checks tx version before adding Sapling spends and outputs. 2018-11-07 20:38:32 -08:00
Charlie O'Keefe 0ade29546f Save and restore current_path in TestingSetup constructor/destructor 2018-10-31 15:21:46 -06:00
Larry Ruane a17646b1fd wait for miner threads to exit (join them) 2018-10-30 15:41:30 -06:00
arielgabizon 06affbca05 rename HaveJoinSplitRequirements for Sapling 2018-10-29 20:56:13 +01:00
Homu 97fccdbac5 Auto merge of #3605 - LarryRuane:3604-memo-zeros, r=daira
3604 fix sapling default memo - 0xF6 plus zeros

Closes #3604. For Sapling outputs, set the default memo to `no_memo` instead of all zeros. (See section 5.5 of the Sapling protocol specification.)
2018-10-28 03:15:07 -07:00
Homu aee5072af0 Auto merge of #3628 - bitcartel:3329_safe_mode_alert_for_pre_sapling_nodes, r=daira
Closes #3329. Send alert to put non-Sapling nodes into safe mode.

The alert targets nodes running protocol version <= 170006.
Sapling compatible nodes run protocol version >= 170007.
2018-10-28 01:21:05 -07:00
Jack Grigg ee3fa7020e
Pass parameter paths as native strings to librustzcash 2018-10-27 19:19:02 +13:00
Simon fa46ab10b8 Closes #3329. Send alert to put non-Sapling nodes into safe mode.
The alert targets nodes running protocol version <= 170006.
Sapling compatible nodes run protocol version >= 170007.
2018-10-25 11:44:31 -07:00
Eirik Ogilvie-Wigley 81005fb214 Fix error message 2018-10-24 12:05:48 -06:00
Jack Grigg 40e4981a32
Remove the testing of duplicate coinbase transactions
Inapplicable to Zcash because BIP 30 and BIP 34 have been applied from the
beginning.
2018-10-24 20:10:53 +08:00
Alex Morcos dd2d90346c
Add unit test for UpdateCoins 2018-10-24 20:10:53 +08:00
Alex Morcos 244d8a4255
Make CCoinsViewTest behave like CCoinsViewDB
Zcash: Modified to also address Zcash changes.

Co-authored-by: Jack Grigg <jack@z.cash>
2018-10-24 20:03:40 +08:00