Jack Grigg
262cf38712
Build librustzcash package without changing directory
...
This ensures that the depends system's custom PATH is applied correctly,
and the pre-build Rust binaries are accessible.
2018-10-28 06:41:53 +13:00
Jack Grigg
ee3fa7020e
Pass parameter paths as native strings to librustzcash
2018-10-27 19:19:02 +13:00
Jack Grigg
eff2938e46
Migrate to current librustzcash
...
The only upstream change relative to the previous commit is that the
various Zcash-specific dependencies have been pulled into a cargo
workspace. The dependecies in the workspace use the same commits as the
crates we had previously vendored.
The patches are necessary to handle the fact that cargo requires that
dev dependencies are available even if not used, and we would otherwise
need to vendor all the underlying crates.
2018-10-27 17:03:47 +13:00
Jack Grigg
5513faccf6
Ignore decoding errors during -zapwallettxes
...
The undecoded wallet transaction is logged before proceeding, so later
recovery of metadata might be possible. But the fact that the user is
using -zapwallettxes is a clear indicator that they want
transactions removed from their wallet, so this is the priority.
2018-10-06 12:18:56 +01:00
Jack Grigg
3e471410f1
Persist Sapling payment address to IVK map
...
This ensures we remember any diversified addresses manually generated
outside the wallet.
2018-10-06 00:45:39 +01:00
Jack Grigg
1b79de781c
Store ExtFVK with encrypted Sapling spending key instead of FVK
...
This ensures that even when the wallet is encrypted, we can derive the default
Sapling payment address for our spending keys.
2018-10-05 23:13:32 +01:00
Jack Grigg
089ec92e7b
Fix pyflakes warnings
2018-10-05 11:32:22 +01:00
Jack Grigg
2b47b0de7d
Position PoW.MinDifficultyRules test after rule activates
2018-10-05 00:10:17 +01:00
Jack Grigg
4c90270469
Explicitly check the min-difficulty flag against boost::none
...
It isn't clear how a boost::optional that holds 0 (which is the case for
regtest) is coerced to a boolean, unless you pore over the Boost
documentation. An explicit check is clearer.
2018-10-04 23:29:11 +01:00
Jack Grigg
1f7ee4af70
Rename min-difficulty flag to remove off-by-one in the name
2018-10-04 23:26:05 +01:00
Jack Grigg
f09aae037c
Update wallet_listreceived test for now-correct empty Sapling memos
2018-10-04 22:46:15 +01:00
Jack Grigg
b86dc98047
Only enable min-difficulty blocks on testnet from a particular height
...
The min-difficulty change is a bilateral consensus rule change, and so
must be conditionally enabled in order for the earlier section of the
chain to synchronise.
Technically this could be implemented as a network upgrade, but as this will
never be deployed to mainnet, a targeted fork will suffice.
2018-10-04 14:05:27 +01:00
Jack Grigg
1702a86455
Allow minimum-difficulty blocks on testnet and regtest
...
A block may be mined with nBits set to the minimum difficulty if its
nTime is set more than six block intervals (15 minutes) after its parent
block.
This is a consensus rule change on testnet that will result in a chain
split (as desired).
2018-10-03 17:50:17 +01:00
Jack Grigg
639e46b4d7
Revert "Remove testnet-only difficulty rules"
...
This reverts commit 333ea3c426 .
2018-10-03 16:15:03 +01:00
Jack Grigg
5ead4b1713
Revert "Get rid of consensus.fPowAllowMinDifficultyBlocks."
...
This reverts commit dffc025d38 .
2018-10-03 16:08:00 +01:00
Jack Grigg
5f91a95641
Add Sapling support to z_shieldcoinbase
...
Part of #3216 .
2018-10-03 12:16:18 +01:00
Jack Grigg
ba63dacbbb
Use the correct empty memo for Sapling outputs
2018-10-03 12:14:50 +01:00
Jack Grigg
34e222c18e
Revert "Disable Sapling features on mainnet"
...
This reverts commit 554e00e8f9 .
2018-09-21 23:43:31 +01:00
Jack Grigg
bb4b6982e3
Generate an ovk to encrypt outCiphertext for t-addr senders
...
Closes #3506 .
2018-09-19 00:51:30 +01:00
Jack Grigg
bd3c860cb4
Use ovk directly in the TransactionBuilder API instead of fvk
2018-09-18 23:26:31 +01:00
Jack Grigg
8e057ad9ee
qa: Test both Overwinter and Sapling peer management
2018-09-12 12:15:37 +01:00
Jack Grigg
c861137624
net: Check against the current epoch's version when disconnecting peers
2018-09-12 10:17:33 +01:00
Jack Grigg
feee210af6
net: Check against the next epoch's version when evicting peers
2018-09-12 10:10:22 +01:00
Jack Grigg
07d3f947ec
Extract a helper method for finding the next epoch
2018-09-12 10:07:44 +01:00
Jack Grigg
ebf4c0671e
net: Check against the current epoch's version when rejecting nodes
2018-09-12 09:27:28 +01:00
Jack Grigg
94549326c9
Bugfix: Use time instead of block height for Sapling key metadata
2018-09-11 12:45:25 +01:00
Jack Grigg
b33a7ec46e
wallet: Don't allow an HDSeed to be overwritten
...
We can maybe relax this restriction later once we have worked out the UX
implications.
2018-09-03 10:45:37 +01:00
Jack Grigg
4c1a26fb60
Add ZIP 32 usage to release notes
2018-09-03 10:45:37 +01:00
Jack Grigg
b7f9a7ae02
wallet: Comment out HDSeed and CHDChain persistence to disk
...
Sapling keys generated from the seed are not yet persisted, so we don't
want to persist the seed or chain state either, otherwise the wallet
could end up in an inconsistent state.
Some tests are temporarily disabled because commenting out HDSeed
persistence breaks invariants inside CCryptoKeyStore.
Revert this commit during the PR for #3388 .
2018-09-03 10:45:37 +01:00
Jack Grigg
c58dae6cda
init: Generate a new HD seed on startup
2018-09-03 10:45:37 +01:00
Jack Grigg
70b4ad2dcd
wallet: Switch from SaplingSpendingKey to SaplingExtendedSpendingKey
...
The wallet now only stores Sapling extended spending keys, and thus can
only be used with keys generated from an HDSeed via ZIP 32.
Note that not all Sapling keys in the wallet will correspond to the
wallet's HDSeed, as a standalone Sapling xsk can be imported via
z_importkey. However, it must have been generated from a seed itself,
and thus is more likely to be backed up elsewhere.
2018-09-03 10:45:37 +01:00
Jack Grigg
a4ac4fc3f4
wallet: Store Sapling key metadata indexed by ivk
...
Closes #3426 .
2018-09-03 10:45:37 +01:00
Jack Grigg
e2416930ea
wallet: Store HDSeed and chain data
2018-09-03 10:45:37 +01:00
Jack Grigg
ec653523ad
Store HDSeed in CCryptoKeyStore
2018-09-03 10:45:33 +01:00
Jack Grigg
70c8c25e4b
Store HDSeed in CBasicKeyStore
2018-09-03 10:27:52 +01:00
Jack Grigg
7614198f9d
ZIP 32 Sapling structs
2018-09-03 10:27:52 +01:00
Jack Grigg
f8d65e8f03
Update librustzcash with ZIP 32 APIs
2018-09-03 10:27:52 +01:00
Jack Grigg
af04224522
Fix file permissions of wallet_sapling RPC test
2018-09-03 08:27:33 +01:00
Jack Grigg
0f436a0a26
Fix RPC test that checks exact wording of cleaned-up error message
2018-09-03 08:23:09 +01:00
Jack Grigg
7c02acc5b6
Minor cleanups
2018-09-03 01:28:31 +01:00
Jack Grigg
1ec06e93b1
Rename z_inputs_ to z_sprout_inputs_
2018-09-03 01:13:18 +01:00
Jack Grigg
e47ccf2a00
libsnark: Use format macro constants for printing fixed-width values
2018-08-30 22:21:25 +01:00
Jack Grigg
c53defda9d
libsnark: Force constants used in test comparisons to be unsigned
2018-08-30 21:37:10 +01:00
Jack Grigg
2962a72e35
Rename GetFirstBlockTransaction() to GetFirstBlockCoinbaseTx()
2018-08-30 14:58:19 +01:00
Jack Grigg
d7bcbfaee4
Fix test after refactor to check bacd-cb-height rule on a genesis block
2018-08-30 14:50:57 +01:00
Jack Grigg
fb22b3bbd8
Revert NU activation heights in reverse order
...
Ensures that global state remains consistent.
2018-08-30 14:44:50 +01:00
Jack Grigg
d70d103ee0
Ensure SCOPED_TRACE falls out of scope when necessary
2018-08-30 14:41:56 +01:00
Jack Grigg
07d85a6455
Define additional booleans for readability
2018-08-30 09:42:21 +01:00
Jack Grigg
e54c4d2ca1
rpcwallet: Add Sapling support to z_sendmany
2018-08-27 11:36:14 +01:00
Jack Grigg
af4057b904
rpcwallet: Prevent use of both Sprout and Sapling addresses in z_sendmany
2018-08-27 11:13:49 +01:00
Jack Grigg
36e2141d92
rpcwallet: Add TransactionBuilder argument to AsyncRPCOperation_sendmany
2018-08-27 11:13:49 +01:00
Jack Grigg
81e0fd2eb9
wallet: Add HaveSpendingKeyForPaymentAddress visitor
2018-08-27 11:13:49 +01:00
Jack Grigg
e22c115e78
Move GetSpendingKeyForPaymentAddress visitor into wallet.h
...
Also fixes it to not use the global pwalletMain.
2018-08-27 11:13:49 +01:00
Jack Grigg
573de712ab
rpc: Clarify ivk balance issues in help text
2018-08-25 01:09:12 +01:00
Jack Grigg
d316992f55
rpc: Clarify Sprout shielded addresses in help text
2018-08-22 12:33:30 +01:00
Jack Grigg
6c6ed24310
libsnark: Fix stale comment
2018-08-21 18:06:23 +01:00
Jack Grigg
8b3d0ef4e3
libsnark: Use mp_limb_t cast instead of uint64_t when masking bigint.data
2018-08-21 18:05:14 +01:00
Jack Grigg
fa92a21a40
libsnark: Adjust SHA256 K value type to match the constant
...
When used, it is cast to an integer_coeff_t, which is currently a long.
On LP64 systems, this cast is lossless. Issues with LLP64 systems will
be addressed later.
2018-08-21 18:04:50 +01:00
Jack Grigg
831b6af932
Metrics UI: Fall back to 80 cols if GetConsoleScreenBufferInfo() fails
2018-08-21 16:54:40 +01:00
Jack Grigg and Sean Bowe
053cb3497d
Add Sapling support to z_getbalance and z_gettotalbalance
...
Closes #3214
Co-authored-by: Sean Bowe <ewillbefull@gmail.com >
2018-08-20 11:35:06 +01:00
Jack Grigg and Sean Bowe
94e99acda6
Add Sapling support to GetFilteredNotes() and GetUnspentFilteredNotes()
...
This could in future be refactored to be generic over PaymentAddress and
NotePlaintext in the return type, but for now let's be explicit about which
returned notes are for Sprout vs Sapling, and handle them separately.
Co-authored-by: Sean Bowe <ewillbefull@gmail.com >
2018-08-20 11:34:54 +01:00
Jack Grigg
c9339bb61f
test: Fix comment in WalletTests.FindMySaplingNotes
2018-08-17 21:39:16 +01:00
Jack Grigg
bce692390f
configure: Don't add -ldl to RUST_LIBS for mingw32
2018-08-17 18:54:04 +01:00
Jack Grigg
7d65dcf4d9
depends: Pass correct compiler, linker, and flags into googletest
2018-08-17 16:47:03 +01:00
Jack Grigg
2456eb80ae
Metrics UI: Tell Windows users how to stop zcashd
...
Ctrl+C is not configured for Windows, as it does not work (yet):
https://github.com/Microsoft/vscode/issues/9347
https://github.com/Microsoft/console/issues/57
2018-08-17 16:46:41 +01:00
Jack Grigg
8fa09c244a
Metrics UI: Enable virtual terminal sequence processing on Windows
...
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
2018-08-17 16:46:29 +01:00
Jack Grigg
c5b26acad8
Use boost::filesystem::path::string() instead of path::native()
...
This fixes a mingw32 conversion error during cross-compilation.
2018-08-17 16:46:18 +01:00
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 Grigg and David 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 Grigg and David 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