Commit Graph

828 Commits

Author SHA1 Message Date
jimmycathy 3510384f10 chore: remove repetitive words
Signed-off-by: jimmycathy <clonecode@outlook.com>
2024-05-04 20:54:15 +08:00
Kris Nuttycombe f28aa6b304 `zcash_{keys, client_backend}`: Fix no-default-features build. 2024-04-11 18:00:59 -06:00
Kris Nuttycombe b60600a4c3 zcash_client_sqlite: Use `ZcashAddress` for persistence of sent note addresses
Prior to this change, the recipient of a sent transaction would always
be shown as the protocol-level address, instead of any unified address
intended as the recipient. Now, instead of reencoding the recipient
address, we use the original `ZcashAddress` value from the payment
request.
2024-04-05 16:48:13 -06:00
Kris Nuttycombe 86e1181259 zip321: Make `Payment` fields private. 2024-04-05 16:30:31 -06:00
Kris Nuttycombe 3ea7d84183 zcash_client_backend: Update to use extracted `zip321` crate 2024-04-05 16:25:21 -06:00
Kris Nuttycombe d982d7826a zip321: Replace dependencies on `zcash_keys` types with `zcash_address` 2024-04-05 16:10:22 -06:00
Kris Nuttycombe fdf86ad740 Move `zcash_client_backend::zip321` to the `zip321` crate. 2024-04-03 12:14:20 -06:00
Jack Grigg 24277a6ba4 zcash_client_backend: Implement async wallet synchronization function
This implements the necessary state machine for taking a wallet in some
arbitrary synchronization status, and fully scanning (the remainder of)
the chain.

