Commit Graph

15805 Commits

Author SHA1 Message Date
Sean Bowe bd137561f2
wallet: add logging for failure cases in unified cache loading 2022-03-02 16:24:08 -07:00
Sean Bowe c5b87ba163
wallet: rather than assert, error in case of inconsistency between FVK and address 2022-03-02 11:05:04 -07:00
Sean Bowe 3665f69a48
wallet: restore orchard address to IVK mappings during wallet loading 2022-03-02 08:11:47 -07:00
Sean Bowe f7824e8cec
wallet: restore Orchard secret keys from mnemonic seed 2022-03-02 08:11:47 -07:00
Sean Bowe 49ce03ed79
wallet: consolidate unified key/address/account map reconstruction 2022-03-02 08:11:47 -07:00
Kris Nuttycombe 68d6c3ddc3
Merge pull request #5615 from nuttycom/feature/wallet_orchard-merge_master
Merge master back to feature/wallet_orchard
2022-03-01 19:57:39 -07:00
Kris Nuttycombe 1389eea5c2
Merge pull request #5614 from nuttycom/feature/wallet_orchard-fix_orchard_minconf
Filter returned Orchard notes by minimum confirmations.
2022-03-01 19:57:05 -07:00
Kris Nuttycombe 783e269a7b Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-01 16:54:05 -07:00
Kris Nuttycombe bd50fbbb94 Filter returned Orchard notes by minimum confirmations. 2022-03-01 16:30:29 -07:00
Kris Nuttycombe 18f443db1c
Merge pull request #5604 from nuttycom/fix_missing_wallet_lock
GenerateNewKey must be guarded by a cs_wallet lock
2022-02-27 09:20:44 -07:00
Kris Nuttycombe 399ffa7f5c GenerateNewKey must be guarded by a cs_wallet lock 2022-02-26 20:13:38 -07:00
Kris Nuttycombe f9380572c1
Merge pull request #5597 from nuttycom/feature/wallet_orchard-find_spendable_inputs
Select Orchard notes in FindSpendableInputs
2022-02-25 08:36:19 -07:00
Kris Nuttycombe 044d2de463
Merge pull request #5596 from str4d/feature/wallet_orchard-orchard_sendmany
z_sendmany: Send to Orchard receivers of UA recipients
2022-02-25 08:27:02 -07:00
Kris Nuttycombe 41ed311afa
Merge pull request #5595 from str4d/feature/wallet_orchard-ua_updates
Merge current master into Orchard wallet feature branch
2022-02-24 21:42:13 -07:00
Kris Nuttycombe d9cddac773 Select Orchard notes in FindSpendableInputs 2022-02-24 18:16:53 -07:00
Jack Grigg 701a7875a7 Regenerate `TxDigests` after rebuilding tx with Orchard bundle
In zcash/zcash/pull/5544 we added an FFI method specific to the Orchard
part of the transaction builder, to enable passing the Orchard bundle on
the Rust side directly instead of using a partial serialization. We
passed the remainder of the transaction to the Rust side by serializing,
as we similarly do in `SignatureHash`. We then decomposed the parsed
transaction on the Rust side to insert the Orchard bundle. However, we
then used the `TxDigests` that was derived from the parsed transaction,
not the reconstructed one, which meant we produced an invalid sighash
when building Orchard-containing transactions.
2022-02-25 00:52:52 +00:00
Jack Grigg d4078c8d25 Select Orchard receivers preferentially from UAs
The addition of `OrchardRawAddress` to `RecipientAddress` drives most of
the changes in this commit, which enable `z_sendmany` to send funds to
addresses in the Orchard pool once NU5 activates.
2022-02-25 00:52:52 +00:00
Jack Grigg 85a8784b38 Fix semantic merge conflicts
- We added `OrchardRawAddress` to the `Receiver` variant, which prevents
  it from having a default constructor.
- We added `ReceiverType::Orchard`, which Clang warns is unused when we
  use `ReceiverType` in a `switch` statement.
2022-02-25 00:48:17 +00:00
Jack Grigg bb4e792c84 Merge branch 'master' into feature/wallet_orchard-orchard_sendmany 2022-02-25 00:33:28 +00:00
Taylor Hornby 7d9dda4b7e
Merge pull request #5576 from superbaud/use-debian-libtinfo
fix breakage on Arch by using Debian libtinfo5_6.0 to satisfy clang
2022-02-24 16:33:13 -07:00
str4d 48bf0241e6
Merge pull request #5586 from str4d/feature/wallet_orchard-orchard_receivers
Add Orchard to default UA receiver types
2022-02-24 15:52:31 +00:00
Steven 82c33596b9
Merge pull request #5580 from steven-ecc/update-transaction-size-estimation
Update transaction size estimation to include V5 transactions
2022-02-23 20:16:58 -08:00
Jack Grigg b0769e3f1d Add Orchard to default UA receiver types
We also add Orchard-specific information to several RPCs in order for
tests to pass:

- `z_listunifiedreceivers`
- `z_getbalanceforaccount`
- `z_getbalanceforviewingkey`
2022-02-24 02:17:52 +00:00
Jack Grigg 235fde5193 Add mappings from Orchard receivers to IVKs to the wallet
We add the Orchard change address mapping on account creation, as we
only ever generate a single change address internally. External Orchard
receivers are added to the map when `z_getaddressforaccount` is called.

