Commit Graph

15925 Commits

Author SHA1 Message Date
str4d 12b37d5a11
Merge pull request #5665 from str4d/5657-z_sendmany-orchard-spends
Add support for sending Orchard funds in `z_sendmany`
2022-03-16 18:12:56 +00:00
str4d 454e7640f0
Merge pull request #5680 from nuttycom/saplingmigration_explicit_change
Explicitly specify the change address in the Sapling migration.
2022-03-16 13:11:02 +00:00
Kris Nuttycombe b9b471bfa6
Merge pull request #5684 from nuttycom/feature/wallet_orchard-rpc_doc_cleanup
Address minor issues from #5605
2022-03-15 21:43:47 -06:00
Kris Nuttycombe 5c9b7ec4df
Merge pull request #5671 from therealyingtong/ua-z_getbalance
z_getbalance: Handle Unified Address case.
2022-03-15 19:29:37 -06:00
Kris Nuttycombe 860fc8886a Update documentation of z_importviewingkey and z_exportviewingkey to address unified keys. 2022-03-15 16:39:26 -06:00
Kris Nuttycombe 482f0e7e44 Return the correct error for `z_getbalance` if a UA does not correspond to an account in the wallet..
Also, update the help text for z_getbalance to suggest that the user
prefer z_getbalanceforviewingkey.

Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-15 16:22:05 -06:00
ying tong 1cd92e579c Style improvements in RPC tests.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-15 16:22:05 -06:00
therealyingtong c1cd8a7e2d Adapt RPC tests to use z_getbalance for UAs. 2022-03-15 16:22:05 -06:00
therealyingtong 6caec7aef1 z_getbalance: Handle Unified Address case. 2022-03-15 16:22:05 -06:00
Kris Nuttycombe 235767ba6e Document that Orchard keys are not supported in z_importkey help 2022-03-15 16:07:37 -06:00
Kris Nuttycombe 24ce54f3ed Add orchard support to z_getnotescount 2022-03-15 15:49:01 -06:00
Kris Nuttycombe 5d65952f54 Document that z_getnewaccount and z_getaddressforaccount replace z_getnewaddress. 2022-03-15 15:32:06 -06:00
Kris Nuttycombe 1b1495b7d7 Add TODO for Orchard z_listunspent integration. 2022-03-15 15:31:40 -06:00
Jack Grigg 381b626a78 Set default Orchard anchor confirmations to 1
Currently we cannot use anything greater than 1, because the Orchard
witness tree cannot provide authentication paths to anything but the
current tree root. Once zcash/incrementalmerkletree#22 is implemented,
we can revert this change as part of zcash/zcash#5644.
2022-03-15 19:53:30 +00:00
Jack Grigg c2220f4eb9 Add support for sending Orchard funds in `z_sendmany`
Closes zcash/zcash#5665.
2022-03-15 19:53:30 +00:00
Kris Nuttycombe 7ba239e605 Explicitly specify the change address in the Sapling migration. 2022-03-15 10:57:19 -06:00
Jack Grigg d49c8a2865 Add Orchard to change address generation 2022-03-15 16:41:09 +00:00
Jack Grigg d4eee99060 Add Orchard cases to note selection logic 2022-03-15 16:41:09 +00:00
Jack Grigg f2ae807891 Implement opportunistic shielding in `SpendableInputs::LimitToAmount`
We now use the total funds in each available pool to figure out whether
a particular desired selection order can provide the requested amount,
and can alter the selection order each time we add another pool.
2022-03-15 16:41:09 +00:00
Jack Grigg 920de99c85 Select spendable inputs based on recipient and change pool types
This information enables us to select notes and coins in a way that
minimizes information leakage while moving funds into the shielded pool
where possible.
2022-03-15 16:41:09 +00:00
Jack Grigg 959b068468 Fix bug in `SpendableInputs::LimitToAmount`
This method selects inputs by iterating through available notes and
coins until sufficient value is found, and then dropping the remaining
notes and coins. However, the processing of each pool type was gated on
having not selected sufficient funds. This meant that if an earlier pool
had sufficient funds to fill a transaction, later pools would not be
processed at all and their notes would be left as selectable.
2022-03-15 16:41:09 +00:00
Jack Grigg 63437e4c18 Add unit tests for `SpendableInputs::LimitToAmount` 2022-03-15 16:41:09 +00:00
Jack Grigg f56a04ded2 Refactor `CWallet::GenerateChangeAddressForAccount`
There are no functional changes in this commit, but the refactor
separates the legacy account handling, and makes it easier to integrate
new pool types.

