Commit Graph

2446 Commits

Author SHA1 Message Date
Daira Hopwood f78c91fd0c
Merge pull request #651 from daira/update-chacha20poly1305
Update chacha20poly1305 dependency in zcash_primitives to 0.10
2022-09-23 22:12:32 +01:00
Daira Hopwood e53439a236 Update chacha20poly1305 dependency in zcash_primitives to 0.10,
consistent with zcash_note_encryption.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-23 21:52:40 +01:00
Kris Nuttycombe 774ffadf5a
Merge pull request #649 from zcash/batch-scanner-memory-reduction
Batch scanner memory reduction
2022-09-22 07:44:05 -06:00
Jack Grigg 9a1d61cb4e zcash_client_backend: Only store successes in batch scanner
Previously we were sending an `Option<DecryptedNote>` from each `Batch`
back to its parent `BatchRunner`. However, this requires allocating
sufficient space in the channel to handle the case where every output
can be decrypted. In general this will not be the case, and we can
instead signal "nothing decrypted" by just dropping the channel sender.
This reduces the post-batch-scanning memory usage of `BatchRunner` from
being linear in the number of on-chain outputs, to being linear in the
number of outputs for the wallet.

Ported from zcash/zcash@f7f6c2070d.
2022-09-21 23:51:40 +00:00
Jack Grigg 533722b70e zcash_client_sqlite: Add dynamic memory usage tracking to `BatchRunner`
Ported from zcash/zcash@e88ea11055.
2022-09-21 23:38:44 +00:00
Kris Nuttycombe 6cb0d21219
Merge pull request #645 from nuttycom/fix_beta_lints
Fix problems identified by clippy's beta lints
2022-09-17 15:49:49 -06:00
Kris Nuttycombe 03c3370de8 Fix problems identified by clippy's beta lints 2022-09-17 08:57:37 -06:00
Kris Nuttycombe d1f0c12c02
Merge pull request #644 from zcash/fix-fsblockdb-cached-height
zcash_client_sqlite: Fix `FsBlockDb::get_max_cached_height`
2022-09-16 21:19:25 -06:00
Jack Grigg 5b8ec380a0 zcash_client_sqlite: Fix `FsBlockDb::get_max_cached_height`
The `MAX` SQLite function returns `null` when the table is empty. The
code was expecting zero rows to be returned in this case, and was trying
to parse the `null` as an integer.
2022-09-17 02:40:19 +00:00
Kris Nuttycombe bc626156c3
Merge pull request #641 from nuttycom/upgrade_chacha20
Upgrade chacha20poly1305 dependency to version 0.10
2022-09-16 14:39:32 -06:00
Kris Nuttycombe 29220c716f Remove `zcash_primitives` as a zcash_note_encryption dev dependency.
This was only used to provide example code for Sapling usage of
the `NoteEncryption` struct; this example code has been moved
to `sapling::note_encryption`.
2022-09-16 12:52:00 -06:00
Kris Nuttycombe 72b5e6dfc3 Upgrade chacha20poly1305 dependency to version 0.10
Also upgrade  the `chacha20`, `cipher`, and `subtle` dependency
versions.
2022-09-16 12:52:00 -06:00
Kris Nuttycombe d3add8cca4
Merge pull request #596 from nuttycom/wallet/fs_block_source
Add a BlockSource implementation that reads blocks from files in the filesystem.
2022-09-15 09:55:14 -06:00
Kris Nuttycombe f8fd27653c Add a BlockSource implementation that reads blocks from files in the filesystem.
Also, this adds functionality to create and insert records into the
block metadata db that is used as the source for which blocks to read.
2022-09-15 08:27:26 -06:00
str4d 84835035d5
Merge pull request #633 from daira/prepare-epks-and-ivks
Add APIs to prepare ivk and epk and implement them for Sapling
2022-09-15 12:45:33 +01:00
Daira Hopwood 20e869f501 zcash_primitives: Use prepared epk and ivk in Sapling note decryption
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:40:45 +01:00
Daira Hopwood 515b0a40ec zcash_note_encryption: Add API to prepare epk.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:22:41 +01:00
Daira Hopwood d77ed9c6cf Change batch decryption benchmark to cover more cases of (nivks, noutputs).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:20:14 +01:00
Kris Nuttycombe 3bc8627e2b
Merge pull request #637 from nuttycom/wallet/create_account
Add WalletWrite::create_account function
2022-09-14 14:30:34 -06:00
Kris Nuttycombe d086c57f2f Make init_accounts_table only permit sequential account identifiers.
Also, check to ensure that account creation does not exceed the
maximum account identifier value.
2022-09-14 13:55:31 -06:00
Kris Nuttycombe 75eb082203
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-09-14 12:20:39 -06:00
Kris Nuttycombe abe452d8a5
Merge pull request #638 from zcash/ci-tarpaulin-llvm-engine
CI: Migrate to `cargo-tarpaulin` branch with LLVM source coverage engine
2022-09-14 11:05:02 -06:00
Jack Grigg d21b18d245 CI: Migrate to `cargo-tarpaulin` branch with LLVM source coverage engine 2022-09-14 15:55:12 +00:00
Kris Nuttycombe d0062a87d4 Add WalletWrite::create_account function 2022-09-13 18:58:28 -06:00
Kris Nuttycombe d4cbc04c16
Merge pull request #636 from zcash/batch-scanner-tag-ivks
zcash_client_backend: Add tags to IVKs in the batch scanner
2022-09-13 16:49:10 -06:00
Jack Grigg f7b7760051 zcash_client_backend: Add some typedefs for complex types 2022-09-13 21:58:32 +00:00
Jack Grigg 8f03208439 zcash_client_backend: Add tags to IVKs in the batch scanner
This removes the dependency on `SaplingIvk::to_repr()`, and enables us
to alter the type of `D::IncomingViewingKey` to improve the performance
of batch scanning.