This commit also fixes two bugs in the handling of Orchard internal IVKs.
When adding a full viewing key to the Orchard (Rust) wallet, we need to
derive both the internal and external IVKs (and map them to the external
FVK so we effectively never expose the internal FVK). We were only
deriving the external IVK, meaning that trying to add the Orchard change
address to the wallet should have failed. However, in a separate bug the
C++ internal IVK derivation method was calling the Rust external IVK
derivation function, meaning that we were effectively using the external
Orchard address at index 0 _as_ the change Orchard address.
2022-02-24 02:17:19 +00:00
Steven Smith a0740650c3 Update transaction size estimation to include V5 transactions 2022-02-23 16:49:01 -08:00
Kris Nuttycombe 49065bee59
Merge pull request #5569 from str4d/feature/wallet_orchard-ua_integration
Integrate Orchard into Unified Address types
2022-02-23 11:20:49 -07:00
Jack Grigg 3179e45467 Trial-decrypt candidate Sapling receivers with all wallet UFVKs
This ensures we have the same semantics for detecting Orchard and
Sapling receivers in UAs, even if the UA they are part of was derived
outside of the zcashd wallet.
2022-02-23 02:23:45 +00:00
Jack Grigg d099e469e1 Rename to `ZcashdUnifiedSpendingKey::GetSaplingKey` for consistency 2022-02-22 21:08:10 +00:00
Jack Grigg c2a47b8d97 Return UFVK from `CWallet::GenerateNewUnifiedSpendingKey`
The only place we were using the returned Unified Spending Key was in a
test, where we immediately converted it to a UFVK.

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 3c84ed604e Remove OrchardSpendingKey serialization code
Orchard spending keys now live exclusively on the Rust side, and will be
serialized there as part of the Orchard wallet serialization.
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 225c78f3ab Add Orchard components to unified spending keys
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 258f0fc72f Add Orchard components to unified full viewing keys
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-22 21:08:10 +00:00
Kris Nuttycombe bb91c9fbc3
Merge pull request #5549 from therealyingtong/cache-ua
Cache UA recipients passed to `z_sendmany`
2022-02-22 09:05:13 -07:00
sasha 2d6dcd4750 on Arch only, use Debian's libtinfo5_6.0 to satisfy clang 2022-02-21 20:28:03 -08:00
therealyingtong 1dae16a41c WriteRecipientMapping: Check that receiver exists in UA.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-22 11:53:23 +08:00
ying tong 2943e13c8b
Apply docfixes from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-22 08:44:09 +08:00
Kris Nuttycombe 1a1522a4f1 Add Orchard components to unified address
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-21 17:04:27 +00:00
Kris Nuttycombe 3e3ee1bf3b Add various bits of documentation 2022-02-19 15:29:19 +00:00
Kris Nuttycombe 98ab4bcadb
Merge pull request #5552 from nuttycom/feature/wallet_orchard-add_orchard
Add Rust backend for the Orchard components of the zcashd wallet.
2022-02-19 07:52:15 -07:00
Kris Nuttycombe 1969add228 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-18 17:45:50 -07:00
Kris Nuttycombe 66890866d6 Remove txid field from TxNotes 2022-02-18 17:07:47 -07:00
therealyingtong 108e9d4658 CSerializeRecipientAddress: add Read method and make constructor private.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-02-18 16:39:43 +08:00
therealyingtong 99a69182cd Docfixes. 2022-02-18 13:55:58 +08:00
therealyingtong 4c4ee558d6 ShieldToAddress: Factor out static shieldToAddress() helper. 2022-02-18 13:55:23 +08:00
str4d 6cd5b8792b
Merge pull request #5560 from steven-ecc/z_gettreestate_update_for_orchard
Add Orchard support to the z_gettreestate RPC
2022-02-18 03:17:05 +00:00
Kris Nuttycombe d08c992b5e Move parsing of unified addresses to UnifiedAddress.
In cases where we want to be able to decode a string that
is known to be a unified address, it doesn't make sense to have
to route through KeyIO::DecodePaymentAddress and then return
an error depending upon the result type, when it's possible to
provide unified address parsing more directly.

KeyIO::DecodePaymentAddress has been modified to delegate
to UnifiedAddress::Parse
2022-02-17 18:27:15 -07:00
Kris Nuttycombe dcf7f46260 Add test for Orchard wallet note detection.
This tests the following operations:
* add a spending key to the wallet
* add notes from the Orchard bundle component of a transaction to the
  wallet
* detect notes in the wallet that correspond to the spending key
* verify that notes that are not ours are not mistakenly labeled
  as ours
2022-02-17 17:50:17 -07:00
Kris Nuttycombe 4c53499f11 Add GetFilteredNotes to Orchard wallet. 2022-02-17 17:50:17 -07:00
Kris Nuttycombe 6587b2ed86 Add Rust backend for Orchard components of the wallet.
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-17 17:50:17 -07:00
Larry Ruane ba9e020fcd add functional test 2022-02-17 16:47:59 -07:00