Closes zcash/librustzcash#1169.
2024-04-02 00:26:08 +00:00
oscar-pepper 25b8404e2d
Add block cache trait (#1192) 2024-04-01 21:55:16 +01:00
Kris Nuttycombe 1cb33c8b06 zcash_client_backend release version 0.12.1 2024-03-27 14:58:12 -06:00
Kris Nuttycombe d431889560 zcash_client_sqlite: Fix incorrect input selection filtering when sending to transparent.
The "avoid pool crossing" conditions in not selection were erroneously
not taking into account the need to pay transparent outputs.
2024-03-27 14:58:12 -06:00
Kris Nuttycombe 777adb871d Release zcash_client_backend version 0.12.0
Closes #1079
2024-03-25 14:03:42 -06:00
Kris Nuttycombe 151e6e526e zcash_client_backend: Track external addresses in inter-account transactions.
Previously, if the funding account for a received transaction output was
determined to be an account known to the wallet, the output was recorded
as though it were sent to an internal (change) address of the wallet.
2024-03-25 07:59:21 -06:00
Kris Nuttycombe 7e7dba8020 zcash_client_sqlite: Add `get_funding_accounts` method. 2024-03-25 07:59:20 -06:00
Kris Nuttycombe 874d6b608b zcash_client_backend: Ensure checkpoint at the end of each block.
This fixes an error wherein a note commitment in the last note
commitment position in a block was not being correctly marked as a
checkpoint.

This would occur when a block contained both Sapling and Orchard note
commitments, but the final transaction in the block contained only
either Sapling or Orchard note commitments, but not both.

Fixes #1302
2024-03-24 11:50:12 -06:00
Kris Nuttycombe 5d3ddabe24 zcash_client_sqlite: Add a test to attempt to simulate the checkpoint conflict bug (not failing.) 2024-03-23 08:37:59 -06:00
Kris Nuttycombe dc4fccf566 zcash_client_sqlite: Modify `TestState` to allow initialization with chain state. 2024-03-20 20:43:49 -06:00
Kris Nuttycombe 5f1d75937b zcash_client_backend: Treat protobuf default as the empty tree.
Fixes #1280
2024-03-19 17:26:45 -06:00
str4d 97651a6d4b
Merge pull request #1289 from nuttycom/sqlite_wallet/branching_chain_test_fixes
zcash_client_sqlite: Fix `scan_complete` tests.
2024-03-19 22:47:30 +00:00
Kris Nuttycombe 4f7c5bd722 zcash_client_sqlite: Fix `scan_complete` tests. 2024-03-19 16:11:57 -06:00
Jack Grigg b189fe7a36 Remove `orchard` feature flag from behind `zcash_unstable` cfg flag 2024-03-19 18:24:39 +00:00
Jack Grigg 3090aff87f Distinguish seed relevance when no derived accounts are present
During wallet migration in particular, the absence of _any_ accounts is
expected, and all seeds should be treated as relevant (because accounts
cannot be added before a wallet is initialized).
2024-03-19 17:53:41 +00:00
Jack Grigg e6bc21b461 Add `WalletRead::is_seed_relevant_to_any_derived_accounts` 2024-03-19 00:34:28 +00:00
Jack Grigg 703e50ae03 Add `Account::uivk`
The blanket `impl Account<A> for (A, Option<UnifiedFullViewingKey>)` is
removed because we cannot know the UIVK for `(A, None)`. We instead
provide a blanket impl for `(A, UnifiedIncomingViewingKey)`. We also
move both of them behind `test-dependencies` because they are only
intended for testing purposes.
2024-03-19 00:34:28 +00:00
Kris Nuttycombe ab3e790bfc zcash_client_backend: Rename `AccountKind` to `AccountSource` 2024-03-15 09:28:35 -06:00
Willem Olding 1775f6525b
Add WASM support to `lightwalletd-tonic` feature flag (#1270)
The transport-specific code is moved behind a new `lightwalletd-tonic-transport` feature flag.
2024-03-15 11:58:13 +00:00
Kris Nuttycombe 46fd6ab0fe zcash_client_backend: Make `WalletRead::get_transaction` return `Result<Option<Transaction>, _>`
This should never have had the behavior of returning an error on a
missing txid in the first place; doing so conflates database corruption
or connectivity errors with the ordinary case where data may not be
available.
2024-03-14 17:38:51 -06:00
Kris Nuttycombe cc990b60e0 zcash_keys: Remove HdSeedFingerprint as it duplicates `zip32::fingerprint::SeedFingerprint` 2024-03-14 17:09:03 -06:00
Kris Nuttycombe 0bae47b05b zcash_client_backend: Improve API ergonomics for input selection. 2024-03-13 19:33:06 -06:00
Kris Nuttycombe 22f341888f zcash_client_backend: Add `SpendableNotes` type and `NoteRetention` trait. 2024-03-13 19:32:16 -06:00
str4d 2e0a3005de
Merge pull request #1268 from nuttycom/sqlite_wallet/cross_pool_note_selection
zcash_client_backend: Fix note selection & add more multi-pool tests.
2024-03-14 01:12:42 +00:00
Kris Nuttycombe a81e7ff306 zcash_client_backend: Fix note selection & add more cross-pool tests. 2024-03-13 18:44:36 -06:00
Jack Grigg bbb7f36e55 zcash_client_backend: Add `WalletRead::get_account` 2024-03-13 21:00:59 +00:00
Jack Grigg 64aabdc54a Rename `WalletRead::get_seed_account` to `WalletRead::get_derived_account` 2024-03-13 21:00:59 +00:00
Jack Grigg 5f3d5e9f4a zcash_client_sqlite: Use `wallet::Account` for `WalletRead::Account` 2024-03-13 21:00:59 +00:00
Jack Grigg 65093487c3 zcash_client_backend: Expose the kind of an `Account` 2024-03-13 21:00:59 +00:00
Kris Nuttycombe dd63a6e3dd zcash_client_backend: Remove unnecessary `ReceivedNote::traverse_opt` 2024-03-13 14:19:26 -06:00
Kris Nuttycombe b2597aa952 zcash_client_backend: Add a test for ZIP 317 cross-pool payments. 2024-03-13 13:54:53 -06:00
Jack Grigg 634ebf51ef Reorder `WalletRead` and `WalletWrite` trait methods for clarity 2024-03-13 16:00:32 +00:00
Jack Grigg 7d603b8c59 zcash_client_backend: Add `proto::service::TreeState::to_chain_state` 2024-03-13 12:54:58 +00:00
Kris Nuttycombe a0460886f4 Fix stray clippy complaint. 2024-03-12 18:27:02 -06:00
Kris Nuttycombe 2ba89a6d16 zcash_client_backend: Fix `scan_cached_blocks` example doc compilation errors. 2024-03-12 18:27:02 -06:00
Kris Nuttycombe f58263e211 zcash_client_backend: Require the tree state for the start of each scanned range.
In order to support constructing the anchor for multiple pools with a
common anchor height, we must be able to checkpoint each note commitment
tree (and consequently compute the root) at that height. Since we may
not have the information in the tree needed to do so, we require that it
be provided.

As a bonus, this change makes it possible to improve the UX around
spendability, because we will no longer require subtree ranges below
received notes to be fully scanned; the inserted frontier provides
sufficient information to make them spendable.
2024-03-12 18:14:11 -06:00
Kris Nuttycombe 0c5a365c60 zcash_client_sqlite: Update to make use of `orchard::note::Rho` 2024-03-12 17:28:10 -06:00
Kris Nuttycombe 33e943d14a zcash_client_backend: Add `WalletRead::get_seed_account` 2024-03-12 11:21:04 -06:00
Kris Nuttycombe 5e810d3689
Merge pull request #1258 from nuttycom/sqlite_wallet/fuzzy_key_matching
Return partial matches when using `WalletRead::get_account_for_ufvk`.
2024-03-12 11:12:34 -06:00
Kris Nuttycombe 09181f458c zcash_client_sqlite: Return a backend-specific `Account` type from get_account_by_ufvk. 2024-03-12 08:59:53 -06:00
Jack Grigg 5a6057b8fb zcash_client_backend: Detect Orchard dust in `zip317::SingleOutputChangeStrategy` 2024-03-11 18:58:09 +00:00
Kris Nuttycombe 1028894324 zcash_client_sqlite: Minor refactoring for improved debuggability & future Sapling flagging. 2024-03-11 18:58:09 +00:00
Kris Nuttycombe 8dfa836a03 zcash_client_sqlite: Use correct offsets for Orchard commitment positions. 2024-03-11 17:42:23 +00:00