Commit Graph
100 Commits
Author SHA1 Message Date
Jack Grigg 1dae6e9336 Pass correct compiler, linker, and flags into libsnark 2018-08-17 16:45:55 +01:00
Jack Grigg f2d3715727 zcutil/build.sh: Remove --enable-werror from default configuration
Windows cross-compile has currently-unavoidable warnings. Upstream Bitcoin Core
has them as well. For now, let's remove this from the default configuration, and
add it to the Linux and OSX CI builders (so we effectively still enforce it for
merged PRs).
2018-08-17 16:45:32 +01:00
Jack Grigg 03ea5a8122 zcutil/build.sh: Use config.site to set default ./configure settings
This is a more reliable way to configure the depends path (matching what is done
upstream), and frees up --prefix for user configuration.
2018-08-17 16:45:28 +01:00
Jack Grigg d10a762fb8 Clean up libzcash CPPFLAGS, CXXFLAGS, and LDFLAGS
By using the flags defined through ./configure instead, libzcash will react to
configuration and build system changes (such as PIC_FLAGS being empty for
Windows builds).
2018-08-17 16:44:05 +01:00
Jack Grigg 283ad96e85 Use -O1 for darwin and mingw32 release builds
In 46ad3c2758 we standardised our linux builds to
use -O1, but we didn't adjust the other targets.
2018-08-17 16:44:00 +01:00
Jack GriggandDavid Mercer ceca40d68f Measure Windows console size for metrics UI
Co-authored-by: David Mercer <radix42@gmail.com>
2018-08-17 16:43:43 +01:00
Jack Grigg 8d45f6e4e2 configure: Don't require RELRO and BIND_NOW when cross-compiling
mingw-w64's ld (at least mingw-w64 4.0.4-2) appears to not support -z
2018-08-17 16:43:20 +01:00
Jack Grigg b057754005 zcutil/build.sh: Use $HOST to specify the depends prefix 2018-08-17 16:43:06 +01:00
Jack GriggandDavid Mercer 3d308c2232 depends: Fix BDB naming issue when cross-compiling
Co-authored-by: David Mercer <radix42@gmail.com>
2018-08-17 16:42:35 +01:00
Jack Grigg f77650a6ac depends: Configure librustzcash for cross-compiling 2018-08-17 16:41:51 +01:00
Jack Grigg b57e4484ef depends: Correctly configure Rust when cross-compiling 2018-08-17 16:41:40 +01:00
Jack Grigg 554e00e8f9 Disable Sapling features on mainnet
Also places them behind an experimental features flag on testnet
2018-08-13 14:18:18 +01:00
Jack Grigg dfcf33fe15 test: Use regtest in key_tests/zs_address_test 2018-08-13 14:17:17 +01:00
Jack Grigg e7ca4eb3c3 test: gtest for Sapling encoding and decoding 2018-08-13 13:20:07 +01:00
Jack Grigg 13751895c7 Move RewindBlockIndex log message inside rewindLength check 2018-08-08 12:08:29 +01:00
Jack Grigg d0372cff5e Adjust Makefile so that common can be used by the wallet 2018-08-05 10:41:06 +01:00
Jack Grigg e188723823 Upgrade Rust to 1.28.0 stable 2018-08-05 10:41:06 +01:00
Jack Grigg 0ecdd0f30a chainparams: Add BIP 44 coin type (as registered in SLIP 44) 2018-08-05 10:41:06 +01:00
Jack Grigg 25d5e80cbe Rename *SpendingKey -> *SproutSpendingKey
Also GetPaymentAddresses -> GetSproutPaymentAddresses
2018-08-03 10:10:26 +01:00
Jack Grigg f84cf5f817 Formatting nits 2018-08-03 02:25:51 +01:00
Jack Grigg 4c77517772 Rename *ViewingKey* -> *SproutViewingKey* 2018-08-03 02:23:38 +01:00
Jack Grigg 74f5b010df Rename Serialized*Size -> SerializedSprout*Size 2018-08-03 01:57:40 +01:00
Jack Grigg 93fcf892d4 Rename SpendingKeyMap -> SproutSpendingKeyMap 2018-08-03 01:47:30 +01:00
Jack Grigg 5175a7f07b Pass SaplingPaymentAddress to store through the CKeyStore 2018-08-03 01:01:45 +01:00
Jack Grigg bc6344b350 Add CWallet::AddCryptedSaplingSpendingKey() hook
To be filled in when we implement Sapling persistence to disk.
2018-08-03 00:23:08 +01:00
Jack Grigg 9c9258c4f8 Remove outdated comment 2018-08-03 00:23:08 +01:00
Jack Grigg 4a89221ffc Check for unencrypted Sapling keys in CCryptoKeyStore::SetCrypted() 2018-08-03 00:23:08 +01:00
Jack Grigg 0adba6789b Add Sapling decryption check to CCryptoKeyStore::Unlock() 2018-08-03 00:23:08 +01:00
Jack Grigg e8a949c153 Rename CryptedSpendingKeyMap -> CryptedSproutSpendingKeyMap 2018-08-03 00:23:08 +01:00
Jack Grigg adf2eadba2 Rename DecryptSpendingKey -> DecryptSproutSpendingKey 2018-08-03 00:23:08 +01:00
Jack Grigg 40dc060cb0 test: Update rpc_wallet_z_importexport to account for Sapling changes 2018-08-01 19:59:57 +01:00
Jack Grigg 4aabeebc1f test: Fix permissions of wallet_addresses 2018-08-01 19:56:01 +01:00
Jack Grigg 4fab49e173 test: Another assert in wallet_zkeys_tests.store_and_load_sapling_zkeys 2018-08-01 09:46:32 +01:00
Jack Grigg d75e69da5a test: Deduplicate logic in wallet_addresses RPC test 2018-08-01 09:44:31 +01:00
Jack Grigg fbd029d99d Formatting 2018-07-31 23:28:42 +01:00
Jack Grigg 3f4ad5967b Fix block hash for checkpoint at height 270000 2018-07-30 17:45:04 +01:00
Jack Grigg eec85c4388 Add Sapling support to z_getnewaddress and z_listaddresses 2018-07-30 16:24:20 +01:00
Jack Grigg 281b51e567 Raise the 90-character limit on Bech32 encodings
Regtest addresses are 91 characters, and ZIP 32's Bech32 encoding will
be significantly longer.
2018-07-30 16:01:22 +01:00
Jack Grigg 4715b31c76 Implement CKeyStore::GetSaplingPaymentAddresses() 2018-07-30 16:01:22 +01:00
Jack Grigg 54a868cf0a Rename xsk to expsk
xsk will be used for ZIP 32 extended spending keys, so renaming here to
reduce confusion.
2018-07-30 14:26:29 +01:00
Jack Grigg a8dd4b0cf1 TransactionBuilder: Make fee configurable 2018-07-30 12:52:48 +01:00
Jack Grigg 45c0d1ec84 TransactionBuilder: Add change output to transaction 2018-07-30 12:46:18 +01:00
Jack Grigg 3466b4677e TransactionBuilder: Add support for transparent inputs and outputs 2018-07-30 11:03:29 +01:00
Jack Grigg 3fd0a269e1 test: Move ECC_Start() call into src/gtest/main.cpp 2018-07-27 17:18:49 +02:00
Jack Grigg 25bb05de23 Formatting 2018-07-27 12:17:14 +02:00
Jack Grigg e5dc5228ea TransactionBuilder: Check that all anchors in a transaction are identical
This reduces the amount of information that is leaked by the choice of anchor.
In future we will make a protocol change to enforce that all inputs use the
same anchor.
2018-07-27 09:46:38 +02:00
Jack Grigg e691e21f40 TransactionBuilder with support for creating Sapling-only transactions 2018-07-25 11:35:10 +02:00
Jack Grigg 70a7535ae8 Expose note position in IncrementalMerkleWitness 2018-07-24 14:54:07 +02:00
Jack Grigg 66a519f55d Alter SaplingNote::nullifier() to take a SaplingFullViewingKey
This means the API will work if you only have a SaplingExtendedSpendingKey,
as will be the case with ZIP 32.
2018-07-24 14:54:01 +02:00
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 ef1678bf0f Add some more checkpoints, up to the 1.1.0 release 2018-05-07 15:15:41 +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