Commit Graph

889 Commits

Author SHA1 Message Date
Kris Nuttycombe f063e7ab7e Merge remote-tracking branch 'upstream/main' into sqlite_legacy_support 2024-09-03 12:29:04 -06:00
Kris Nuttycombe 1b8334104d zcash_client_sqlite: Accept 2-part `major.minor` SQLite versions. 2024-09-03 12:20:12 -06:00
Kris Nuttycombe 61584f7cc0 zcash_client_sqlite: Verify sqlite version compatibility on wallet init. 2024-09-02 21:21:57 -06:00
Kris Nuttycombe c91b34ef87 Support older `sqlite` versions.
The `FALSE` constant was introduced in sqlite version 3.23.0,
but Android does not support this version of sqlite until API
level 30; we support back to Android API 27 so we have to use
`0` as the constant for `FALSE` instead.
2024-08-30 11:23:45 -06:00
Kris Nuttycombe 7d3e5754d6 zcash_client_sqlite: Add missing test of `utxos_to_txos` migration. 2024-08-22 12:13:20 -06:00
Kris Nuttycombe 3dba2fa9ae zcash_client_sqlite: Make `tx_retrieval_queue` depend upon all leaf migrations 2024-08-21 16:01:51 -06:00
Kris Nuttycombe b1cb8be244 zcash_client_sqlite: Make migration dependencies easier to track. 2024-08-21 15:50:39 -06:00
Kris Nuttycombe e4b3fb27b5 zcash_client_sqlite: Fix clippy complaints. 2024-08-21 14:14:31 -06:00
Jack Grigg 34402f7bea zcash_client_sqlite: Adjust migration DAG edges to fix dependency bug 2024-08-21 15:06:00 -05:00
Jack Grigg 6903fa6543 zcash_client_sqlite: Add test showing tx_retrieval_queue migration bug 2024-08-21 14:58:11 -05:00
Jack Grigg 7c416d533b zcash_client_sqlite: Add test for linear migration between db states 2024-08-21 14:27:59 -05:00
Kris Nuttycombe 5a32d3b9bd zcash_client_sqlite: Ensure the end heights of `SpendsFromAddress` requests do not exceed the chain tip.
`lightwalletd` will return an error in the case that the requested end
height exceeds the chain tip. This should be considered a bug in
lightwalletd, but for now we will work around it in the wallet.
2024-08-19 12:10:14 -06:00
Kris Nuttycombe 484659dddb zcash_client_sqlite: Reprocess wallet transactions on upgrade to restore additional transparent history. 2024-08-16 16:55:03 -06:00
Kris Nuttycombe c22a2a4c92 zcash_client_sqlite: Move `store_decrypted_tx` to the `wallet` module.
This permits this method to be used in a migration.
2024-08-16 16:42:18 -06:00
Kris Nuttycombe 4059bfeca2 zcash_client_sqlite: Ensure we will query for status of unmined transactions in `store_decrypted_tx` 2024-08-16 14:24:15 -06:00
Kris Nuttycombe 3089e3b29d zcash_client_sqlite: Do not overwrite address on update in `put_sent_output` 2024-08-16 13:07:12 -06:00
Kris Nuttycombe 895d92b66b zcash_client_sqlite: Ensure we set mined-ness information in `store_decrypted_tx` 2024-08-16 10:49:59 -06:00
Kris Nuttycombe 54f59a8778 zcash_client_sqlite: Track all transparent spends.
Prior to this change, the `mark_transparent_utxo_spent` method assumed
that the UTXO information for outputs belonging to the wallet would be
known to exist before their spends could be detected. However, this is
not true in transparent history recovery: the spends are detected first.
We now cache the information about those spends so that we can then
correctly record the spend when the output being spent is eventually
detected.

At present, data from this spend cache is never deleted. This is because
such deletions could undermine history recovery in some narrow cases
related to chain reorgs.
2024-08-15 16:37:37 -06:00
Kris Nuttycombe 05887be962
Merge pull request #1487 from daira/improve-doc-for-send-multi-test
Improve the accuracy of a comment in `send_multi_step_proposed_transfer`
2024-08-12 08:15:38 -06:00
Daira-Emma Hopwood a021b9f277 Ensure that `zcash_client_sqlite` only enables "orchard" for `zcash_keys` when
its own "orchard" feature is enabled.

fixes #1488

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-11 18:34:52 +01:00
Daira-Emma Hopwood bd38645da5 When adding an account, check whether any component of its UFVK
(if available) collides with an existing imported or derived FVK.

