Commit Graph

11636 Commits

Author SHA1 Message Date
Sean Bowe 3577de83aa Change txdb prefixes for sapling and avoid writing unnecessary information. 2018-05-18 13:26:39 -06:00
Sean Bowe 8f5429a13a Update merkle tree and pedersen hash tests to account for new encoding 2018-05-18 13:26:39 -06:00
Sean Bowe 45f1cb440e Update Sapling testnet parameters 2018-05-18 13:26:39 -06:00
Sean Bowe b9a5a116cd Update librustzcash 2018-05-18 13:26:37 -06:00
Homu 386a9b35c0 Auto merge of #3238 - str4d:3199-mempool-sapling-activation, r=str4d
Update mempool_nu_activation RPC test to exercise both Overwinter and Sapling

Closes #3199.
2018-05-16 13:52:40 -07:00
Homu f62fff80d5 Auto merge of #3255 - str4d:sapling-value-pool, r=ebfull
Track net value entering and exiting the Sapling circuit
2018-05-16 10:46:32 -07:00
Eirik Ogilvie-Wigley 3182b4abc3 Add tests for sapling anchors 2018-05-16 10:31:53 -06:00
Homu 1063dfdeaa Auto merge of #3271 - ebfull:stable-rust, r=bitcartel
Switch Rust to 1.26 Stable
2018-05-15 21:27:53 -07:00
Homu 29a75886c2 Auto merge of #3251 - ebfull:sprout-groth16, r=ebfull
Sprout on Groth16

Depends on https://github.com/zcash/librustzcash/pull/6
2018-05-15 15:48:19 -07:00
Sean Bowe 0dfb1d5e2c Switch Rust to 1.26 Stable. 2018-05-15 16:21:37 -06:00
Alex Morcos bbff8631f5
Output line to debug.log when IsInitialBlockDownload latches to false 2018-05-15 22:18:11 +12:00
Gregory Maxwell f04a90afb2
IsInitialBlockDownload no longer uses header-only timestamps.
This avoids a corner case (mostly visible on testnet) where bogus
 headers can keep nodes in IsInitialBlockDownload.
2018-05-15 22:18:04 +12:00
Gregory Maxwell e41632c9fb
IBD check uses minimumchain work instead of checkpoints.
This introduces a 'minimum chain work' chainparam which is intended
 to be the known amount of work in the chain for the network at the
 time of software release.  If you don't have this much work, you're
 not yet caught up.

This is used instead of the count of blocks test from checkpoints.

This criteria is trivial to keep updated as there is no element of
subjectivity, trust, or position dependence to it. It is also a more
reliable metric of sync status than a block count.
2018-05-15 21:25:19 +12:00
Kaz Wesley 02eedeeb69
IsInitialBlockDownload: usually avoid locking
Optimistically test the latch bool before taking the lock.
For all IsInitialBlockDownload calls after the first to return false,
this avoids the need to lock cs_main.
2018-05-15 21:25:19 +12:00
Wladimir J. van der Laan 29aaf13b0a
Make max tip age an option instead of chainparam
After discussion in #7164 I think this is better.

Max tip age was introduced in #5987 to make it possible to run
testnet-in-a-box. But associating this behavior with the testnet chain
is wrong conceptually, as it is not needed in normal usage.
Should aim to make testnet test the software as-is.

Replace it with a (debug) option `-maxtipage`, which can be
specified only in the specific case.
2018-05-15 21:24:58 +12:00
Larry Ruane 0ee4b20a7b
fix qa/zcash/full_test_suite.py pathname
underscores instead of hyphens; .py instead of .sh
(did not bother with PR but Eirik reviewed this change)
2018-05-14 16:50:42 -06:00
Jack Grigg f55029e7d1 Correctly serialize Groth16 JSDescription for verifyjoinsplit benchmark 2018-05-14 16:29:02 -06:00
Sean Bowe 34f6ea95dc Adjust tests and benchmarks 2018-05-14 16:29:02 -06:00
Sean Bowe 31989317c9 Update librustzcash again 2018-05-14 16:29:00 -06:00
Sean Bowe b7a6c32178 Integrate Groth16 verification and proving. 2018-05-14 16:26:23 -06:00
Homu dd72b5346e Auto merge of #3264 - sembrestels:patch-1, r=bitcartel
Update Payment API

I included those missing commands to the API reference: `z_exportviewingkey`, `z_importviewingkey`, and `z_listunspent`.

Do you think we should include `z_mergetoaddress`, `z_getpaymentdisclosure`, and `z_validatepaymentdisclosure` too, despite they are experimental?
2018-05-14 11:14:05 -07:00
David Llop 471a912e02
Update Payment API
I included those missing commands to the API reference: `z_exportviewingkey`, `z_importviewingkey`, and `z_listunspent`.

Do you think we should include `z_mergetoaddress`, `z_getpaymentdisclosure`, and `z_validatepaymentdisclosure` too, despite they are experimental?
2018-05-14 15:37:08 +02:00
Homu 75546c697a Auto merge of #3234 - str4d:3058-address-polymorphism, r=str4d
Use boost::variant to represent shielded addresses and keys

