Homu
aad4b86e95
Auto merge of #3376 - LarryRuane:2728-help-message-experimental, r=bitcartel
...
add extra help how to enable experimental features
Closes #2728 . When the user attempts to execute a disabled experimental RPC, print some nice text explaining how to enable the RPC (either command-line or adding lines to zcash.conf).
2018-07-18 07:45:46 -07:00
Homu
b9bd5ab42c
Auto merge of #3354 - leto:absurd_fee_bug, r=bitcartel
...
Fix absurd fee bug reported in #3281 , with tests
This was ported from the Hush `absurd_fee_bug` PR: https://github.com/MyHush/hush/pull/136
Tests executed with `./qa/pull-tester/rpc-tests.sh wallet` and pass on Ubuntu 16.04. Some tests were added for previously untested behavior as well.
Closes #3281 .
2018-07-17 15:03:08 -07:00
Simon
687bd96cbd
Minor update to address nits in review.
2018-07-17 14:26:38 -07:00
Homu
3835cbb57f
Auto merge of #3263 - str4d:ibd-upstream-changes, r=bitcartel
...
InitialBlockDownload upstream changes
Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7208
- bitcoin/bitcoin#8007
- bitcoin/bitcoin#9053
- Excluding second commit (requires bitcoin/bitcoin#8865 )
- bitcoin/bitcoin#10388
2018-07-17 13:17:27 -07:00
Simon
0b6eeac330
Update and fix per review comments, the test for absurd fee.
2018-07-17 13:00:42 -07:00
Homu
13b41a6760
Auto merge of #3156 - Eirik0:2935-change-indicator, r=bitcartel
...
Add change indicator
This adds to the json returned when calling z_listreceivedbyaddress and z_listuspent an additional field entitiled 'change' which will be either true or false depending on whether or not the note was change from another transaction.
2018-07-17 11:41:03 -07:00
Larry Ruane
66dfcc1369
add extra help how to enable experimental features
2018-07-16 21:31:55 -06:00
Sean Bowe
f23e783600
Decryption and tests of note/outgoing encryption.
2018-07-16 18:34:14 -06:00
Homu
ea0bd9d3b8
Auto merge of #3345 - str4d:sapling-z_validateaddress, r=bitcartel
...
Add Sapling support to z_validateaddress
Part of #3217 .
2018-07-16 15:04:54 -07:00
Eirik Ogilvie-Wigley
0646f749f9
Add change indicator for notes
2018-07-16 14:49:29 -06:00
Homu
b7d058cef3
Auto merge of #3334 - arielgabizon:add_groth_tests, r=bitcartel
...
Extend JoinSplit tests to Groth
As we now have both PGHR and Groth proofs for Sprout - make the joinsplit tests check the Groth proofs as well.
See https://github.com/zcash/zcash/issues/3266
2018-07-16 12:11:12 -07:00
Duke Leto
4b8c52c65c
Improve error message
2018-07-14 05:16:28 +00:00
Duke Leto
75bb5f94f4
Update comment as per @arielgabizon
2018-07-13 19:19:16 +00:00
Ariel Gabizon
589479fd33
Extend Joinsplit tests to Groth
2018-07-13 13:01:34 +02:00
Homu
eea0e2c924
Auto merge of #3390 - arcalinea:3319_discard_sk_if_invalid_ivk, r=str4d
...
Discard sk if ivk == 0
Addresses #3319
2018-07-13 03:16:21 -07:00
Jay Graber
db9f669c15
Discard sk if ivk == 0
2018-07-12 15:05:19 -07:00
Homu
f55bcd1c10
Auto merge of #3374 - rex4539:fix-typos, r=str4d
...
Fix typos
2018-07-12 14:25:15 -07:00
Simon
34bf166e5f
Add encryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes.
...
This is part of #3061 to add Sapling note functionality.
2018-07-11 22:03:04 -07:00
Homu
d86f60f382
Auto merge of #3324 - ebfull:sapling-note-encryption, r=ebfull
...
Sapling note encryption implementation
Closes #3055
Implemented along with @gtank and @Eirik0
DH key exchange was implemented in https://github.com/zcash/librustzcash/pull/18
2018-07-11 14:51:57 -07:00
Sean Bowe
7478876271
Minor edits
2018-07-11 15:48:41 -06:00
Jack Grigg
bea879157c
Add Sapling support to z_validateaddress
2018-07-09 15:38:07 +01:00
Homu
579ad3b13e
Auto merge of #3273 - arcalinea:sapling_keys, r=str4d
...
Sapling keys in keystore, wallet
- Add/Have/Get SaplingSpendingKey
- Add/Remove/Have/Get SaplingFullViewingKey
- Have/Get SaplingIncomingViewingKey
- SaplingSpendingKeyMap, SaplingFullViewingKeyMap, SaplingIncomingViewingKeyMap
- GenerateNewSaplingZKey()
Not included: note decryptors, crypted keystore
2018-07-06 15:18:39 -07:00
Dimitris Apostolou
ccf9106501
Fix typos
2018-07-06 14:33:24 +03:00
Jay Graber
2173767365
Add crypted keystore sapling add key
2018-07-05 15:00:00 -07:00
Jay Graber
8e91ebf76c
Change default_address to return SaplingPaymentAddr and not boost::optional
2018-07-05 14:52:51 -07:00
Jay Graber
f82a864dc1
Add StoreAndRetrieveSaplingSpendingKey test
2018-07-05 14:52:51 -07:00
Jay Graber
f4207d0c0e
Add SaplingIncomingViewingKeys map, SaplingFullViewingKey methods
2018-07-05 14:52:46 -07:00
Jay Graber
efb7662d4a
Add Sapling Add/Have/Get to keystore
2018-07-05 14:37:33 -07:00
Larry Ruane
c872c1d2df
Disable libsnark debug logging in Boost tests
2018-07-05 10:16:13 -06:00
Simon
8fc73722e8
make-release.py: Versioning changes for 1.1.2.
2018-07-01 20:07:24 -07:00
Simon
5cbbb7e375
make-release.py: Versioning changes for 1.1.2-rc1.
2018-06-22 16:55:20 -07:00
Homu
d5dcfa2b01
Auto merge of #3346 - bitcartel:3328_alert_non_overwinter_nodes, r=str4d
...
Closes #3328 . Send alert to put non-Overwinter nodes into safe mode.
The alert targets nodes running protocol version <= 170004.
Overwinter compatible nodes run protocol version >= 170005.
2018-06-22 09:40:01 -07:00
Simon
e56117f894
Closes #3328 . Send alert to put non-Overwinter nodes into safe mode.
...
The alert targets nodes running protocol version <= 170004.
Overwinter compatible nodes run protocol version >= 170005.
2018-06-22 09:07:12 -07:00
Homu
f587e61bda
Auto merge of #3259 - leto:signmessage, r=str4d
...
Clarify help that signmessage only works on taddrs
2018-06-22 02:19:12 -07:00
Duke Leto
e5aa9f617b
Fix absurd fee bug reported in #3281 , with tests
2018-06-22 05:20:45 +00:00
Homu
f24d1ff546
Auto merge of #3337 - str4d:getblock-finalsaplingroot, r=bitcartel
...
Add hashFinalSaplingRoot to getblockheader and getblock output
2018-06-19 16:19:13 -07:00
Homu
9acfa0067f
Auto merge of #3258 - Eirik0:3056-anchor-test-cases, r=str4d
...
Add tests for sapling anchors
Closes #3253
2018-06-19 09:28:20 -07:00
Eirik Ogilvie-Wigley
762ee0e896
Rename typename
2018-06-19 10:07:00 -06:00
Eirik Ogilvie-Wigley
115b26cb27
Add BOOST_TEST_CONTEXT to distinguish sprout v. sapling
2018-06-19 10:06:21 -06:00
Homu
2ebde5860e
Auto merge of #3326 - str4d:3058-sapling-addresses, r=str4d
...
Sapling address encodings
This PR enables Sapling keys and addresses to be passed in anywhere Sprout keys
and addresses are used. Doing so will cause crashes until those places are updated
with Sapling support.
Includes code cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#11167
- Only the `ConvertBits()` function.
- bitcoin/bitcoin#11630
Closes #3058 .
2018-06-19 05:12:50 -07:00
Homu
4e3ff06507
Auto merge of #3320 - str4d:macos-tests, r=bitcartel
...
Fix MacOS tests
Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270 .
2018-06-18 19:00:56 -07:00
Sean Bowe
4e1f2daa0d
Add get_esk() function to Sapling note encryption.
2018-06-18 13:14:43 -06:00
Jack Grigg
3af4633b4b
Add hashFinalSaplingRoot to getblockheader and getblock output
2018-06-15 13:59:28 +12:00
Sean Bowe
c03e22612d
Prevent nonce reuse in Sapling note encryption API.
2018-06-14 12:21:28 -06:00
Sean Bowe
90073aeca5
Swap types in OutputDescription to use new NoteEncryption interfaces.
2018-06-14 12:08:37 -06:00
Sean Bowe
9e1c2c4049
Implementation of Sapling in-band secret distribution.
2018-06-14 11:58:45 -06:00
Jay Graber
052d640cb0
Add json test vectors for Sapling key components.
2018-06-13 10:38:32 -07:00
Homu
4f18c693c3
Auto merge of #3272 - bitcartel:3061_sapling_add_notes, r=bitcartel
...
Add SaplingNote class
Part of #3061 , adding SaplingNote class.
2018-06-12 16:58:38 -07:00
Simon
268e5dfa50
Return optional for Sapling commitments and nullifiers.
...
Unlike Sprout, they are not always computable in Sapling.
2018-06-12 14:40:17 -07:00
Simon
d17f8d1cc7
Refactor and replace factory method random() with constructor.
2018-06-12 14:37:15 -07:00
Simon
36e2e7cc32
Add SaplingNote class and test_sapling_note unit test.
2018-06-12 14:37:05 -07:00
Homu
524171de1f
Auto merge of #3137 - str4d:2943-remove-auto-senescence-option, r=ebfull
...
Remove config option -disabledeprecation
Closes #2943 .
2018-06-12 08:51:13 -07:00
Jack Grigg
69aa0d8f28
Use CChainParams::Bech32HRP() in zs_address_test
2018-06-12 18:38:36 +12:00
Jack Grigg
f59093935c
Add examples of ConvertBits transformation
2018-06-12 16:51:59 +12:00
Jack Grigg
dd7417c8d0
Add comment about size calculations for converted serialized keys
2018-06-12 15:47:56 +12:00
Jack Grigg
c74ab3356a
Remove config option -disabledeprecation
...
Closes #2943 .
2018-06-11 10:38:12 -07:00
Ariel Gabizon
e1a3461cc2
Improve/Fix variable names
...
ZCProof was too general. pubKeyHash was actually the JoinSplit pubkey
itself.
2018-06-09 20:27:35 -07:00
Homu
de1bc2d389
Auto merge of #3321 - bitcartel:remove_librustcash_xor, r=str4d
...
Remove now redundant Rust call to librustzcash_xor.
Related to https://github.com/zcash/librustzcash/pull/17 which removes librustzcash_xor from library.
2018-06-07 20:37:07 -07:00
Simon
10a7d55a03
Remove now redundant Rust call to librustzcash_xor.
2018-06-06 23:24:21 -07:00
Jack Grigg
2802e321c1
Fix cached_witnesses_empty_chain test failure on MacOS
...
Assertion error format is different, so match only on the assertion.
2018-06-07 17:49:05 +12:00
Jack Grigg
bec3e62bc1
Implement encoding and decoding of Sapling keys and addresses
2018-06-07 17:28:50 +12:00
Jack Grigg
c8511dfc07
Fix bech32::Encode() error handling
...
Previously, an input with invalid characters would result in out-of-bounds
reads, potentially exposing up to 224 bytes of memory following the location of
the CHARSET constant. This commit fixes the function to return an empty string,
which is what was originally documented as happening.
2018-06-07 17:19:44 +12:00
Pieter Wuille
6a2cc8ddc0
Simplify Base32 and Base64 conversions
2018-06-07 17:19:43 +12:00
Pieter Wuille
ac70f76c5d
Generalize ConvertBits
2018-06-07 17:19:34 +12:00
Jack Grigg
6b759fb092
ConvertBits() - convert from one power-of-2 number base to another.
...
Function extracted from upstream:
PR bitcoin/bitcoin#11167
Commit c091b99379b97cb314c9fa123beabdbc324cf7a4
2018-06-07 16:42:01 +12:00
Jack Grigg
7e45636707
chainparams: Add Sapling Bech32 HRPs
2018-06-07 16:41:59 +12:00
Homu
80338c07e5
Auto merge of #3237 - str4d:std-array, r=str4d
...
Replace boost::array with std::array
2018-06-06 19:36:57 -07:00
Jack Grigg
4fb3d05ce9
Whitespace cleanup
2018-06-07 14:35:56 +12:00
Homu
ffba08b0e0
Auto merge of #3318 - Eirik0:3298-fix-getnetworksolps-params, r=bitcartel
...
Fix parsing parameters in getnetworksolps
This fixes https://github.com/zcash/zcash/issues/3298 . The parameters were not correctly being converted.
2018-06-06 10:00:21 -07:00
Homu
d18212b1d6
Auto merge of #3299 - Eirik0:3248-update-getblocktemplate, r=str4d
...
Add hashFinalSaplingRoot to getblocktemplate
Closes #3248
2018-06-06 05:00:58 -07:00
Matthew King
d28d3d20de
Use portable #! in python scripts (/usr/bin/env)
2018-06-05 21:56:13 +12:00
Eirik Ogilvie-Wigley
c61ed9acfb
Fix parsing parameters in getnetworksolps
2018-06-04 16:45:12 -06:00
Jay Graber
87c9994cb2
Make diversifier functions return option
2018-06-04 07:47:46 -07:00
Jay Graber
0da9aac63e
s/SaplingInViewingKey/SaplingIncomingViewingKey
2018-06-04 04:59:07 -07:00
Eirik Ogilvie-Wigley
25c13ef702
Add hashFinalSaplingRoot to getblocktemplate
2018-06-01 15:47:30 -06:00
Jay Graber
dd099401a3
Fix default_address()
2018-06-01 04:03:27 -07:00
Jay Graber
521a6f1fc0
Minimal sapling key test
2018-06-01 02:32:17 -07:00
Jay Graber
52d81ff794
Update librustzcash dependency, address comments
2018-06-01 01:48:28 -07:00
Jay Graber
84e3a2212f
Change librustzcash dependency hash to work for new Sapling classes
2018-06-01 00:04:13 -07:00
Jay Graber
11acfe6e9f
Add Sapling key classes to wallet, with new librustzcash APIs
2018-06-01 00:04:13 -07:00
Homu
73fea25404
Auto merge of #3300 - bitcartel:3277_add_comment_deprecated_txdb_prefixes, r=str4d
...
Part of #3277 . Add comment about deprecated txdb prefixes.
2018-05-25 18:42:05 -07:00
Jack Grigg
a6bbb26e08
Replace boost::array with std::array
2018-05-26 00:12:57 +12:00
Simon
c290f8f263
Update release height to block 332000.
2018-05-24 23:09:02 -07:00
Jack Grigg
d670db7164
Sapling testnet activation height
2018-05-25 16:05:25 +12:00
Jack Grigg
40c33db2f4
make-release.py: Versioning changes for 1.1.1.
2018-05-25 15:38:43 +12:00
Simon
47db75426f
Closes #3301 . Non-void function should not have empty definition.
2018-05-23 21:04:51 -07:00
Simon
f9840089db
Part of #3277 . Add comment about deprecated txdb prefixes.
2018-05-23 20:37:34 -07:00
Simon
d3ff27c0a6
make-release.py: Versioning changes for 1.1.1-rc2.
2018-05-23 09:27:59 -07:00
Jack Grigg
8bf890abac
make-release.py: Versioning changes for 1.1.1-rc1.
2018-05-19 09:50:15 +12:00
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
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
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
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
b7a6c32178
Integrate Groth16 verification and proving.
2018-05-14 16:26:23 -06: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
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
Jack Grigg
b391b70736
Implement Sapling signature hash (ZIP 243)
2018-05-08 11:45:38 +01:00
Homu
0a98b97524
Auto merge of #3236 - str4d:3192-jsoutpoint-constructor, r=str4d
...
Change JSOutPoint constructor to have js argument be uint64_t
Closes #3192 .
2018-05-08 02:50:04 -07:00
Homu
333b9a0d0b
Auto merge of #3170 - ebfull:sapling-merkle-tree, r=ebfull
...
Sapling merkle tree implementation
Closes #3056 .
Please also review https://github.com/zcash/librustzcash/pull/8
This PR:
1. Introduces ZCSaplingIncrementalMerkleTree using Pedersen hashes.
2. Adds support for Sapling anchors into consensus rules. (Adds commitments, checks anchors are correct, handles block (dis)connects, etc.)
3. Handles mempool eviction for obsolete anchors.
4. Enforces correctness of block's Sapling root field
5. Changes miner to correctly apply the Sapling root to the block header
6. Handles mempool consistency checks for anchors
2018-05-07 20:37:46 -07:00
Sean Bowe
40bfb9e5b9
Swap bit endianness of test vectors
2018-05-07 18:57:04 -06:00
Jack Grigg
e935beb810
wallet: Make some arguments const that can be
2018-05-07 22:13:26 +01:00
Jack Grigg
b87e271a9a
wallet: Change IsLockedNote to take a JSOutPoint
...
This removes the uint64_t -> size_t -> uint64_t round trip, as well as the
JSOutPoint -> parts -> JSOutPoint round trip.
2018-05-07 21:56:57 +01:00
Sean Bowe
f6f97dfb1c
Fix miner tests
2018-05-07 14:37:46 -06:00
Sean Bowe
8c57bbac15
Fix broken error messages.
2018-05-07 14:37:46 -06:00
Sean Bowe
e390a475c1
Fix outdated comment
2018-05-07 14:37:46 -06:00
Sean Bowe
98d2f090ca
Evict transactions with obsolete anchors from the mempool
2018-05-07 14:37:46 -06:00
Sean Bowe
673a0a79b3
Adjust tests to handle Sapling anchor cache
2018-05-07 14:37:46 -06:00
Sean Bowe
31a04d2875
Calculate the correct hashFinalSaplingRoot in the miner.
2018-05-07 14:37:46 -06:00
Sean Bowe
b4ff707605
Add support for Sapling anchor checks in mempool consistency checks.
2018-05-07 14:37:46 -06:00
Sean Bowe
1f8be05b63
Add consensus support for Sapling merkle trees.
2018-05-07 14:37:46 -06:00
Sean Bowe
85b39f57bb
Add `PushSaplingAnchor`
2018-05-07 14:37:46 -06:00
Sean Bowe
c643ff0b51
Add support for PopAnchor(.., SPROUT/SAPLING)
2018-05-07 14:37:46 -06:00
Sean Bowe
27616b9a04
Add support for Sapling anchors in coins/txdb.
2018-05-07 14:37:46 -06:00
Sean Bowe
e814be60fe
Rename hashSproutAnchorEnd to hashFinalSproutRoot to be consistent.
2018-05-07 14:37:46 -06:00
Sean Bowe
f2c6d214e5
Rename hashSaplingAnchorEnd to hashFinalSaplingRoot to match spec.
2018-05-07 14:37:46 -06:00
Sean Bowe
7b62078782
Remove underscores from gtest test names.
2018-05-07 14:37:46 -06:00
Sean Bowe
7703a673ea
Generalize the PushAnchor implementation behavior.
2018-05-07 14:37:43 -06:00
Sean Bowe
9ea4e387b2
Generalize the PopAnchor implementation behavior.
2018-05-07 13:46:06 -06:00
Sean Bowe
18322f074c
Introduce support for GetBestAnchor(SAPLING).
2018-05-07 13:46:06 -06:00
Sean Bowe
2bd59e1473
Rename PushAnchor to PushSproutAnchor.
2018-05-07 13:46:06 -06:00
Sean Bowe
008f4ee8e7
Rename GetAnchorAt to GetSproutAnchorAt.
2018-05-07 13:46:06 -06:00
Sean Bowe
8b8d70cad9
Rename DB_ANCHOR to DB_SPROUT_ANCHOR.
2018-05-07 13:46:06 -06:00
Sean Bowe
30325eebf5
Add primitive implementation of GetSaplingAnchorEnd.
2018-05-07 13:46:06 -06:00
Sean Bowe
691a3fa2e9
Rename hashReserved to hashSaplingAnchorEnd.
2018-05-07 13:46:06 -06:00
Sean Bowe
08f0728884
Rename hashAnchor to hashSproutAnchor.
2018-05-07 13:46:06 -06:00
Sean Bowe
d455828fdc
Specifically describe anchors as Sprout anchors.
2018-05-07 13:46:06 -06:00
Sean Bowe
28d20bdb11
Rename NullifierType to ShieldedType.
2018-05-07 13:46:06 -06:00
Sean Bowe
2f23a656fb
Add regression tests and test vectors for Sapling merkle tree
2018-05-07 13:46:06 -06:00
Sean Bowe
2b002a7e60
Add implementation of Sapling merkle tree
2018-05-07 13:46:06 -06:00
Sean Bowe
a7cbb8475f
Abstract `uncommitted` and depth personalization for IncrementalMerkleTree.
2018-05-07 13:46:06 -06:00
Homu
1d4235dce7
Auto merge of #3239 - str4d:sapling-default-tx-version, r=str4d
...
Update CreateNewContextualCMutableTransaction for Sapling
Part of #3063 .
2018-05-07 12:27:47 -07:00
Jack Grigg
e1d41f21f3
Update tests for CreateNewContextualCMutableTransaction changes
2018-05-07 20:21:55 +01:00
Jack Grigg
ef1678bf0f
Add some more checkpoints, up to the 1.1.0 release
2018-05-07 15:15:41 +01:00
Homu
265eca3f47
Auto merge of #3212 - str4d:2864-sapling-tx-size-limit, r=str4d
...
Raise 100kB transaction size limit from Sapling activation
Closes #2864 .
2018-05-07 02:20:42 -07:00
Homu
8ef1d333b5
Auto merge of #2894 - per-gron:dont-export-unless-needed, r=str4d
...
Make some globals static that can be
I wrote this patch as part of making a Bazel build system but it really is independent from that so I'm putting this as a separate PR.
External linkage does not help and just encourages sloppy dependencies (ie using symbols only declared in a cpp file in some other cpp file) and can lead to weird issues when there are name collisions.
2018-05-04 15:05:43 -07:00
Jack Grigg
e1dbec49b7
Add test of Sapling transaction size boundary
2018-05-04 11:17:30 +01:00
Jack Grigg
892ae945f7
Rework z_sendmany z-address recipient limit
...
From Sapling, the z-address recipients could require either JSDescriptions or
OutputDescriptions. Instead of trying to give an exact number in the help text,
rely on transaction size estimation to guide user behaviour.
2018-05-04 11:17:30 +01:00
Jack Grigg
25fee3509a
Rename MAX_TX_SIZE to MAX_TX_SIZE_AFTER_SAPLING
2018-05-04 11:17:30 +01:00
Jack Grigg
ddcee7e13a
Benchmark the largest valid Sapling transaction in validatelargetx
...
11130 inputs results in a transaction between 1992301 and 2003431 bytes.
2018-05-04 11:17:30 +01:00
Jack Grigg
15ec5525e3
Raise 100kB transaction size limit from Sapling activation
...
Closes #2864 .
2018-05-04 11:17:30 +01:00
Jack Grigg
768cd14cf9
Add missing include guard
...
Extracted from bitcoin/bitcoin#12757
- Commit 8fd6af89a0c061d79bb3fd2ba704b61dcc2e9211
2018-05-04 10:37:14 +01:00
Pieter Wuille
488d43dd8f
Convert base58_tests from type/payload to scriptPubKey comparison
2018-05-04 10:27:11 +01:00
Pieter Wuille
10e5357e8b
Import Bech32 C++ reference code & tests
...
This includes a reformatted version of the Bech32 reference code
(see https://github.com/sipa/bech32/tree/master/ref/c%2B%2B ), with
extra documentation.
2018-05-04 10:27:11 +01:00
MarcoFalke
57be66d30e
[test] Remove unused code
...
Zcash: left createArgs() as we still have rpc_wallet_tests which uses it.
2018-05-04 10:27:11 +01:00
Homu
d97bfb766b
Auto merge of #3228 - str4d:3058-taddr-encoding-refactor, r=str4d
...
Refactor t-address encoding
Includes code cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#11117
- bitcoin/bitcoin#11259
- Only the second commit (first is for QT code)
- bitcoin/bitcoin#11167
- Only the first commit (the rest are not part of the t-address encoding refactor).
Part of #3058 . Precursor to #3202 .
2018-05-03 18:12:22 -07:00
Homu
2d1a3cf8f5
Auto merge of #3183 - bitcartel:least_authority_issue_d, r=str4d
...
Closes #3182 - Least Authority Issue D
Prevent undefined behaviour when null pointer is passed in as parameter to function
Includes a backport of bitcoin/bitcoin#10250 .
2018-05-03 16:39:10 -07:00
Homu
c7f5d5ce1c
Auto merge of #3227 - str4d:3191-nullifier-macos-fix, r=str4d
...
Fix -Wstring-plus-int warning on clang
2018-05-03 14:36:39 -07:00
Jack Grigg
11aa594440
Remove obsolete CreateJoinSplit and GenerateParams binaries
2018-05-03 13:18:03 +01:00
Jack Grigg
fa70084c87
Expire Overwinter transactions before the Sapling activation height
2018-05-03 12:27:56 +01:00
Jack Grigg
dc889d7f52
Update CreateNewContextualCMutableTransaction to create Sapling transactions
2018-05-03 12:02:51 +01:00
Jack Grigg
daed9ba7cc
Change JSOutPoint constructor to have js argument be uint64_t
...
Closes #3192 .
2018-05-03 10:47:22 +01:00
Pieter Wuille
c8f9c87bf1
Implement {Encode,Decode}Destination without CBitcoinAddress
2018-05-03 01:13:04 +01:00
João Barbosa
6939c994ef
Remove unused GetKeyID and IsScript methods from CBitcoinAddress
2018-05-03 01:13:04 +01:00
Pieter Wuille
56c43a36bf
Move CBitcoinAddress to base58.cpp
2018-05-03 01:13:04 +01:00
Jack Grigg
b6be3e88bb
Use CBitcoinAddress wrappers in Zcash-specific code
2018-05-03 01:13:04 +01:00
Pieter Wuille
07444da1db
Introduce wrappers around CBitcoinAddress
...
This patch removes the need for the intermediary Base58 type
CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination
function that directly operate on the conversion between strings
and CTxDestination.
2018-05-03 01:12:57 +01:00
Homu
9e5398686c
Auto merge of #3206 - bitcartel:3194_polymorphic_note_class, r=str4d
...
Update note classes to be polymorphic
Closes #3194 . Lays foundation for introduction of Sapling notes through refactoring and creation of a class hierarchy for Sprout notes. This PR updates some tests, but otherwise is a no-op.
2018-05-02 08:07:35 -07:00
Homu
53fa6f1315
Auto merge of #3179 - bitcartel:backport_transaction_details_in_getblock_v2bitcartel, r=str4d
...
Add improvements to getblock RPC output
Includes and supercedes #3095 . Includes code cherry-picked from bitcoin/bitcoin#8704 .
2018-05-01 10:19:10 -07:00
Homu
0a8d0c25e8
Auto merge of #3220 - Eirik0:3209-fix-CheckTransaction, r=str4d
...
Implement consensus rules about the number of Spend and Output Descriptions in a transaction
Closes #3209 .
Part of #3065 .
2018-05-01 07:09:52 -07:00
Jack Grigg
1f9dfbb9f0
Fix -Wstring-plus-int warning on clang
2018-05-01 14:55:47 +01:00
Homu
90304c4214
Auto merge of #3213 - str4d:3202-precursor, r=str4d
...
Upstream encoding cleanups
Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7922
- bitcoin/bitcoin#7825
- bitcoin/bitcoin#8317
- bitcoin/bitcoin#9804
- Only the commit that changed `base58.cpp`
Precursor to #3202 .
2018-05-01 05:22:38 -07:00
Homu
23f8b30c88
Auto merge of #3193 - str4d:b9856-badalloc-terminate, r=bitcartel
...
Terminate immediately when allocation fails
Backport of bitcoin/bitcoin#9856
Closes #1498 .
2018-05-01 02:09:51 -07:00
Simon
54a872f0fa
Fix undefined behaviour, calling memcpy with NULL pointer.
...
Identified as part of audit: Least Authority, Issue D.
2018-04-30 16:41:02 -07:00
Simon
9bd8f092c6
Closes #3178 by adding verbosity level improvements to getblock RPC.
...
This is a follow-up commit for d0a1d833520d120bb5a2ac4cf4192047af6afe24
found in PR #3095 in order to fix nits and add a test.
2018-04-30 11:51:59 -07:00
Simon
bf911b3038
Tweaks to d0a1d83 to complete backport of Bitcoin PR #8704
2018-04-30 09:55:30 -07:00
Peter Pratscher
eb78a45a0c
Backported Bitcoin PR #8704 to optionally return full tx details in the getblock rpc call
2018-04-30 09:55:30 -07:00
Marshall Gaucher
b300118002
Merge pull request #2813 from str4d/2074-uacomment
...
Implement uacomment config parameter
2018-04-30 09:12:38 -06:00
Simon
debf6af9f8
Move memo member varible from SproutNotePlaintext to BaseNotePlaintext.
...
Add memo() accessor to BaseNotePlaintext.
2018-04-26 15:05:30 -07:00
Simon
d266f40393
Create class hierarchy for SproutNotePlaintext.
...
BaseNotePlaintext contains member variable for common attribute, value.
2018-04-26 15:05:30 -07:00