This does not check for collisions on IVK for `Incoming` accounts.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-11 00:24:05 +01:00
Daira-Emma Hopwood 03c2e538ca Improve the accuracy of a comment in `send_multi_step_proposed_transfer`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-10 10:40:36 +01:00
Kris Nuttycombe ac7cbf9a41 zcash_client_backend: Add a `purpose` modifier for imported accounts.
This moves the tracking of whether or not a spending key is expected to
be available for an imported account into the `AccountSource::Imported`
variant.
2024-08-09 18:38:39 -06:00
Jack Grigg 52abb1f057
Merge pull request #1473 from nuttycom/wallet/enrichment_queue
Add queues to track the need for transaction enhancement and/or verification of mined status.
2024-08-10 00:37:23 +01:00
Kris Nuttycombe b47c7bfe8d zcash_client_sqlite: Improve the internal documentation of `set_transaction_status` 2024-08-09 17:30:37 -06:00
Kris Nuttycombe 5a1645ac76 zcash_client_sqlite: Make transaction retrieval depend upon presence of raw tx data. 2024-08-09 16:55:35 -06:00
Kris Nuttycombe 0bfa3d35bc Merge remote-tracking branch 'daira/1485-improve-multi-step-test' into wallet/enrichment_queue 2024-08-09 15:57:36 -06:00
Daira-Emma Hopwood 1023ce7f99 Replace the `put_tx_meta` workaround in `send_multi_step_proposed_transfer`.
fixes #1485

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 22:34:36 +01:00
Daira-Emma Hopwood 56e42336c4 Minor simplifications.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 22:33:00 +01:00
Daira-Emma Hopwood 239f7ff404 Improve the accuracy of a comment in `set_transaction_status`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 22:32:40 +01:00
Kris Nuttycombe 171cc3d185 Address review comments in `transaction_data_requests` 2024-08-09 15:10:53 -06:00
Kris Nuttycombe 8752ad7e19 zcash_client_backend: Add `target_height` to `SentTransaction` 2024-08-09 14:09:51 -06:00
Daira-Emma Hopwood d96bc11055 Add a comment explaining why it is safe to unconditionally delete the
request in `set_transaction_status`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 19:03:30 +01:00
Kris Nuttycombe dada980473 zcash_client_sqlite: Add testing for transaction data request generation. 2024-08-09 11:36:34 -06:00
Kris Nuttycombe 366a3e3323 Apply suggestions from code review
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 10:45:28 -06:00
Kris Nuttycombe 52f7a77cae Apply suggestions from code review
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-07 12:25:06 -06:00
Kris Nuttycombe a3109cfb78 zcash_client_sqlite: Add queue for transparent spend detection by address/outpoint. 2024-08-06 12:25:44 -06:00
Kris Nuttycombe 69828bc0d0 zcash_client_sqlite: Add `target_height` column to `transactions` table. 2024-08-06 12:25:44 -06:00
Kris Nuttycombe 3da29d2506 zcash_client_backend: Add transaction data requests.
This adds a mechanism that can be used by the backend to request
additional transaction data or status information from the client,
for the purpose of being to explore transparent transaction history
that is otherwise currently unavailable.
2024-08-06 12:25:44 -06:00
Kris Nuttycombe 7fbc6568aa zcash_client_sqlite: Ensure that max_observed_unspent height is set correctly. 2024-08-06 12:25:44 -06:00
Kris Nuttycombe 18207883ea zcash_client_backend: Add `block_height` argument to `decrypt_and_store_transaction`
In the case that `decrypt_and_store_transaction` is being used to add
data for fully-transparent transactions to the database, it may be the
case that there is no existing relationship between a transaction and
the block height at which it was mined (unlike for transactions being
enhanced after discovery via block scanning.) This change makes it
possible to set the mined height for transactions that do not have any
shielded components that involve the wallet.
2024-08-06 12:25:44 -06:00
Kris Nuttycombe 1057ddb516 zcash_client_sqlite: Add a table to track transaction status and enrichment requests. 2024-08-06 12:25:44 -06:00
Alfredo Garcia 5a4a3e06dc
Make `nu6` rust feature stable (#1454) 2024-08-06 00:01:03 +01:00
Kris Nuttycombe 301e8b497c zcash_client_sqlite: Add an internal newtype for transaction primary key values. 2024-07-29 15:08:40 -06:00
Kris Nuttycombe 7f7b685b99
Merge pull request #1465 from zcash/post-1425-fixes
Post #1425 fixes
2024-07-29 14:42:13 -06:00
Jack Grigg ec3d5604bc zcash_client_sqlite: Move imports out of test function
After zcash/librustzcash@7c5ac7b151 we now
need to conditionally import some of them at the module level anyway.
2024-07-29 19:53:06 +00:00
Daira-Emma Hopwood f54ecbd285 Use a single database transaction when storing transactions to be sent.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-29 18:57:31 +01:00
Daira-Emma Hopwood e856430c8e [move only] Move the body of `store_sent_tx` to `zcash_client_sqlite::wallet`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-29 18:48:11 +01:00
Jack Grigg b42deab857 zcash_client_sqlite: Fix transparent input size in `shield_transparent`
The test was previously shielding a 10,000 zatoshi transparent input,
which was precisely enough to pay the ZIP 317 fee, and resulted in a
"shielding" transaction that had one transparent input, and no outputs
of any kind. Under our new `is_shielding` definition in `v_transactions`
this would not be a shielding transaction (it is effectively a "donate
coin to miners" transaction).
2024-07-29 16:50:05 +00:00
Jack Grigg 04e8d0bad7 zcash_client_sqlite: Add `is_shielding` to `v_transactions` view
Closes zcash/librustzcash#1046.
2024-07-29 16:44:04 +00:00