We also rename `libzcash::ChangeType` to `OutputPool`, in anticipation
of using it to track transaction recipient pools.
2022-03-15 16:41:09 +00:00
Kris Nuttycombe c3c5236cee
Merge pull request #5656 from nuttycom/feature/wallet_orchard-note_commitment_tree_ser
Add Orchard note commitment tree serialization & restore.
2022-03-14 23:16:44 -06:00
Kris Nuttycombe 5a98080677 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-14 19:13:25 -06:00
ying tong 4d7892bdde
Merge pull request #5649 from therealyingtong/conflicted-orchard-spends
Report conflicted Orchard spends
2022-03-15 07:46:02 +08:00
Kris Nuttycombe 19bce27321
Merge pull request #5641 from nuttycom/feature/wallet_orchard-restore_orchard_spends
Restore Orchard spentness cache in LoadCaches
2022-03-12 14:21:38 -07:00
Kris Nuttycombe c9938d0348
Update orchard_wallet_add_notes_from_bundle documentation. 2022-03-12 11:46:48 -07:00
Kris Nuttycombe 4eda33f184 Serialize the Orchard note commitment tree to the wallet.
This adds serialization of Orchard note commitment trees
to `SetBestChain` and deserialization and loading of those
trees to wallet load.
2022-03-11 22:47:37 -07:00
Kris Nuttycombe 30dd633de6 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-11 22:39:06 -07:00
Kris Nuttycombe 5d17e53c5c Address suggestions from code review on #5637 2022-03-11 22:39:06 -07:00
Kris Nuttycombe f5b23b3336 Modify `join_network` in tests to skip mempool resync.
Prior to this change, calling `join_network` after a network split
only worked in the case that no new non-coinbase transactions were
created during the network partition; in the case that such a
transaction was created, `join_network` would fail when waiting
for mempool synchronization, because zcashd nodes do not.
automatically broadcast their mempool contents on restart.

This change modifies `setup_network` to wait for mempool synchronization
or not on the basis of a newly added do_mempool_sync flag. In the
case of `join_network`, this flag is set to `False`; the default value
is set to `True` to preserve previous functionality elsewhere.

Tests should explicitly use the `resendwallettransactions` RPC method
to ensure that mempool transactions are rebroadcast before attempting
to synchronize the network after a `join_network` call.
2022-03-11 22:39:06 -07:00
Kris Nuttycombe 1e1521f101 Ensure that Orchard spentness information is repopulated by LoadUnifiedCaches. 2022-03-11 22:39:06 -07:00
str4d 0f59c5b926
Merge pull request #5658 from str4d/5570-tx-builder-orchard-spends
Add Orchard sender support to the transaction builder
2022-03-12 04:33:06 +00:00
therealyingtong 3c0e1d9aa8 CWallet::GetConflictS: Handle conflicting Orchard spends.
Co-authored by: Kris Nuttycombe <kris@nutty.land>
2022-03-11 19:30:52 -07:00
Jack Grigg 93797d185b Improve FFI interface documentation
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-12 01:33:39 +00:00
Jack Grigg 7921ef1c55 wallet: Alter `OrchardWallet::GetSpendInfo` to return the spending key
In the context of `z_sendmany`, we will need both the spending key and
note spendInfo as a pair, so it makes sense to fetch those together.
2022-03-11 03:31:00 +00:00
Jack Grigg 6a7213b5d5 Add Orchard spend support to the transaction builder
Closes zcash/zcash#5570.
2022-03-11 03:30:55 +00:00
str4d 8964763bef
Merge pull request #5653 from nuttycom/feature/wallet_orchard-merge_master
Merge master branch back to `feature/wallet_orchard`
2022-03-11 03:19:18 +00:00
Kris Nuttycombe 880cbe0dc4
Merge pull request #5647 from therealyingtong/orchard-nullifier-test
Update `coins_tests.cpp` to test Orchard cases.
2022-03-10 06:59:19 -07:00
Kris Nuttycombe 8bf99eaacc Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-09 22:17:49 -07:00
Kris Nuttycombe b21ca34d44
Merge pull request #5637 from nuttycom/feature/wallet_orchard-persist_action_ivks
Implement Orchard note persistence & restore.
2022-03-09 22:13:26 -07:00
Kris Nuttycombe f057ebb375 Apply suggestions from code review 2022-03-09 17:48:27 -07:00
Kris Nuttycombe e63d52896a Restore mined block heights when restoring decrypted notes. 2022-03-09 17:48:27 -07:00
Kris Nuttycombe ca34a97a37 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-09 13:26:10 -07:00
Kris Nuttycombe 98ee3bd733 Update tests with rollback checks. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe dc1609094d Restore decrypted notes to the wallet. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe 0149451217 Persist Orchard action index/IVK mappings in CWalletTx 2022-03-09 09:26:37 -07:00
Kris Nuttycombe ecd0d24baa Update walletTx with decrypted Orchard action metadata. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe 46c33c68e0
Merge pull request #5642 from nuttycom/feature/wallet_orchard-fix_confirmations
Set number of confirmations & respect maxDepth in Orchard note selection.
2022-03-09 07:58:27 -07:00