Part of #3058 and #3059.
2018-05-12 04:06:27 -07:00
Jack Grigg e5eab182b5
Use boost::variant to represent shielded addresses and keys
libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress,
and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly
for ViewingKey and SpendingKey.

A new class InvalidEncoding is introduced as the default boost::variant
option for each address and key type; it is used during decoding instead
of boost::optional.

All address and key storage functions in the wallet have been modified to
refer specifically to the Sprout types, as they are used very precisely.
In most other cases, the more general type is leveraged as much as possible,
and we convert to the Sprout type when necessary. This will be subsequently
wrapped in, or replaced with, context-specific functions once Sapling
types are implemented.
2018-05-11 17:14:49 -04:00
Homu 1942f7a42b Auto merge of #3242 - str4d:3058-key-encoding-refactor, r=str4d
Key encoding refactor

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11372
  - Only the first three commits (the fourth commit depends on #2390)

Part of #3058.
2018-05-11 12:21:29 -07:00
Jonathan "Duke" Leto 30bf78ca23 Clarify help that signmessage only works on taddrs 2018-05-10 17:25:13 -07:00
Homu ae6c2587d3 Auto merge of #3232 - ebfull:3207-sapling-validation, r=str4d
Sapling validation

**Also review https://github.com/zcash/librustzcash/pull/7**

This is an attempt to tackle much of https://github.com/zcash/zcash/issues/3065
2018-05-10 10:21:15 -07:00
Homu 73f5cb1213 Auto merge of #3257 - bitcartel:3250_fix_segfault_memo, r=ebfull
Closes #3250. Memo getter should return by reference, not by value.
2018-05-10 08:47:06 -07:00
Homu 677b5b3b8b Auto merge of #3247 - str4d:3207-valuebalance, r=str4d
Add valueBalance to value balances

Part of #3065 and #3207.
2018-05-10 07:12:00 -07:00
Jack Grigg 0fe0ca7948
Add contextual comment for GetValueOut() and GetShieldedValueIn() 2018-05-10 09:34:19 -04:00
Simon 67f3577239 Closes #3250. Memo getter should return by reference, not by value. 2018-05-09 21:52:33 -07:00
Homu 08f74ed026 Auto merge of #3240 - str4d:remove-obsolete-binaries, r=str4d
Remove obsolete CreateJoinSplit and GenerateParams binaries
2018-05-09 13:50:25 -07:00
Jack Grigg ae97177c86
Track net value entering and exiting the Sapling circuit 2018-05-09 16:02:23 -04:00
Jack Grigg 97b46f00cc
Add valueBalance to value balances, and enforce its consensus rules 2018-05-09 11:34:41 +01:00
Homu f0daf3915f Auto merge of #3233 - str4d:3164-sapling-sighash, r=str4d
ZIP 243: Sapling SignatureHash

Closes #3164.
2018-05-08 16:59:33 -07:00
Jack Grigg 93bd00a0d5
Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +01:00
Pieter Wuille 3d31e09cbb
Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
Pieter Wuille 3e60c9fabd
Stop using CBase58Data for ext keys 2018-05-08 21:39:55 +01:00
Jack Grigg aa333ee8f2
Implement {Encode,Decode}PaymentAddress etc. without CZCEncoding 2018-05-08 21:39:55 +01:00
Jack Grigg 8bf3a3d700
Introduce wrappers around CZCViewingKey 2018-05-08 21:39:55 +01:00
Jack Grigg 472f75bc2d
Introduce wrappers around CZCSpendingKey 2018-05-08 21:39:55 +01:00
Jack Grigg 80ed13d545
Introduce wrappers around CZCPaymentAddress
This patch removes the need for the intermediary Base58 type
CZCPaymentAddress, by providing {Encode,Decode}PaymentAddress
functions that directly operate on the conversion between strings
and libzcash::PaymentAddress.
2018-05-08 21:39:55 +01:00
Pieter Wuille f146029b0a
Replace CBitcoinSecret with {Encode,Decode}Secret 2018-05-08 21:39:54 +01:00
Sean Bowe b4db32f53c Check Sapling Spend/Output proofs and signatures. 2018-05-08 14:30:26 -06:00
Sean Bowe 531fcc88da Update to latest librustzcash 2018-05-08 14:30:26 -06:00
Sean Bowe 55fabd8272 Refactor so that dataToBeSigned can be used later in the function for other purposes. 2018-05-08 14:28:01 -06:00
Sean Bowe 6eea48bf96 Remove unnecessary IsCoinbase() check. Coinbases are guaranteed to have empty vjoinsplit. 2018-05-08 14:23:09 -06:00
Homu b1d2a69908 Auto merge of #3202 - str4d:3058-sapling-bech32, r=str4d
Bech32 encoding support

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#8578
- bitcoin/bitcoin#11167
  - Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific).
- bitcoin/bitcoin#12757
  - Only the change to `src/bech32.h`

Part of #3058.
2018-05-08 09:08:37 -07:00
Homu 0c1adf8281 Auto merge of #3201 - Eirik0:3190-dumpprivkey-help-text, r=str4d
Clarify help text of dumpprivkey

Closes #3190
2018-05-08 06:02:17 -07:00
Jack Grigg 50284985e9
Update sighash tests 2018-05-08 11:45:41 +01:00