Commit Graph
100 Commits
Author SHA1 Message Date
Jack Grigg 26948eb24b Update payment-api.md with type field of z_validateaddress 2018-07-12 22:14:14 +01:00
Jack Grigg bea879157c Add Sapling support to z_validateaddress 2018-07-09 15:38:07 +01:00
Jack Grigg 3af4633b4b Add hashFinalSaplingRoot to getblockheader and getblock output 2018-06-15 13:59:28 +12: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 74c2f88023 Add release notes for -disabledeprecation removal 2018-06-11 10:41:01 -07:00
Jack Grigg c74ab3356a Remove config option -disabledeprecation
Closes #2943.
2018-06-11 10:38:12 -07:00
Jack Grigg 341a22ad90 Skip ELF-only sec-hard checks on non-ELF binaries 2018-06-07 18:49:15 +12: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 5e38c24c1d Add Mach-O 64-bit detection to security-check.py
Fixes sec-hard test on MacOS CI worker. At some point we can extend this with
actual security hardening checks.
2018-06-07 17:49:01 +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
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
Jack Grigg 4fb3d05ce9 Whitespace cleanup 2018-06-07 14:35:56 +12:00
Jack Grigg c7e64754dc Add MacOS support to no-dot-so test 2018-06-05 22:32:13 +12:00
Jack Grigg a6bbb26e08 Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
Jack Grigg d670db7164 Sapling testnet activation height 2018-05-25 16:05:25 +12:00
Jack Grigg 10faedf758 make-release.py: Updated release notes and changelog for 1.1.1. 2018-05-25 15:49:34 +12:00
Jack Grigg 4ddd873d61 make-release.py: Updated manpages for 1.1.1. 2018-05-25 15:49:33 +12:00
Jack Grigg 40c33db2f4 make-release.py: Versioning changes for 1.1.1. 2018-05-25 15:38:43 +12:00
Jack Grigg bb838a0847 Add Sapling details to release notes 2018-05-23 11:27:13 +12:00
Jack Grigg 6d7ed43a73 Comment out Gitian library handling while we don't build any libraries
Fixes a Gitian build failure introduced by #3153.
2018-05-22 18:37:47 +12:00
Jack Grigg d03ae3e520 make-release.py: Updated release notes and changelog for 1.1.1-rc1. 2018-05-19 10:16:15 +12:00
Jack Grigg 062afe397b make-release.py: Updated manpages for 1.1.1-rc1. 2018-05-19 10:16:14 +12:00
Jack Grigg 8bf890abac make-release.py: Versioning changes for 1.1.1-rc1. 2018-05-19 09:50:15 +12:00
Jack Grigg f55029e7d1 Correctly serialize Groth16 JSDescription for verifyjoinsplit benchmark 2018-05-14 16:29:02 -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
Jack Grigg 0fe0ca7948 Add contextual comment for GetValueOut() and GetShieldedValueIn() 2018-05-10 09:34:19 -04: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
Jack Grigg 93bd00a0d5 Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +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
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
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
Jack Grigg e1d41f21f3 Update tests for CreateNewContextualCMutableTransaction changes 2018-05-07 20:21:55 +01: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
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
Jack Grigg b6be3e88bb Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +01:00
Jack Grigg 2c34c1cbff Update mempool_nu_activation RPC test to exercise both Overwinter and Sapling
Closes #3199.
2018-05-03 01:07:41 +01:00
Jack Grigg 1f9dfbb9f0 Fix -Wstring-plus-int warning on clang 2018-05-01 14:55:47 +01:00
Jack Grigg aeb089ecc7 Attempt to log before terminating if prevector allocation fails 2018-04-26 11:30:33 +01:00
Jack Grigg 3c9dbf3ed8 Improve best-effort logging before termination on OOM
Suggested by @kallewoof in bitcoin/bitcoin#9856
2018-04-26 11:22:07 +01:00
Jack Grigg bf605b2644 Return result of boost::apply_visitor
Not returning a value at the end of a non-void function is undefined behaviour.
Given that this managed to pass our full test suite, I guess that GCC looks for
un-returned values at the end of a function and uses them as the return value,
if the keyword is missing. Clang OTOH complains, which is how we spotted this:
https://ci.z.cash/#/builders/16/builds/282
2018-04-24 23:04:09 +01:00
Jack Grigg b1608eed82 Add a constant for Overwinter's transaction version 2018-04-23 20:39:04 +01:00
Jack GriggandGeorge Tankersley b4f7174a88 Implement SpendDescription and OutputDescription datastructures
Co-authored-by: George Tankersley <george@z.cash>
2018-04-23 20:39:00 +01:00
Jack Grigg 22ffe8ce44 Remove now-unshadowed serialization lines that do nothing
Previously we had both nVersion as a class parameter *and* a serialization
argument, and in several inherited serializers the latter was set to the former,
in order to pass the serialized object's version into underlying parsers. #3180
pulled in the upstream changes to clean this up, and in doing so these lines
became no-ops - setting the class parameter to itself. Clang throws warnings on
this, which turn into errors on the MacOS builder.

We can just remove these, because upstream already had done so in earlier PRs,
indicating that they were not being relied on by underlying parsers.
2018-04-20 09:48:33 +01:00
Jack Grigg 2d922b66b0 Pass transaction header into correct SignatureHash serialization level
We need to indicate whether PHGR or Groth proofs are expected to vjoinsplit,
which is serialized in an inner hash, not the outer hash.
2018-04-19 20:35:33 +01:00
Jack Grigg 72540cee4a Add Sapling v4 transactions to IsStandard 2018-04-19 16:25:04 +01:00
Jack Grigg b7e75b17af Implement basic Sapling v4 transaction parser
Details of Sapling datatypes will be filled in later; for now, they are treated
as binary blobs.