For the welding rig, we already annotate the viewing keys with
`AccountId`, so we use `(AccountId, Scope)` as the tag.
2022-09-13 21:40:58 +00:00
Kris Nuttycombe b5908dc964
Merge pull request #632 from nuttycom/data_api/get_next_address
Replace `get_address` with `get_current_address` and `get_next_available_address`
2022-09-12 18:43:38 -06:00
Kris Nuttycombe 03b0ff7e0a Replace `get_address` with `get_current_address` and `get_next_available_address`
This updates the data access API to provide diversified address
functionality. In order to support this change, the addresses table
is updated to store diversifier index information in big-endian order
to allow sorting by diversifier index, and account initialization
is updated to store the diversifier index accordingly. The currently
unreleased `addresses_table` migration is updated to reflect this
change.
2022-09-12 17:58:22 -06:00
Kris Nuttycombe 306faeee17
Merge pull request #620 from nuttycom/wallet/add_transaction_views
Add views that join transactions & notes for Android SDK support.
2022-09-12 16:36:54 -06:00
Kris Nuttycombe 7d1e976d0a Add missing `WalletMigrationError` to changelog. 2022-09-10 17:02:43 -06:00
Kris Nuttycombe e14e44d6d7 Improve consistency of transaction views test. 2022-09-10 17:02:43 -06:00
Kris Nuttycombe 3120b304c7 Use `NULL` to represent the empty memo.
We don't need to store a bunch of copies of the empty memo, and code
should not be depending upon the presence or absence of a memo to
distinguish between different states of transaction retrieval.
2022-09-10 17:02:43 -06:00
Kris Nuttycombe a93c9d334e Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-09-10 17:02:43 -06:00
Kris Nuttycombe 167bcd86ce Update migration to handle the raw-tx-absent case.
The raw serialized transaction data for a transaction is not always
guaranteed to be present, and we cannot correctly calculate the fee
paid by a transaction if we don't have the raw data. For such rows
that contain only transaction metadata, the fee information will be
added at the same time the raw transaction data is added.
2022-09-10 17:02:43 -06:00
Kris Nuttycombe 7934e834d3 Add test for fee calculation in add_transaction_views migration. 2022-09-10 11:01:36 -06:00
Kris Nuttycombe b327bf7073 Move WalletMigrationAddTxViews to a submodule. 2022-09-10 11:01:36 -06:00
Kris Nuttycombe 7842e6274f Check against the standard empty memo for memo counts. 2022-09-09 16:32:37 -06:00
Kris Nuttycombe 95610f7b4f Add fee to the transactions table & compute correct net_value in v_transactions. 2022-09-09 16:12:29 -06:00
Kris Nuttycombe 66c9f31e14 Add memo counts to transaction views. 2022-09-09 16:09:56 -06:00
Kris Nuttycombe 81c948a37e Add views that join transactions & notes for Android SDK support.
Android does not provide a good way to perform outer joins in
its type-safe query builder API, so we expose views build using
those joins instead.
2022-09-09 16:09:04 -06:00
str4d e656ff5b8e
Merge pull request #610 from zcash/dependabot/github_actions/actions/cache-3.0.8
build(deps): bump actions/cache from 3.0.7 to 3.0.8
2022-09-09 19:23:07 +01:00
Kris Nuttycombe 1839696c75
Merge pull request #623 from zcash/489-addresses-table
`zcash_client_*`: Various changes to how addresses are handled
2022-09-08 18:51:16 -06:00
Jack Grigg 7112ed9da5 zcash_client_backend: Add `WalletReadTransparent::get_transparent_receivers`
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-09-08 20:24:42 +00:00
Jack Grigg 154ef077b4 zcash_client_sqlite: Move address data to an `addresses` table
Closes zcash/librustzcash#489.
2022-09-08 18:50:18 +00:00
Jack Grigg 7d404d2747 zcash_client_sqlite: Fix `WalletRead::get_address` return value
Previously it would return an error if the account identifier did not
correspond to a known account.
2022-09-08 18:49:41 +00:00
Jack Grigg a32714043b zcash_client_backend: Change `WalletRead::get_address` to return UA 2022-09-08 18:49:13 +00:00
Kris Nuttycombe 7455808adc
Merge pull request #625 from nuttycom/wallet/usk_encoding
Add a binary encoding format for unified spending keys.
2022-09-08 12:22:18 -06:00
Kris Nuttycombe 7b7288c750 (cleanup) Make the internals of `zip32::DiversifierKey` private 2022-09-08 11:17:14 -06:00
Kris Nuttycombe 8439f1a4f7 Add binary encoding for unified spending keys.
This encoding is wallet-internal-only and is currently
guarded under the `unstable` feature flag.
2022-09-08 11:05:59 -06:00