Includes code cherry-picked from upstream commit:
    7030d9eb47254499bba14f1c00abc6bf493efd91
    BIP144: Serialization, hashes, relay (sender side)
2018-04-19 05:01:47 +01:00
Jack Grigg 987b8ee60e Adjust consensus rules to require v4 transactions from Sapling activation 2018-04-19 05:01:47 +01:00
Jack Grigg 68a1a592ca Remove nType and nVersion from Zcash-specific code 2018-04-17 13:09:47 +01:00
Jack Grigg a8e5ae92ba GetSerializeSize changes in Zcash-specific code 2018-04-16 07:38:38 -06:00
Jack Grigg d2fb34fb7c Handle usage of prevector for CScript in Zcash-specific code 2018-04-16 07:38:36 -06:00
Jack Grigg ee6220c0ed [Bitcoin-Tx] Adjust util-test test cases for Zcash 2018-04-12 19:36:48 -06:00
Jack Grigg abf5dd31af Add static asserts to ensure CONTINUE_EXECUTION doesn't collide 2018-04-12 18:11:46 -06:00
Jack Grigg 176fada24d Add Sapling to upgrade list 2018-04-12 12:13:05 -06:00
Jack Grigg 39ee63c876 When rewinding, reset pindexBestInvalid if it is pointing to a removed block 2018-04-11 21:46:58 -06:00
Jack Grigg 4d234cd2f8 Overwinter mainnet activation height 2018-04-11 20:21:45 -06:00
Jack Grigg 2141de16e8 make-release.py: Updated release notes and changelog for 1.1.0. 2018-04-11 20:15:29 -06:00
Jack Grigg 145ee79099 make-release.py: Updated manpages for 1.1.0. 2018-04-11 20:15:13 -06:00
Jack Grigg f64c346eca make-release.py: Versioning changes for 1.1.0. 2018-04-11 20:02:10 -06:00
Jack Grigg a560c24d6b depends: Update to latest librustzcash with sapling-crypto dependencies 2018-04-11 08:06:40 -06:00
Jack Grigg c63c9f20e4 depends: Add support for unpackaged Rust crates 2018-04-11 08:00:23 -06:00
Jack Grigg b123b9bb79 depends: Upgrade Rust to 1.26.0-beta.3 2018-04-11 07:59:46 -06:00
Jack Grigg 47fe5f72f4 Disable building libzcashconsensus by default
The library is not currently a supported build artifact; it needs work in
order to build on certain platforms (e.g. MacOS), and its dependencies need to
be narrowed down (Equihash is not a requirement for validating scripts).
2018-04-06 15:09:50 +01:00
Jack Grigg ecf544d062 Set Overwinter protocol version to 170005
170004 is the protocol version for the NODE_BLOOM change, which is being
"released" in this RC. The activation height is being set in the final release,
which means that we may end up with both RC and final release versions online
when Overwinter activates. Bumping the protocol version for Overwinter enables
RC nodes to be correctly disconnected.
2018-04-05 12:07:44 +01:00
Jack Grigg 776b494aec make-release.py: Updated release notes and changelog for 1.1.0-rc1. 2018-04-05 03:26:17 +01:00
Jack Grigg 13d491c7bf make-release.py: Updated manpages for 1.1.0-rc1. 2018-04-05 03:26:07 +01:00
Jack Grigg 5e11533408 make-release.py: Versioning changes for 1.1.0-rc1. 2018-04-05 03:08:20 +01:00
Jack Grigg 3fe2f3d143 Update -enforcenodebloom RPC test with filterclear vs filteradd 2018-04-05 01:30:38 +01:00
Jack Grigg 2b7fcab8fc Move bloom filter filtering logic back into command "switch" 2018-04-05 01:30:38 +01:00
Jack Grigg 0a284ecaf6 Fix NODE_BLOOM documentation errors 2018-04-05 01:30:38 +01:00
Jack Grigg b77e46fe01 Add RPC test for -enforcenodebloom 2018-04-05 01:30:38 +01:00
Jack Grigg 10e97b8f00 test: Add missing Overwinter fields to mininode's CTransaction 2018-04-04 22:49:49 +01:00
Jack Grigg 8a22734ec1 test: Check return value of snprintf 2018-04-04 19:18:23 +01:00
Jack Grigg 162cc4240e Fix typo 2018-04-04 14:59:07 +01:00
Jack Grigg 2d7bae5b33 Update CBlockTreeDB::EraseBatchSync for dbwrapper refactor 2018-04-03 21:38:34 +01:00
Jack Grigg 26cdb83add Update blockchain.py RPC test for Zcash 2018-04-03 20:40:54 +01:00
Jack Grigg 3a8e1d0cf4 Refactor Zcash changes to CCoinsViewDB
To match upstream changes.
2018-04-03 20:40:54 +01:00
Jack Grigg 6c44424322 Adjust deprecation message to work in both UI and -alertnotify 2018-04-03 12:17:30 +01:00
Jack Grigg f5007d8912 When rewinding, remove insufficiently-validated blocks
If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).
2018-04-03 10:58:31 +01:00
Jack Grigg fe87fd2b36 Add RPC test of RewindBlockIndex 2018-04-03 10:58:27 +01:00
Jack Grigg 28915c30ca Fix z_importviewingkey startHeight parameter
Closes #2937.
2018-04-03 02:43:52 +01:00
Jack Grigg 0e400c8854 depends: Fix regex bugs in cargo-checksum.sh 2018-03-30 19:06:51 +01:00
Jack Grigg 9666cc912a Test calling z_mergetoaddress to merge notes while a note merge is ongoing 2018-03-29 15:38:26 -06:00